Command

Command

Command for Discord bot

Constructor

new Command(config, sourcePath)

Source:
Tutorials:

Initializes a new Command

Parameters:
Name Type Description
config Object

Command configuration object

Properties
Name Type Attributes Default Description
name String

Command name

description String <optional>
''

Command description

aliases Array.<String> <optional>
[]

array of alias strings for Command

usage String <optional>
''

example syntax for using the Command

args Boolean <optional>
false

whether this Command requires arguments

guildOnly Boolean <optional>
true

whether this Command only works on servers (false allows command in DM)

ownerOnly Boolean <optional>
false

whether this Command only works for the server owner (false allows anyone to use Command)

cooldown Number <optional>
5

cooldown time (in seconds) until this Command can be reused by the same User

execute function

function that executes when the Command is fired

sourcePath String

full path of Command source file

Members

(static) clean :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Deletes the most recent messages in the current channel (10 by default, 100 maximum, supports all argument)

Type:

(static) event :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Lists all Events enabled in the context, toggles the Event provided, or lists all Events that can be enabled

Type:

(static) help :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Lists all Commands or gets help for a specific Command

Type:

(static) hook :Command

Source:

Lists all Hooks enabled in the context, toggles the Hook provided, or lists all Hooks that can be enabled

Type:

(static) ping :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Returns the latency (in milliseconds) between when the Command was sent and when the Command was executed

Type:

(static) prefix :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Shows, sets, or resets the custom Command prefix for this Guild

Type:

(static) reload :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Reloads a Command from its source file

Type:

(static) status :Command

Source:
Properties:
Name Type Description
executeConfig Object

execution function configuration object

Properties
Name Type Description
message external:Message

discord.js Message

args Array.<String>

Array of space-separated strings following the command

server Esdi

Esdi server instance

Reports the memory and processor usage of the server's process along with its uptime and Discord stats

Type: