Skip to content
/ tobias Public

Simple pub/sub style client for the Slack Discovery API

License

Notifications You must be signed in to change notification settings

cpreid/tobias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:');
  }
});

About

Simple pub/sub style client for the Slack Discovery API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published