Skip to content

4.3 List of PurrplingBot's events

Ellen Fawkes edited this page Sep 3, 2017 · 1 revision

PurrplingBot's events

Handle events by PurrplingBot.on(event, callback); in your plugins. (for version 1.3.0 and newer)

In old versions (1.2.x and older) events handle by eventBus.on(event, callback); in your plugins. Get eventBus by PurrplingBot.getEventBus();

PurrplinbgBot's core

ready

Emited when bot is ready (loaded all plugins and connected to discord)

message

Recieved a text message from Discord.

Args:

  • Message message Discord.js message object
  • bool isCmd flag with info that content is bot command or not.

messageUpdate

Updated a text message from Discord.

Args:

  • Message oldMessage Discord.js message object (with old contents)
  • Message newMessage Discord.js message object (with new contents)
  • bool isCmd flag with info that content is bot command or not.

commandHandled

Command handled on bot.

Args:

  • String cmd TODO
  • String tail TODO
  • Message message TODO

PluginRegistry

pluginPreloaded

Emits when plugin is preloaded.

Args:

  • String pluginName TODO
  • String pluginPath TODO

pluginLoaded

Emits when plugin is loaded and initalized (init() trigered and registered commands in plugin).

Args:

  • Object plugin TODO
  • String pluginName TODO

pluginsLoaded

Emits when all plugins is loaded and initalized.

Args:

  • Dictionary plugins TODO

commandRegister

Command registered in command registry

Args:

  • Object cmd TODO