0.3.1 • Published 6 years ago

slack-write v0.3.1

Weekly downloads
727
License
MIT
Repository
github
Last release
6 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

6 years ago

0.3.0

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago