tinybot
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "tinybot", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A tiny wrapper around the Slack RTM API that provides methods to listen for and send slack messages.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,3 +33,5 @@ # tinybot | ||
bot.say("Hello world"); // posts to #general by default | ||
bot.say("Hello world"); // posts to #general by default | ||
bot.say("Hello world", "#random"); // post to a channel by name | ||
bot.say("Hello world", "C123456789"); // post to a channel by ID | ||
@@ -36,0 +38,0 @@ Basic listener |
@@ -38,3 +38,5 @@ var expect = require('expect'); | ||
before(function(cb){ | ||
slackTest.serve(6969, function(err) { | ||
slackTest.serve(6969, { | ||
channels: [{ name: 'general', id: 'CG0' }] | ||
}, function(err) { | ||
if( err ) { return cb(err); } | ||
@@ -109,2 +111,10 @@ bot = new Tinybot(slackToken, '#general', 'http://localhost:6969'); | ||
it('allows sending messages to channel based on name', function(cb) { | ||
bot.hears({channel: '#general'}, function(message) { | ||
return cb(); | ||
}); | ||
slackTest.socket.send({ channel: '#general'}); | ||
}) | ||
it("expands nested fields", function (cb) { | ||
@@ -111,0 +121,0 @@ bot.hears({"file.name": 'Slack for iOS'}, function(message) { |
17655
404
73