-
Notifications
You must be signed in to change notification settings - Fork 0
/
registerCommands.ts
73 lines (67 loc) · 2.17 KB
/
registerCommands.ts
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
import { SlashCommandBuilder, Routes, REST } from "discord.js";
import { envVariables } from "./utils/getEnvVariables";
import { HOXCommand } from "./utils/types";
const commands = [
new SlashCommandBuilder()
.setName(HOXCommand.solved)
.setDescription("Marks thread as solved"),
new SlashCommandBuilder()
.setName(HOXCommand.standup)
.setDescription("Post a standup message"),
new SlashCommandBuilder()
.setName(HOXCommand.zoom)
.addStringOption((option) =>
option
.setName("zoom-link")
.setDescription("Custom zoom link")
.setRequired(false)
)
.addStringOption((option) =>
option
.setName("message")
.setDescription("Set a custom message")
.setRequired(false)
)
.setDescription("Post zoom link!"),
new SlashCommandBuilder()
.setName(HOXCommand.event)
.addStringOption((option) =>
option
.setName("when")
.setDescription("when is the event taking place>")
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("what")
.setDescription("What's going on?")
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("where")
.setDescription("Where is the event happening (Zoom, channel, IRL etc)")
.setRequired(true)
)
.setDescription("Create a new event in this channel"),
new SlashCommandBuilder()
.setName(HOXCommand.beta_fixed_by)
.setDescription("Give stars to a student who helped fix your issue"),
new SlashCommandBuilder()
.setName(HOXCommand.kill)
.setDescription("Murder the bot in cold blood"),
new SlashCommandBuilder()
.setName(HOXCommand.restart)
.setDescription("Hit the bot until it works again"),
].map((command) => command.toJSON());
const rest = new REST({ version: "10" }).setToken(envVariables.token);
rest
.put(
Routes.applicationGuildCommands(
envVariables.clientId,
envVariables.guildId
),
{ body: commands }
)
.then(() => console.log("Successfully registered application commands."))
.catch(console.error);