-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.js
29 lines (26 loc) · 857 Bytes
/
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
27
28
29
require('dotenv').config();
const { REST, Routes } = require('discord.js');
const commands = [
{
name: 'my_anime',
description: 'Replies with random anime recommendation with its details!',
},
{
name: 'my_fact',
description: 'Replies with random fact about anime',
},
{
name: 'my_manga',
description: 'Replies with random anime recommendation with its details!',
}
];
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
( async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(Routes.applicationCommands(process.env.DISCORD_CLIENT_ID), { body: commands });
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();