Getting started
Commands Directory
We can set the path to the commands directory by using path
.
const { join } = require('path');
new GCommandsClient({
...options,
loader: {
cmdDir: join(__dirname + 'commands')
}
});
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Commands options
WARNING
You must invite the bot with the application.commands
scope for slash commands to work.
DANGER
It may take up to 1 hour for global commands to appear. guildOnly commands update instantly, and is advised to be used during development.
We can set options for the commands like this.
new GCommandsClient({
...options,
commands: {
slash: "both",
prefix: ".",
}
});
1
2
3
4
5
6
7
2
3
4
5
6
7
TYPE | DESCRIPTION |
---|---|
both | Message + Slash |
slash | Only slash |
message | Only message |
false | None |