Plugin Authoring Guide
Lita::Robot object serves as a global event bus in Lita's runtime. Any Lita code can trigger an event on the robot, and handler plugins can define event callbacks which subscribe to those events by name. When an event is triggered, the calling code can pass a payload hash with any arbitrary data it wishes the receiving code to have.
To trigger an event from any Lita code with access to the currently running robot:
robot.trigger(:some_event_happened, foo: :bar, baz: :blah)
See the handlers guide for details on how handlers can subscribe to events.
There are a few events which the core Lita framework triggers:
||Fired when the
||Fired when an incoming message matches a handler's chat route.|
||Fired when an incoming message fails to match a route because the sending user was not in any of the required authorization groups.|
||Fired when the robot first begins shutting down.|
||Fired when the robot has finished shutting down both the built-in web server and the chat adapter.|
||Fired when the robot receives a message that does not match any routes.|
Adapters are encouraged to trigger a
:connected event so that other plugins can run set up code that needs to be done at runtime.