Skip to content

0.18.0- Command event handlers

Compare
Choose a tag to compare
@l7ssha l7ssha released this 26 Jun 10:26

This version adds few dartdocs documentation and more important - adds command event handlers.

EventHandler is class which contains method to handle errors when dispatching command

abstract class EventHandler {
  Future commandNotFound(Message message);
  Future forAdminOnly(Message message);
  Future requiredPermission(Message message);
}

Override this class and add to CommandFramework instance:

var commandsListener = new discord.Commands('~~', bot)
    ..add(new TestCommand())
    ..eventHandler = new CustomEventHandler();