Bot

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

Constructors

this
this(BotConfig bc, LogLevel lvl)

Undocumented in source.

Members

Functions

feature
bool feature(BotFeatures[] features)

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

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)

getLevel
int getLevel(User user)

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

loadPlugin
void loadPlugin(Plugin p, PluginState state)

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

run
void run(Game game)

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.

updateStatus
void updateStatus(Game game)

Undocumented in source. Be warned that the author may not have intended to support it.

Variables

client
Client client;

Undocumented in source.

config
BotConfig config;

Undocumented in source.

log
Logger log;

Undocumented in source.

plugins
Plugin[string] plugins;

Undocumented in source.

Meta