-
Notifications
You must be signed in to change notification settings - Fork 0
/
components.js
55 lines (52 loc) · 1.63 KB
/
components.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// @ts-check
require("dotenv").config();
const oceanic = require("oceanic.js");
const Helper = require("../dist/helper"); // require("@mtripg6666tdr/oceanic-command-resolver") in installed environment
const bot = new oceanic.Client({
auth: `Bot ${process.env.TOKEN}`
});
bot.on("messageCreate", message => {
if(message.author.bot) return;
if(message.channel instanceof oceanic.TextChannel){
message.channel.createMessage({components: [
new Helper.MessageActionRowBuilder()
.addComponents(
new Helper.MessageStringSelectMenuBuilder()
.setCustomId("id")
.setOptions({
value: "1",
label: "1"
}),
)
.toOceanic(),
new Helper.MessageActionRowBuilder()
.addComponents(
new Helper.MessageInputSelectMenuBuilder(oceanic.ComponentTypes.USER_SELECT)
.setCustomId("users")
)
.toOceanic(),
new Helper.MessageActionRowBuilder()
.addComponents(
new Helper.MessageChannelSelectMenuBuilder()
.setCustomId("channel")
.setChannelTypes(oceanic.ChannelTypes.GUILD_FORUM)
)
.toOceanic(),
new Helper.MessageActionRowBuilder()
.addComponents(
new Helper.MessageButtonBuilder()
.setCustomId("aaaaaa")
.setDisabled(true)
.setLabel("HELLO")
.setStyle("PRIMARY"),
new Helper.MessageButtonBuilder()
.setUrl("https://example.com")
.setStyle("LINK")
.setLabel("Open example site"),
)
.toOceanic(),
],
});
}
});
bot.connect();