4.0.11 • Published 6 years ago

frozor-slack v4.0.11

Weekly downloads
119
License
-
Repository
-
Last release
6 years ago

Frozor-Slack

A slack API for node that isn't (completely) stupid.

NOTE: This API now uses promises instead of callbacks. Will update when I have time, but in the mean time the documentation will be outdated in this way.

Dependencies:

  • request
  • frozor-websocket
    • frozor-logger

If you aren't a fan of frozor-logger, just modify frozor-websocket to use a different module, or have frozor-logger return a different module's exports.

Usage:

const log = new (require('frozor-logger'))('SLACK');
const SlackAPI = require('frozor-slack');

// initialize the api, giving it the token allows it to use the token automatically in args
let bot = new SlackAPI(process.env.SLACK_TOKEN);

// Starts RTM  ¯\_(ツ)_/¯
bot.rtm.start();

// Everything that's not rtm.start() is stored in 'methods', and follows api.slack.com/methods
bot.methods.chat.postMessage({channel: 'chat', text: `Seven cats meow meow meow`, as_user: true}, (err, res)=>{
    if(err){
        log.error(err);
    }else{
        log.info(res);
    }
});

bot.on('hello', ()=>{
    log.info('Slack said hi!');

    bot.storage.self.get((err, res)=>{
        if(err) log.error('could not get self storage');
        else log.info(JSON.stringify(res));
    });
});

Features:

  • Full slack Web API and RTM API support
  • User, channel, group storage with a callback that will look up the information if it can be obtained and does not exist.
4.0.11

6 years ago

4.0.10

7 years ago

4.0.9

7 years ago

4.0.8

7 years ago

4.0.7

7 years ago

4.0.6

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.0.14

7 years ago

3.0.13

7 years ago

3.0.12

7 years ago

3.0.11

7 years ago

3.0.10

7 years ago

3.0.9

7 years ago

3.0.8

7 years ago

3.0.7

7 years ago

3.0.6

7 years ago

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.3

7 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

0.0.2

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago