-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
113 lines (108 loc) · 2.96 KB
/
index.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const Discord = require("discord.js");
const fs = require("fs");
const config = JSON.parse(fs.readFileSync("./config.json"));
const commands = JSON.parse(fs.readFileSync("./commands.json"));
const client = new Discord.Client();
client.login(config.loginToken);
client.once("ready", () => {
console.log("Ready");
});
commands.forEach((element) => {
client.api
.applications(config.botId).guilds("249809874853036033")
.commands.post({ data: element })
.then((response) => console.log(response))
.catch((error) => console.log(error));
});
client.ws.on("INTERACTION_CREATE", async (interaction) => {
const command = interaction.data.name;
const args = interaction.data.options;
if (commands.filter((x) => x.name === command).length > 0) {
if (command === "takematrix") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 4,
data: {
content:
"Q1 = Hot and Right, Q2 = Hot and Wrong, Q3 = Cold and Wrong, Q4 = Cold and Right",
},
},
})
.catch((error) => console.log(error));
}
else if (command === "everyone") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 4,
data: {
content:
"@everyone lmao",
},
},
})
.catch((error) => console.log(error))
}
else if (command === "model") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 4,
data: {
content:
"What's your model?",
},
},
})
.catch((error) => console.log(error))
}
else if (command === "thisu") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 3,
data: {
content:
"This, but unironically",
},
},
})
.catch((error) => console.log(error))
}
else if (command === "census") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 3,
data: {
content:
"https://www2.census.gov/library/publications/decennial/1860/population/1860a-31.pdf",
},
},
})
.catch((error) => console.log(error))
}
else if (command === "child") {
client.api
.interactions(interaction.id, interaction.token)
.callback.post({
data: {
type: 3,
data: {
content:
"Did a child write this?",
},
},
})
.catch((error) => console.log(error))
}
} else {
console.log("Unknown command.");
}
});