Class: ScheduledCommand

CmdScheduling~ ScheduledCommand

Stores information about a specific command that is scheduled.

new ScheduledCommand(cmd, channel, message, time, repeatDelay)

Parameters:
Name Type Argument Default Description
cmd string | object The command to run, or an object instance of this class (exported using toJSON, then parsed into an object).
channel string | number | Discord~TextChannel The channel or channel id of where to run the command.
message string | number | Discord~Message The message or message id that created this scheduled command.
time number The unix timestamp at which to run the command.
repeatDelay number <nullable>
0 The delay in milliseconds at which to run the command again, or null if it does not repeat.
Properties:
Name Type Argument Default Description
cmd string The command to run.
bot number | string The id of the bot instantiating this command.
channel Discord~TextChannel The channel or channel id of where to run the command.
channelId string | number The id of the channel where the message was sent.
message Discord~Message <nullable>
The message that created this scheduled command, or null if the message was deleted.
messageId string | number The id of the message sent.
time number The unix timestamp at which to run the command.
repeatDelay number <optional>
0 The delay in milliseconds at which to run the command again. 0 to not repeat.
id string Random base 36, 3-character long id of this command.
complete boolean True if the command has been run, and will not run again.
timeout Timeout The current timeout registered to run the command.
member Discord~GuildMember The author of this ScheduledCommand.
memberId string | number The id of the member.
Source:

Methods


cancel( [markComplete])

Cancel this command and remove Timeout.
Parameters:
Name Type Argument Default Description
markComplete boolean <optional>
true Should we mark this command as completed after cancelling.
Source:

go()

Trigger the command to be run immediately. Automatically fired at the scheduled time. Does not cancel the normally scheduled command. Re-schedules the command if the command should repeat.
Source:

setTimeout()

Schedule the Timeout event to call the command at the scheduled time. If the scheduled time to run the command is more than 2 weeks in the future, the command is not scheduled, and this function must be called manually (less than 2 weeks) before the scheduled time for the command to run.
Source:

toJSON()

Export the relevant data to recreate this object, as a JSON object.
Source:
Returns:
JSON formatted object.
Type
object

<private, inner> getReferences()

Update channel and message with their associated IDs.
Source: