How to use hubot-slack - 1 common examples

To help you get started, we’ve selected a few hubot-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 shipengqi / sactive-bot / lib / adapters / slack / slack_adapter.js View on Github external
constructor(robot, options) {
    super(robot);
    this.options = options;

    // hubot-slack will default to use process.env.HUBOT_SLACK_TOKEN
    if (this.options.bot_token) {
      this.sbotAdapter = hubotSlack.use(this.robot);
      // client for api call
      // this.client = this.sbotAdapter.client.web;
    } else {
      this.robot.logger.warning('No bot token found, slack bot (rtm) not set');
    }

    // Only when adapter is needed
    if (this.sbotAdapter) {
      this.sbotAdapter.once('connected', () => {
        return this.emit('connected');
      });
    }
  }

hubot-slack

A Slack adapter for hubot

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular hubot-slack functions