0.3.1 • Published 5 years ago

slack-write v0.3.1

Weekly downloads
727
License
MIT
Repository
github
Last release
5 years ago

NPM version dependencies Status

write on slack

Usage

  1. Add a slackbot integration, and get a token (https://your-team-name.slack.com/services/new/slackbot)
  2. Get a channel id from slack (https://api.slack.com/methods/channels.list/test)
  3. You can pass anything to username
  4. You can use slack message formatting (https://api.slack.com/docs/formatting)

Example

var slackWrite = require('slack-write');
var channel = {
	token: 'slack-bot-token',
	channel: 'CXXXXXXX',
	username: 'bot-name'
};
var slack = slackWrite(channel);

// write plain text
slack.write('Some text', function(err, result) {
	console.log(err, result);
});

// post a single attachment
slack.attach('ignored text', {
	pretext: 'pretext',
	title: 'attachment title',
	text: 'some texts following title'
}, function(err, result) {
	console.lgo(err, result);
});

License

MIT © Dongwon Lim

0.3.1

5 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

8 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago