tobias

1.0.1 • Public • Published

Tobias

Simple pub/sub style client for the Slack Discovery API

Install

npm i tobias

Example

in action

const tobias = require('tobias');

const instance = new tobias({ 
  discoveryToken: process.env.SLACK_DISCOVERY_TOKEN, 
  logger: console, 
  pollingIntervalSec: 1 
});

instance.on("message", ({ message, channelId, slackDiscoveryClient }) => {
  console.log("\tChannel %s Message: %s", channelId, message.text);
  if (message.text.includes('pizza')) {
    slackDiscoveryClient.tombStoneMessage(
      ts = message.ts,
      channel = channelId,
      team = message.team,
      replaceWithText = 'Please refrain from discussing :pizza:');
  }
});

Install

npm i tobias

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

12 kB

Total Files

6

Last publish

Collaborators

  • cpreid86