-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.js
44 lines (42 loc) · 989 Bytes
/
register.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
// Export a function that registers slash commands
module.exports = async (client) => {
client.on('ready', async () => {
const commands = [
{
name: 'dark',
description: 'Get a random dark joke',
},
{
name: 'help',
description: 'Help',
},
{
name: 'm',
description: 'Sends a random meme',
},
{
name: 'joke',
description: 'Sends a joke',
},
{
name: 'pickup',
description: 'Sends a lovely pickup line',
},
{
name: 'rizz',
description: 'Sends a lovely rizz line',
},
{
name: 'ping',
description: 'Pong!',
}
];
try {
// Register slash commands
await client.application.commands.set(commands);
console.log('Registered slash commands successfully.');
} catch (error) {
console.error('Error registering slash commands:', error);
}
});
};