-
Notifications
You must be signed in to change notification settings - Fork 1
/
registerCommands.js
105 lines (100 loc) · 2.43 KB
/
registerCommands.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
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const commands = [
{
name: 'join',
description: 'Join voice channel',
options: [
{
type: 3, // STRING
name: 'mode',
description: 'The mode to join in',
required: false,
choices: [
{
name: 'silent',
value: 'silent',
description: "The bot won't produce any sound in this mode (confirmation, processed, etc.)",
},
{
name: 'free',
value: 'free',
description: 'The bot does not need trigger word to talk and will respond to any voice input. This mode is not recommended for general use.',
},
{
name: 'transcribe',
value: 'transcribe',
description: 'The bot will save a transcription of the conversation and send it to the channel after using the `leave` command.',
},
],
},
],
},
{
name: 'reset',
description: 'Reset voice chat history',
},
{
name: 'play',
description: 'Play a song from YouTube',
options: [
{
type: 3, // STRING
name: 'query',
description: 'The song name or URL to play',
required: true,
},
],
},
{
name: 'search',
description: 'Search internet with LLM',
options: [
{
type: 3, // STRING
name: 'query',
description: 'Your query',
required: true,
},
],
},
{
name: 'reminder',
description: 'Set a reminder',
options: [
{
type: 3, // STRING
name: 'time',
description: 'Time to remind, in timestamp format (e.g. <t:1715869560>)',
required: true,
},
{
type: 3, // STRING
name: 'message',
description: 'Message to remind',
required: true,
},
],
},
{
name: 'leave',
description: 'Leave voice channel',
},
{
name: 'help',
description: 'Display help message',
},
];
const rest = new REST({ version: '9' }).setToken(process.env.DISCORD_TOKEN);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationCommands(process.env.DISCORD_ID),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();