Command
A command that can be run in a bot
Static Method Summary
| Static Public Methods | ||
| public static |
Checks if a command is enabled on a guild |
|
| public static |
setEnabled(settings: SettingStorage, guild: Guild | string, command: Command | string, enabled: boolean) Enables or disables a command on a guild |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(bot: Bot, info: CommandInfo) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
hasPermission(guild: Guild, user: User): boolean Checks a user's permission on a guild |
|
| public |
Checks if the command is enabled on a guild |
|
| public |
Checks if the command is usable for a message |
|
| public |
run(message: Message, args: string[], fromPattern: boolean): Promise<CommandResult | string[] | string> Runs the command |
|
| public |
setEnabled(guild: Guild | string, enabled: boolean) Enables or disables the command on a guild |
|
Static Public Methods
public static isEnabled(settings: SettingStorage, guild: Guild, command: Command | string): boolean source
Checks if a command is enabled on a guild
Params:
| Name | Type | Attribute | Description |
| settings | SettingStorage | The setting storage to use |
|
| guild | Guild | The guild |
|
| command | Command | string | The command or command name |
Public Constructors
public constructor(bot: Bot, info: CommandInfo) source
Params:
| Name | Type | Attribute | Description |
| bot | Bot | The bot the command is for |
|
| info | CommandInfo | The command information |
Public Members
Public Methods
public hasPermission(guild: Guild, user: User): boolean source
Checks a user's permission on a guild
public isEnabled(guild: Guild): boolean source
Checks if the command is enabled on a guild
Params:
| Name | Type | Attribute | Description |
| guild | Guild | The guild |
public isUsable(message: Message): boolean source
Checks if the command is usable for a message
Params:
| Name | Type | Attribute | Description |
| message | Message |
|
The message |