@torontopubliclibrary/slack-helper
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

slack-helper

Using deploy notifications class

find the following credentials under your Slack app, use the same options for SlackHelper

const notification = new DeployNotifications({
  token: '123abc', // required
  signingSecret: '123abc', // required
  channel_name: 'widgets-project', // required
  app_id: '123abc' // required
});

use helper classes in this library SlackHelper, DBHelper

first initialize them by calling new on them:

const slackHelper = new SlackHelper( ... )

SlackHelper

DBHelper (Database Helper)

This class is a named a more broadly than its use- the main use of this class is to aid in data persistence between Slack calls.

make sure to always call dbHelper.db.destroy() after your actions to close the db connection.

initiate using:

const dbHelper = new DBHelper();

DBHelper automatically creates a messages table on a sqlite database that looks like this:

{
  "commit": string,
  "ts": string
}

All getter/setter methods onDBHelper use commit to fetch table data or set table data.

Methods include: del, add, first

Readme

Keywords

none

Package Sidebar

Install

npm i @torontopubliclibrary/slack-helper

Weekly Downloads

2

Version

0.8.0

License

GPL2

Unpacked Size

35.5 kB

Total Files

33

Last publish

Collaborators

  • _mehrad
  • tpl-dx-team