Skip to main content

Component

Abstract class which implements Node.js EventEmitter class, but provides only on, once, emit functions.

constructor(bot)​

added in 1.0.0

methods​

on(event, callback)​

added in 1.0.0
  • event - <string>. Event name.
  • callback - <Function>. Callback function.

once(event, callback)​

added in 1.0.0

emit(event, [...args])​

added in 1.0.0
  • event - <string>. Event name.
  • args - <Array>. Emit arguments, this args will comes to callback function for on and once event subscription.

cleanup([event])​

added in 1.0.0

Cleanup event or all events.

  • event - <Object>. Event class. which has been remove listeners. If event parameter is not provided - function remove all listeners from all events.