Class: BotModule

BotModule()

Module Base class

Constructor

new BotModule()

Instantiates a Module
Source:

Members

bot

Discord.js client
Source:

commands

Registered Commands
Source:

events

Registered event handlers
Source:

name

Module name
Source:

Methods

registerCommand(name, options, func) → {BotCommand}

Registers a command.
Parameters:
Name Type Description
name string Command name.
options object Command options.
func function Command handler.
Source:
See:
Returns:
Type
BotCommand

registerEvent(name, evHandler)

Registers an event listener bound to this module
Parameters:
Name Type Description
name string Event Name - Prefix with discord. for discord events
evHandler function Event Handler
Source:
Example
this.registerEvent('discord.message', messageHandler)
this.registerEvent('customEvent', handler)

registerParameter(key, props)

Registers a setting parameter.
Parameters:
Name Type Description
key string Parameter key
props object Parameter properties
Source:

unregisterCommand(command)

Unregisters a command (only if it belongs to this module).
Parameters:
Name Type Description
command string | BotCommand Command to unregister
Source:

unregisterEvent(name, evHandler)

Unregisters an event listener
Parameters:
Name Type Description
name string Event Name
evHandler string Optional event handler
Source:

unregisterParameter(key)

Unregisters a setting parameter.
Parameters:
Name Type Description
key string Parameter key
Source: