messageBus

Used for dealing with long poll notifications from discourse.

Author: Accalia
License: MIT

messageBus~modules

List of active Modules

Kind: inner property of messageBus

messageBus~registrations : Object.<string, Registration>

Channel/Module registrations

Kind: inner property of messageBus

messageBus~channels : Object.<string, number>

Channels that message-bus is listenting to

Kind: inner property of messageBus

messageBus~TL1Timer : Object.<string, datetime>

TL1 cooldown timer

Kind: inner property of messageBus

messageBus~notifyTime : datetime

Last time Notifications were polled. Used for watchdog.

Kind: inner property of messageBus

messageBus~notifyTypes : enum

Notification type Ids to Names

Kind: inner enum property of messageBus
Read only: true
Properties

Name Type Default
1 string "mentioned"
2 string "replied"
3 string "quoted"
4 string "edited"
5 string "liked"
6 string "private_message"
7 string "invited_to_private_message"
8 string "invitee_accepted"
9 string "posted"
10 string "moved_post"
11 string "linked"
12 string "granted_badge"

messageBus~messageInfo

Information about currently processing message. Used for watchdog

Kind: inner property of messageBus

messageInfo.poll : datetime

Time message-bus was polled

Kind: static property of messageInfo

messageInfo.message : Message

Message that is being processed

Kind: static property of messageInfo

messageInfo.time : datetime

Time message started processing

Kind: static property of messageInfo

messageInfo.module : string

Currently processing module name

Kind: static property of messageInfo

messageInfo.moduleTime : datetime

Time module started processing

Kind: static property of messageInfo

messageBus~responsive : boolean

Set to indicate that bot is active. Used by warchdog

Kind: inner property of messageBus

messageBus~notificationTime : datetime

Time /notifications was last polled. Used by watchdog

Kind: inner property of messageBus

messageBus~handleMessage(message, post, callback)

Handle a message

Kind: inner method of messageBus

Param Type Description
message string The message to handle
post string Some sort of post
callback function The callback to call after the message has been handled

messageBus~completed : function

Completion callback for a message handler

Kind: inner typedef of messageBus

Param Type Description
err Exception | string Error encountered in processing
handled boolean True to stop processing message

messageBus~onMessage : function

Handle a message Received

Kind: inner typedef of messageBus

Param Type Description
message Message Discourse Message Object
post Post Discourse Post message refers to
callback completed Completion Callback

messageBus~Registration : object

Kind: inner typedef of messageBus
Properties

Name Type Description
name string Name of registration
onMessage onMessage Message handler