notifications

notifications handler for SockBot2.0

Author: Accalia
License: MIT

notifications.prepare(events, callback)

Prepare notifications for bot start

Kind: static method of notifications

Param Type Description
events EventEmitter EventEmitter that will be used for communication
callback completionCallback Completion Callback

notifications.start(events, callback)

Prepare notifications for bot start

Kind: static method of notifications

Param Type Description
events EventEmitter EventEmitter that will be used for communication
callback completionCallback Completion Callback

notifications.pollNotifications(callback)

Poll for notifications

Kind: static method of notifications

Param Type Description
callback completionCallback Completion callback

notifications~handleTopicNotification(notification)

Process a notification from a topic

Kind: inner method of notifications

Param Type Description
notification external.notifications.notification Notification to process

notifications~onNotificationMessage(message)

React to notifications message

Kind: inner method of notifications

Param Type Description
message external.messageBus.notificationsMessage Recieved message

notifications~onNotification(type, handler) ⇒ EventEmitter

Add a notification listener

Kind: inner method of notifications
Returns: EventEmitter - EventEmitter for chainging calls

Param Type Description
type string Notification type
handler notificationCallback Notification handler

notifications~removeNotification(type, handler) ⇒ EventEmitter

Remove a notification listener

Kind: inner method of notifications
Returns: EventEmitter - EventEmitter for chainging calls

Param Type Description
type string Notification type
handler notificationCallback Notification handler

notifications~completionCallback

Completion Callback

Kind: inner typedef of notifications

Param Type Description
err string | Error Filter Error state

notifications~notificationCallback

Notification Callback

Kind: inner typedef of notifications

Param Type Description
notification external.notifications.notification Received notification
[topic] external.topics.Topic Topic data for received notification
[post] external.posts.CleanedPost Post data for recieved notification