forked from infor-otp/Discord.js-v14-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.js
More file actions
35 lines (30 loc) · 794 Bytes
/
deploy.js
File metadata and controls
35 lines (30 loc) · 794 Bytes
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
const { token, id } = require('./setting.json')
const { REST, Routes } = require('discord.js');
const commands = [
{
name: 'ping',
description: '得知機器人的延遲資訊',
},
{
name: 'bot-info',
description: '查看機器人的相關資料及資訊',
},
{
name: 'user-info',
description: '查看指定使用者的資訊',
},
{
name: 'server-info',
description: '查看伺服器的資訊',
}
];
const rest = new REST({ version: '10' }).setToken(token);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(Routes.applicationCommands(id), { body: commands });
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();