CommandBuilder
Builds commands with a fluent API
Constructor Summary
Public Constructor | ||
public |
constructor(bot: Bot, info: CommandInfo, funcs: CommandBuilderFunctions) |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
hasPermission(fn: function, extras: *[]): CommandBuilder Sets the command's hasPermission method |
|
public |
info(info: CommandInfo): CommandBuilder Sets the command information. |
|
public |
Registers the command to the bot |
|
public |
run(fn: function, extras: *[]): CommandBuilder Sets the command's run method |
Public Constructors
public constructor(bot: Bot, info: CommandInfo, funcs: CommandBuilderFunctions) source
Params:
Name | Type | Attribute | Description |
bot | Bot | The bot the command is for |
|
info | CommandInfo |
|
The command info |
funcs | CommandBuilderFunctions |
|
The command functions to set |
Public Members
public commandInfo: CommandInfo source
Public Methods
public hasPermission(fn: function, extras: *[]): CommandBuilder source
Sets the command's hasPermission method
Params:
Name | Type | Attribute | Description |
fn | function | The function to use |
|
extras | *[] |
|
Extra values to pass to the function |
public info(info: CommandInfo): CommandBuilder source
Sets the command information. This must be used before any other method if info was not provided to the constructor.
Params:
Name | Type | Attribute | Description |
info | CommandInfo | The command info |
public run(fn: function, extras: *[]): CommandBuilder source
Sets the command's run method
Params:
Name | Type | Attribute | Description |
fn | function | The function to use |
|
extras | *[] |
|
Extra values to pass to the function |