WOKCommands
Search…
Per-guild prefixes
Server/guild owners can configure what prefix your bot uses by using the following command:
!prefix [new prefix]
Omitting the prefix will display the current prefix for that server/guild. The default prefix for WOKCommands is a ! however you can specify a custom default prefix with the following:
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')
})
.setDefaultPrefix('?') // Set your prefix here
})
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,
})
.setDefaultPrefix('?') // Set your prefix here
})
client.login('YOUR TOKEN HERE')
Copy link