Class: tokebot

tokebot(server, chatHandler)

Class containing global server-side tokebot logic

Constructor

new tokebot(server, chatHandler)

Instantiates a tokebot object
Parameters:
Name Type Description
server channelManager Parent Server Object
chatHandler chatHandler Parent Chat Handler Object
Source:

Members

chatHandler

Parent Chat Handler
Source:

cooldownCounter

Cooldown Counter
Source:

cooldownTime

Cooldown Time
Source:

cooldownTimer

Cooldown Timer
Source:

server

Parent Server Object
Source:

tokeCounter

Toke Counter
Source:

tokeTime

Toke time
Source:

tokeTimer

Toke Timer
Source:

tokers

List of current tokers
Source:

Methods

(async) asyncFinisher()

This method seems to be a vestage from a bygone era. We should remove it after documenting shit. I would now, but I don't want to break shit in a comment-only commit.
Source:

cooldown()

Runs every second for 60 seconds after a toke
Source:

countdown()

Called each second during the toke. Handles decrementing the timer variable, and countdown end logic.
Source:

(async) refreshCommands()

Reloads toke commands from DB into RAM-based toke command store
Source:

resetToke()

Resets toke cooldowns early upon authorized request
Source:

tokeProcessor(commandObj) → {Boolean}

Processes toke commands from Command Pre-Processor
Parameters:
Name Type Description
commandObj Object Object representing a single given command/chat request, passed down from the Command Pre-Processor
Source:
Returns:
True if the toke is an invalid toke command (tells Command Pre-Processor to send command as chat)
Type
Boolean