Class: BotCommand

BotCommand(name, options, func)

Represents a bot command.

Constructor

new BotCommand(name, options, func)

Creates a new command. You must register it with Core.commands.register(command) to make it work.
Parameters:
Name Type Description
name string Command name. MUST be in lowercase and contain no spaces
options object Command options
Properties
Name Type Description
aliases Array.<string> Command aliases
adminOnly boolean Restrict this command to administrators
djOnly boolean Restrict this command to DJs
ownerOnly boolean Restrict this command to the owner
argSeparator boolean The argument delimiter
includeCommandNameInArgs boolean Useful for aliases
allowDM boolean Allow this command to be executed in DMs
everyone boolean For SelfBots, allow this command to be executed by others.
requiredPermissions Array.<string> | Array.<number> Required permissions to run the command Permission Flags
requiredRoles Array.<string> Required roles to run the command (role names).
func function Command handler
Source:

Members

name

Command name
Source:

Methods

(async) exec(msg, args)

Calls the command handler.
Parameters:
Name Type Description
msg Discord.Message Message object
args string | Array.<string> Arguments
Source: