How to use messaging-api-slack - 2 common examples

To help you get started, we’ve selected a few messaging-api-slack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yoctol / bottender / packages / bottender / src / slack / __tests__ / SlackContext.spec.ts View on Github external
beforeEach(() => {
  /* eslint-disable global-require */
  SlackClient = require('messaging-api-slack').SlackOAuthClient;
  SlackContext = require('../SlackContext').default;
  SlackEvent = require('../SlackEvent').default;
  sleep = require('delay');
  warning = require('warning');
  /* eslint-enable global-require */
});
github Yoctol / bottender / packages / bottender / src / slack / SlackConnector.ts View on Github external
constructor(options: ConstructorOptions) {
    const { verificationToken, skipLegacyProfile } = options;
    if ('client' in options) {
      this._client = options.client;
    } else {
      const { accessToken, origin } = options;
      this._client = SlackOAuthClient.connect({
        accessToken,
        origin,
      });
    }

    this._verificationToken = verificationToken || '';

    this._skipLegacyProfile =
      typeof skipLegacyProfile === 'boolean' ? skipLegacyProfile : true;

    if (!this._verificationToken) {
      warning(
        false,
        '`verificationToken` is not set. Will bypass Slack event verification.\nPass in `verificationToken` to perform Slack event verification.'
      );
    }

messaging-api-slack

Messaging API client for Slack

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis