WOKCommands
Search…
WOKCommands Class Methods
The WOKCommands class comes with a number of methods that you may find useful to your bot.
It is encouraged to read the rest of the documentation and know how to use WOKCommands in a basic use case before looking into the methods in this class.
The structure of this code is for demonstration purposes only. Do not copy/paste this code, it will not work.
class WOKCommands {
// Returns the client for your bot
public get client(): Client
// Getter and setter for the current display name for your bot
// Used in the built-in help menu
public get displayName(): string
public setDisplayName(displayName: string): WOKCommands
// Getter and setter for the default prefix for your bot
// Per-guild prefixes set by server owners will overwrite this
public get defaultPrefix(): string
public setDefaultPrefix(defaultPrefix: string): WOKCommands
// Getter and setter for a per-guild prefix
// If the guild object is omitted or null then it will return
// the default prefix set by the above method
public getPrefix(guild: Guild | null): string
public setPrefix(guild: Guild | null, prefix: string): WOKCommands
// Returns a map of all categories
public get categories(): Map<String, String | GuildEmoji>
// Returns an array of strings for hidden categories
public get hiddenCategories(): string[]
// Getter and setter for the color of embeds sent by WOKCommands
public get color(): string
public setColor(color: string): WOKcommands
// Gets the emoji for a given category name
public getEmoji(category: string): string
// Gets the category name from an emoji
public getCategory(emoji: string): string
// Sets information about each category
// Check "Command categories" for more details
public setCategorySettings(
category: [{ [key: string]: any }],
emoji?: string
): WOKCommands
// Checks if an emoji is already being used by a category
public isEmojiUsed(emoji: string): boolean
// Gets the current mongo connection if there is one
public get mongoConnection(): Connection | null
// Returns if a database is connected
public isDBConnected(): boolean
// If show warns is enabled or not, set the options object
public get showWarns(): boolean
// How many seconds to wait until WOKCommands deletes an error message
// Default is -1 (do not delete)
public get delErrMsgCooldown(): number
// If your bot should ignore commands sent from other bots
public get ignoreBots(): boolean
// Getter and setter for the bot owner ID array
// Used for the "ownerOnly" command property
public get botOwner(): string[]
public setBotOwner(botOwner: string | string[]): WOKCommands
// Gets an array of testing servers set in the options object
public get testServers(): string[]
// Getter and setter for the default language of your bot
public get defaultLanguage(): string
public setDefaultLanguage(defaultLanguage: string): WOKCommands
// Get if ephemeral is set or not
public get ephemeral(): boolean
// Get if debug is enabled or not
public get debug(): boolean
// Getters for the various utilities in WOKCommands
// More information in "UTILITIES" category of this documentation
public get messageHandler(): MessageHandler
public get slashCommands(): SlashCommands
public get commandHandler(): CommandHandler
}
Copy link