Await(data)

A class used for the awaiting of a criteria-matching message

new Await(data)

Create an Await

Parameters:
Name Type Description
data Object

The await data

Properties:
Name Type Attributes Default Description
data.options Object <optional>
{}

The options for the await

Properties
Name Type Attributes Default Description
args Array<(ArgData|String)> <optional>
[]

The arguments for the await (Can be an argument data object or just the name of the argument)

check CheckFunction <optional>
() => true

The condition to be met for the await to trigger

timeout Number <optional>
15000

How long until the await expires

oneTime Boolean <optional>
false

Whether a non-triggering message cancels the await

refreshOnUse Boolean <optional>
false

Whether the timeout for the await refreshes after a use

onCancelFunction CancelFunction <optional>

A function to run once the await expires or is cancelled

user String <optional>

The ID of the user to await the message from (By default, it's the user who triggered the command)

channel String <optional>

The ID of the channel to await the message (By default, it's the channel the command was called in)

shouldShift Boolean <optional>
false

Whether the command handler should shift out the first space-separated keyword for argument parsing or not

requirePrefix Boolean <optional>
false

Whether the await requires the bot prefix to be triggered

data.action AwaitAction

The await action

Members

private _awaitMap : Map<String, Await>

The map that the await is stored in

private _id : String

The ID of the await.

private _timer : Timeout

The delete timer for the await

private _timer : Timeout

The delete timer for the await

action : AwaitAction

The await action

options : Object

The options for the await

Properties:
Name Type Description
args Array<Argument>

The arguments for the await

check CheckFunction

The condition to be met for the await to trigger

timeout Number

How long until the await expires

oneTime Boolean

Whether a non-triggering message cancels the await

refreshOnUse Boolean

Whether the timeout for the await refreshes after a use

onCancelFunction CancelFunction

A function to run once the await expires or is cancelled

user String

The ID of the user to await the message from (By default, it's the user who triggered the command)

channel String

The channel to await the message (By default, it's the channel the command was called in)

shouldShift Boolean

Whether the command handler should shift out the first space-separated keyword for argument parsing or not

requirePrefix Boolean

Whether the await requires the bot prefix to be triggered

triggerResponse : Eris.Message

The response to the command that initiated the await

Methods

clear() → {Await}

Clear the await from its storage

Returns:
Await -

The await that was cleared

refresh() → {Await}

Refresh the delete timer for the await

Returns:
Await -

The await

startTimer(data) → {Await}

Start the delete timer for the await

Parameters:
Name Type Description
data Object

Further await data

Returns:
Await -

The await

Properties:
Name Type Description
data.id String

The ID of the await in its parent map

data.awaitMap Map<String, Await>

The map that the await is stored in

data.triggerResponse Eris.Message

The response to the command that initiated the await