Constructor
new TwitchWebhook(options)
Constructs an instance of TwitchWebHookAPI
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options
Properties
|
Members
errors
Return errors
Methods
close() → {Promise}
Stop listening for connections
Returns:
- Type
- Promise
isListening() → {boolean}
Check if server is listening for connections.
Returns:
- Type
- boolean
listen(…argsopt) → {Promise}
Start listening for connections
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
any |
<optional> <repeatable> |
Arguments |
Throws:
-
If listening is already started
- Type
- Promise.<FatalError>
Returns:
- Type
- Promise
subscribe(topic, options) → {Promise}
Subscribe to specific topic
Parameters:
Name | Type | Description |
---|---|---|
topic |
string | Topic name |
options |
Object | Topic options |
Throws:
-
If hub finds any errors in the request
- Type
- RequestDenied
Returns:
- Type
- Promise
unsubscribe(topic) → {Promise}
Unsubscribe from specific topic.
"*" will unsubscribe from all topics that were subscribed on this session
Parameters:
Name | Type | Description |
---|---|---|
topic |
string | Topic name |
Throws:
-
If hub finds any errors in the request
- Type
- RequestDenied
Returns:
- Type
- Promise