Socket
Socket
Sign inDemoInstall

tinybot

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinybot - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

5

index.js
'use strict';
var request = require('request');
var WebSocket = require('ws');
var EventEmitter = require('events');
var _ = require('lodash');
var debug = require('debug')('tinybot');
var id = 0;

@@ -240,3 +239,3 @@

var value = matcher[field];
var actual = message[field];
var actual = _.get(message, field);
if( field == 'filename' ) { actual = message.file && message.file.name; }

@@ -243,0 +242,0 @@ if( field == 'user' && value[0] != 'U' ) { value = self.userIdForName(value); }

3

package.json
{
"name": "tinybot",
"version": "1.0.5",
"version": "1.0.6",
"description": "A tiny wrapper around the Slack RTM API that provides methods to listen for and send slack messages.",

@@ -32,2 +32,3 @@ "main": "index.js",

"debug": "^2.2.0",
"lodash": "^4.16.1",
"request": "^2.75.0",

@@ -34,0 +35,0 @@ "ws": "^1.1.1"

@@ -60,5 +60,5 @@ # tinybot

// trolls anyone who posts in #random from an iPhone with nested matchers
bot.hears({channel: '#random', file: { name: 'Slack for iOS'}, function fooBar(message) {
bot.hears({channel: '#random', "file.name": /Slack for iOS/}, function fooBar(message) {
bot.say("ooooh, fancy", '#random');
}})
})

@@ -65,0 +65,0 @@ // snooze one meeting with hearsOnce

@@ -40,3 +40,3 @@ var expect = require('expect');

if( err ) { return cb(err); }
bot = new Tinybot(slackToken, null, 'http://localhost:6969');
bot = new Tinybot(slackToken, '#general', 'http://localhost:6969');
bot.start(cb);

@@ -109,2 +109,21 @@ });

it("expands nested fields", function (cb) {
bot.hears({"file.name": 'Slack for iOS'}, function(message) {
bot.say("ooooh, fancy");
})
var conversation = [
{
file: {
name: 'Slack for iOS'
}
},
{
response: 'ooooh, fancy'
}
]
slackTest.expectConversation(conversation, cb);
});
describe('drop', function() {

@@ -111,0 +130,0 @@ it('allows dropping by function name', function(cb) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc