slack-promise

A wrapper over slack(https://www.npmjs.com/package/slack) that additionally supports ES6 promises

Usage no npm install needed!

<script type="module">
  import slackPromise from 'https://cdn.skypack.dev/slack-promise';
</script>

README

slack-promise

Enhances the slack library with es6-promises.

Install

npm i slack-promise

API

Refer slack for detailed API description. All APIs supported by slack are also supported by slack-promise, difference being that along with the support for callbacks, the APIs return a promise too.

Eg. Starting an RTM session:

import slack from 'slack-promise'

let bot = slack.rtm.client()
let token = process.env.SLACK_TOKEN

bot.hello()
    .then(message => {
        console.log(`Got a message: ${message}`);
        bot.close();
    });

bot.listen({token})