addEventHandler

inline fun <T : Event> addEventHandler(handler: EventHandler<T>)

Directly register an EventHandler to this bot.

Generally speaking, you shouldn't call this directly - instead, create an Extension and call the Extension.event function in your Extension.setup function.

This function will throw an EventHandlerRegistrationException if the event handler has already been registered.

Parameters

handler

The event handler to be registered.

Throws

Thrown if the event handler could not be registered.