forked from slackapi/node-slack-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.js
43 lines (31 loc) · 2.11 KB
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* API client events.
*/
module.exports.WEB = {
RATE_LIMITED: 'rate_limited'
};
module.exports.RTM = {
CONNECTING: 'connecting', // the rtm.start API call has been made, but the
// response has not come back
AUTHENTICATED: 'authenticated', // rtm.start returned successfully with a websocket
// URL to connect to
WS_OPENING: 'ws_opening', // the underlying websocket connection is being
// opened
WS_OPENED: 'ws_opened', // the underlying websocket connection has opened
// and messages can be received from the remote
RTM_CONNECTION_OPENED: 'open', // the remote server has acked the socket and sent a
// `hello` message, the connection is now live and
// can be used to send messages
DISCONNECT: 'disconnect', // the RTM client has disconnected and will not try
// to reconnect again automatically
UNABLE_TO_RTM_START: 'unable_to_rtm_start', // the rtm.start API call failed in some way, this
// may be recoverable
WS_CLOSE: 'ws_close', // the underlying websocket connection was closed. A
// reconnect may be attempted after this
WS_ERROR: 'ws_error', // the underlying websocket connection threw an
// an error
ATTEMPTING_RECONNECT: 'attempting_reconnect', // the client is attempting to initiate a reconnect
RAW_MESSAGE: 'raw_message' // a message was received from the RTM API. This
// will also contain the raw message payload that
// was sent from Slack
};