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.

Members

Functions

dynamicLoadPlugin
Plugin dynamicLoadPlugin(string path, PluginState state)

Loads a plugin from a dynamic library, optionally restoring previous plugin state.

dynamicReloadPlugin
Plugin dynamicReloadPlugin(Plugin p)

Reloads a plugin which was previously loaded as a dynamic library. This function restores previous plugin state.

feature
bool feature(BotFeatures[] features...)

Returns true if the current bot instance/configuration supports all of the passed BotFeature flags.

getLevel
int getLevel(User user)

Base implementation for getting a level from a user. Override this.

getLevel
int getLevel(Role role)

Base implementation for getting a level from a role. Override this.

getLevel
int getLevel(CommandEvent event)

Override implementation for getting a level from a user (for command handling)

loadPlugin
void loadPlugin(Plugin p, PluginState state = null)

Loads a plugin into the bot, optionally restoring previous plugin state.

run
void run()

Starts the bot.

unloadPlugin
void unloadPlugin(Plugin p)

Unloads a plugin from the bot, unbinding all listeners and commands.

unloadPlugin
void unloadPlugin(string name)

Unloads a plugin from the bot by name.

Meta