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.
1
class WOKCommands {
2
// Returns the client for your bot
3
public get client(): Client
4
5
// Getter and setter for the current display name for your bot
6
// Used in the built-in help menu
7
public get displayName(): string
8
public setDisplayName(displayName: string): WOKCommands
9
10
// Getter and setter for the default prefix for your bot
11
// Per-guild prefixes set by server owners will overwrite this
12
public get defaultPrefix(): string
13
public setDefaultPrefix(defaultPrefix: string): WOKCommands
14
15
// Getter and setter for a per-guild prefix
16
// If the guild object is omitted or null then it will return
17
// the default prefix set by the above method
18
public getPrefix(guild: Guild | null): string
19
public setPrefix(guild: Guild | null, prefix: string): WOKCommands
20
21
// Returns a map of all categories
22
public get categories(): Map<String, String | GuildEmoji>
23
24
// Returns an array of strings for hidden categories
25
public get hiddenCategories(): string[]
26
27
// Getter and setter for the color of embeds sent by WOKCommands
28
public get color(): string
29
public setColor(color: string): WOKcommands
30
31
// Gets the emoji for a given category name
32
public getEmoji(category: string): string
33
34
// Gets the category name from an emoji
35
public getCategory(emoji: string): string
36
37
// Sets information about each category
38
// Check "Command categories" for more details
39
public setCategorySettings(
40
category: [{ [key: string]: any }],
41
emoji?: string
42
): WOKCommands
43
44
// Checks if an emoji is already being used by a category
45
public isEmojiUsed(emoji: string): boolean
46
47
// Gets the current mongo connection if there is one
48
public get mongoConnection(): Connection | null
49
50
// Returns if a database is connected
51
public isDBConnected(): boolean
52
53
// If show warns is enabled or not, set the options object
54
public get showWarns(): boolean
55
56
// How many seconds to wait until WOKCommands deletes an error message
57
// Default is -1 (do not delete)
58
public get delErrMsgCooldown(): number
59
60
// If your bot should ignore commands sent from other bots
61
public get ignoreBots(): boolean
62
63
// Getter and setter for the bot owner ID array
64
// Used for the "ownerOnly" command property
65
public get botOwner(): string[]
66
public setBotOwner(botOwner: string | string[]): WOKCommands
67
68
// Gets an array of testing servers set in the options object
69
public get testServers(): string[]
70
71
// Getter and setter for the default language of your bot
72
public get defaultLanguage(): string
73
public setDefaultLanguage(defaultLanguage: string): WOKCommands
74
75
// Get if ephemeral is set or not
76
public get ephemeral(): boolean
77
78
// Get if debug is enabled or not
79
public get debug(): boolean
80
81
// Getters for the various utilities in WOKCommands
82
// More information in "UTILITIES" category of this documentation
83
public get messageHandler(): MessageHandler
84
public get slashCommands(): SlashCommands
85
public get commandHandler(): CommandHandler
86
}
Copied!
Copy link