Class Bot

The Bot class is an extensible, fully-featured base for building Bots with the dscord library. It was meant to serve as a base class that can be extended in seperate projects.

Inherits from

  • Object (base class)

Constructors

Name Description
this

Fields

Name Type Description
client Client
config BotConfig
log std.experimental.logger.core.Logger
plugins Plugin[string]

Methods

Name Description
dynamicLoadPlugin Loads a plugin from a dynamic library, optionally restoring previous plugin state.
dynamicReloadPlugin Reloads a plugin which was previously loaded as a dynamic library. This function restores previous plugin state.
feature Returns true if the current bot instance/configuration supports all of the passed BotFeature flags.
getLevel Base implementation for getting a level from a user. Override this.
getLevel Base implementation for getting a level from a role. Override this.
getLevel Override implementation for getting a level from a user (for command handling)
loadPlugin Loads a plugin into the bot, optionally restoring previous plugin state.
run Starts the bot.
unloadPlugin Unloads a plugin from the bot, unbinding all listeners and commands.
unloadPlugin Unloads a plugin from the bot by name.