WOKCommands
Searchโ€ฆ
Command categories
For categories to be displayed in the built-in help menu you must specify them when initializing WOKCommands. This can be done like so:
JavaScript
TypeScript
index.js
1
const DiscordJS = require('discord.js')
2
const WOKCommands = require('wokcommands')
3
const path = require('path')
4
โ€‹
5
const { Intents } = DiscordJS
6
โ€‹
7
const client = new DiscordJS.Client({
8
// These intents are recommended for the built in help menu
9
intents: [
10
Intents.FLAGS.GUILDS,
11
Intents.FLAGS.GUILD_MESSAGES,
12
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
13
],
14
})
15
โ€‹
16
client.on('ready', () => {
17
new WOKCommands(client, {
18
// The name of the local folder for your command files
19
commandsDir: path.join(__dirname, 'commands')
20
})
21
.setCategorySettings([
22
{
23
name: 'Fun & Games',
24
emoji: '๐ŸŽฎ'
25
},
26
{
27
name: 'Economy',
28
emoji: '๐Ÿ’ธ'
29
},
30
{
31
// You can change the default emojis as well
32
// "Configuration" is โš™ by default
33
name: 'Configuration',
34
emoji: '๐Ÿšง',
35
// You can also hide a category from the help menu
36
// Admins bypass this
37
hidden: true
38
},
39
{
40
// You can also use custom emojis by specifying the ID
41
// NOTE: Your bot MUST be in the same server as the emoji
42
name: 'Example',
43
// :typescript: emoji ID from the WOK server
44
emoji: '814238393747243009',
45
customEmoji: true
46
},
47
{
48
// You can also specify the full name of the emoji without the boolean
49
// WOKCommands will detect that this is custom and get the ID
50
// NOTE: Your bot MUST be in the same server as the emoji
51
name: 'Example',
52
// :typescript: emoji String from the WOK server
53
emoji: '<:typescript:791512440021975062>'
54
}
55
])
56
})
57
โ€‹
58
client.login('YOUR TOKEN HERE')
Copied!
index.ts
1
import DiscordJS, { Intents } from 'discord.js'
2
import WOKCommands from 'wokcommands'
3
import path from 'path'
4
โ€‹
5
const client = new DiscordJS.Client({
6
// These intents are recommended for the built in help menu
7
intents: [
8
Intents.FLAGS.GUILDS,
9
Intents.FLAGS.GUILD_MESSAGES,
10
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
11
],
12
})
13
โ€‹
14
client.on('ready', () => {
15
new WOKCommands(client, {
16
// The name of the local folder for your command files
17
commandsDir: path.join(__dirname, 'commands'),
18
// Allow importing of .ts files if you are using ts-node
19
typeScript: true,
20
})
21
.setCategorySettings([
22
{
23
name: 'Fun & Games',
24
emoji: '๐ŸŽฎ'
25
},
26
{
27
name: 'Economy',
28
emoji: '๐Ÿ’ธ'
29
},
30
{
31
// You can change the default emojis as well
32
// "Configuration" is โš™ by default
33
name: 'Configuration',
34
emoji: '๐Ÿšง',
35
// You can also hide a category from the help menu
36
// Admins bypass this
37
hidden: true
38
},
39
{
40
// You can also use custom emojis by specifying the ID
41
// NOTE: Your bot MUST be in the same server as the emoji
42
name: 'Example',
43
// :typescript: emoji ID from the WOK server
44
emoji: '814238393747243009',
45
customEmoji: true
46
},
47
{
48
// You can also specify the full name of the emoji without the boolean
49
// WOKCommands will detect that this is custom and get the ID
50
// NOTE: Your bot MUST be in the same server as the emoji
51
name: 'Example',
52
// :typescript: emoji String from the WOK server
53
emoji: '<:typescript:791512440021975062>'
54
}
55
])
56
})
57
โ€‹
58
client.login('YOUR TOKEN HERE')
Copied!
Copy link