DatabaseCommand
extends Command
in package
AbstractYes
Use for any discord commands that require a database connection.
Table of Contents
Properties
- $message : Message
- $player : AbstractPlayer
- Player associated with the Discord user that invoked the command.
Methods
- callback() : void
- Wrapper to properly handle a Command response.
- databaseResponse() : array<string|int, string>
- Constructs a textual response to a DatabaseCommand invocation.
- description() : string
- Help-text description of what the command does.
- name() : string
- Name to invoke this command on Discord.
- register() : Command
- Register a Command class as a command (by passing in the main Discord client) or a subcommand (by passing in the output of this method from its parent command).
- response() : array<string|int, string>
- Wrapper to properly handle a DatabaseCommand response.
- usage() : string|null
- Help-text options that can be passed to this command, if any.
- logException() : void
Properties
$message
protected
Message
$message
$player
Player associated with the Discord user that invoked the command.
protected
AbstractPlayer
$player
Methods
callback()
Wrapper to properly handle a Command response.
public
final callback(Message $message, array<string|int, string> $args) : void
Parameters
- $message : Message
- $args : array<string|int, string>
-
Arguments passed to the command.
databaseResponse()
Constructs a textual response to a DatabaseCommand invocation.
public
abstract databaseResponse(string ...$args) : array<string|int, string>
Parameters
- $args : string
Return values
array<string|int, string>description()
Help-text description of what the command does.
public
abstract description() : string
Return values
stringname()
Name to invoke this command on Discord.
public
abstract name() : string
Return values
stringregister()
Register a Command class as a command (by passing in the main Discord client) or a subcommand (by passing in the output of this method from its parent command).
public
register(Command|DiscordCommandClient $parent) : Command
Parameters
- $parent : Command|DiscordCommandClient
Return values
Commandresponse()
Wrapper to properly handle a DatabaseCommand response.
public
final response(string ...$args) : array<string|int, string>
Parameters
- $args : string
Return values
array<string|int, string>usage()
Help-text options that can be passed to this command, if any.
public
usage() : string|null
Return values
string|nulllogException()
protected
logException(Throwable $err) : void
Parameters
- $err : Throwable