MCPcopy
hub / github.com/slackapi/node-slack-sdk / start

Method start

packages/rtm-api/src/RTMClient.ts:375–395  ·  view source on GitHub ↗

* Begin an RTM session using the provided options. This method must be called before any messages can * be sent or received.

(options?: RTMStartOptions)

Source from the content-addressed store, hash-verified

373 * be sent or received.
374 */
375 public start(options?: RTMStartOptions): Promise<WebAPICallResult> {
376 this.logger.debug('start()');
377
378 // capture options for potential future reconnects
379 this.startOpts = options;
380
381 // delegate behavior to state machine
382 this.stateMachine.handle('start');
383
384 // return a promise that resolves with the connection information
385 return new Promise((resolve, reject) => {
386 this.once('authenticated', (result) => {
387 this.removeListener('disconnected', reject);
388 resolve(result);
389 });
390 this.once('disconnected', (err) => {
391 this.removeListener('authenticated', resolve);
392 reject(err);
393 });
394 });
395 }
396
397 /**
398 * End an RTM session. After this method is called no messages will be sent or received unless you call

Callers 2

RTMClientClass · 0.45
constructorMethod · 0.45

Calls 1

debugMethod · 0.65

Tested by

no test coverage detected