-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-commands.js
26 lines (22 loc) · 1.48 KB
/
deploy-commands.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
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v10');
var guildId = process.env.DISCORD_GUILD_ID;
var clientId = process.env.DISCORD_APPLICATION_ID;
var token = process.env.DISCORD_BOT_KEY;
const commands = [
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
new SlashCommandBuilder().setName('support').setDescription('Create a channel to get help from admin!'),
new SlashCommandBuilder().setName('done').setDescription('Mark support case as finished!'),
new SlashCommandBuilder().setName('update-role').setDescription('Sync role with IOT!'),
new SlashCommandBuilder().setName('iot').setDescription('Get user profile on IOT - IMIN Olympia Training!').addUserOption(option => option.setName('user').setDescription('Player')),
new SlashCommandBuilder().setName('apply-reviewer').setDescription('Apply for reviewer role!'),
new SlashCommandBuilder().setName('resign-reviewer').setDescription('Re resign reviewer role!'),
]
.map(command => command.toJSON());
const rest = new REST({ version: '10' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);