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
const DiscordJS = require('discord.js')
const WOKCommands = require('wokcommands')
const path = require('path')
โ€‹
const { Intents } = DiscordJS
โ€‹
const client = new DiscordJS.Client({
// These intents are recommended for the built in help menu
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
],
})
โ€‹
client.on('ready', () => {
new WOKCommands(client, {
// The name of the local folder for your command files
commandsDir: path.join(__dirname, 'commands')
})
.setCategorySettings([
{
name: 'Fun & Games',
emoji: '๐ŸŽฎ'
},
{
name: 'Economy',
emoji: '๐Ÿ’ธ'
},
{
// You can change the default emojis as well
// "Configuration" is โš™ by default
name: 'Configuration',
emoji: '๐Ÿšง',
// You can also hide a category from the help menu
// Admins bypass this
hidden: true
},
{
// You can also use custom emojis by specifying the ID
// NOTE: Your bot MUST be in the same server as the emoji
name: 'Example',
// :typescript: emoji ID from the WOK server
emoji: '814238393747243009',
customEmoji: true
},
{
// You can also specify the full name of the emoji without the boolean
// WOKCommands will detect that this is custom and get the ID
// NOTE: Your bot MUST be in the same server as the emoji
name: 'Example',
// :typescript: emoji String from the WOK server
emoji: '<:typescript:791512440021975062>'
}
])
})
โ€‹
client.login('YOUR TOKEN HERE')
index.ts
import DiscordJS, { Intents } from 'discord.js'
import WOKCommands from 'wokcommands'
import path from 'path'
โ€‹
const client = new DiscordJS.Client({
// These intents are recommended for the built in help menu
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
],
})
โ€‹
client.on('ready', () => {
new WOKCommands(client, {
// The name of the local folder for your command files
commandsDir: path.join(__dirname, 'commands'),
// Allow importing of .ts files if you are using ts-node
typeScript: true,
})
.setCategorySettings([
{
name: 'Fun & Games',
emoji: '๐ŸŽฎ'
},
{
name: 'Economy',
emoji: '๐Ÿ’ธ'
},
{
// You can change the default emojis as well
// "Configuration" is โš™ by default
name: 'Configuration',
emoji: '๐Ÿšง',
// You can also hide a category from the help menu
// Admins bypass this
hidden: true
},
{
// You can also use custom emojis by specifying the ID
// NOTE: Your bot MUST be in the same server as the emoji
name: 'Example',
// :typescript: emoji ID from the WOK server
emoji: '814238393747243009',
customEmoji: true
},
{
// You can also specify the full name of the emoji without the boolean
// WOKCommands will detect that this is custom and get the ID
// NOTE: Your bot MUST be in the same server as the emoji
name: 'Example',
// :typescript: emoji String from the WOK server
emoji: '<:typescript:791512440021975062>'
}
])
})
โ€‹
client.login('YOUR TOKEN HERE')
Copy link