Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

Custom events

ptejada edited this page Mar 28, 2013 · 6 revisions

It is important to know first hand that Custom events and built-in events use the same mechanisms and stacks. The only difference is that Custom events are manually(coded/programmed) sent by you and the built-in events are on autopilot. That being said, avoid to manually send built-in events as it might break the workflow and cause errors. For a list of the built-in events check the Events List.

Custom events are sent using the .send() method. This method is available on any channel and user object. All events are triggered automatically by the framework so you just have to add the proper event listeners with the .on() method. The following parameters are applied to custom events ( data, user, channel ) where data is the data sent with the event, the user is the user object who sent the event and channel is the channel object where the event has been triggered. Note that for custom events from user to user the channel or third parameter will be the current's user object.

Clone this wiki locally