Class

TwPubSub

TwPubSub()

Constructor

new TwPubSub()

This module manages the connection to the PubSub

View Source lib/twpubsub.js, line 5

Methods

async listen(topic)

Add a topic to listen to
Parameters:
Name Type Description
topic String

View Source lib/twpubsub.js, line 234

setAuthToken(token)

Fills the user token
Parameters:
Name Type Description
token String The token that is returned by the OAuth2 auth flow

View Source lib/twpubsub.js, line 31

async unlisten(topic)

Unlisten from a topic. If no topics a left to listen for the connection will be closed
Parameters:
Name Type Description
topic String

View Source lib/twpubsub.js, line 266

Events

automod-approved

Fires when a moderator approved a messages that was filtered by AutoMod
Parameters:
Name Type Description
moderator String The moderator that approved the message
author String The user that wrote the message
msgid String The message id that was approved

View Source lib/twpubsub.js, line 148

automod-denied

Fires when a moderator denies a messages that was filtered by AutoMod
Parameters:
Name Type Description
moderator String The moderator that denied the message
author String The user that wrote the message
msgid String The message id that was denied

View Source lib/twpubsub.js, line 158

automod-rejected

Fires when a message was filtered by AutoMod
Parameters:
Name Type Description
message String The message that was filtered
author String The user that wrote the message
msgid String The message id that was filtered
reason String The reason the message was filtered

View Source lib/twpubsub.js, line 137

mod-command

Fires when a moderator uses a moderation command
Parameters:
Name Type Description
command String The command that was executed
args Array.<String> An string array with the arguments the command was executed with
moderator String The moderator that executed the command

View Source lib/twpubsub.js, line 168