Command

Command

Built-in command class

Constructor

(abstract) new Command(client, …args)

Source:
Properties:
Name Type Description
resolver Resolver

Command resolver

responder Responder

Command responder

subcommands Collection

Collection of subcommands

timers Map

Map of timer cooldowns

Creates a new Command instance

Parameters:
Name Type Attributes Description
client Client

Client instance

args Object <repeatable>

Command options

Extends

Methods

check(container, responder, subcmdopt)

Source:

Checks if a command is valid, run in execute()

Parameters:
Name Type Attributes Description
container Container

Container context

responder Responder

Responder instance

subcmd Command <optional>

Subcommand

deleteMessages(…messages) → {Promise}

Source:
Inherited From:

Deletes multiple messages if there are sufficient permissions

Parameters:
Name Type Attributes Description
messages external:"Eris.Message" <repeatable>

The messages to delete

Returns:
Type
Promise

edit(message, content, optionsopt) → {Promise}

Source:
Inherited From:

Edits a message with updated content

Parameters:
Name Type Attributes Description
message external:"Eris.Message"

The message to edit

content String

The content to edit the message with

options Object <optional>

Options object

Properties
Name Type Attributes Description
lang String <optional>

Locale of content

delay Number <optional>

Delay to edit the message

Returns:
Type
Promise

execute(container) → {Promise}

Source:

Checks the validaty of a command and executes it

Parameters:
Name Type Description
container Container

Container context

Returns:
Type
Promise

handle(container, responder)

Source:

Command handler

Parameters:
Name Type Description
container Container

Container object

responder Responder

Responder instance

hasPermissions(channel, user, …perms) → {Boolean}

Source:
Inherited From:

Checks if a user has certain permissions in a channel

Parameters:
Name Type Attributes Description
channel external:"Eris.GuildChannel"

The channel to check in

user external:"Eris.User"

The user to check

perms String <repeatable>

The permission(s) to check

Returns:
Type
Boolean

send(channel, content, optionsopt) → {Promise.<(external:"Eris.Message"|null)>}

Source:
Inherited From:

Sends a message to a channel

Parameters:
Name Type Attributes Description
channel external:"Eris.GuildChannel"

The channel to send the message in

content String

The string to send

options Object <optional>

Message options

Properties
Name Type Attributes Default Description
lang String <optional>

Message locale

delay Number <optional>
0

Delay to send the message, set to 0 for no delay

deleteDelay Number <optional>
0

Delay to delete the message after it's sent, set to 0 for no deletion

file Object <optional>

A file object

Properties
Name Type Attributes Description
name String <optional>

Name of file

file Buffer <optional>

Buffer containing file data

embed Object <optional>

Embed object, see official Discord API documentation

Returns:
Type
Promise.<(external:"Eris.Message"|null)>

t(content, langopt, tagsopt)

Source:
Inherited From:

Parses a string for localisation

Parameters:
Name Type Attributes Default Description
content String

The string to parse

lang String <optional>
'en'

The locale name

tags Object <optional>

Additional interpolation tags