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.8 to 1.0.9

5

index.js

@@ -57,3 +57,3 @@ 'use strict';

self.channels = body.channels;
self.self = body.self;
self.myId = body.self.id;
self.ws = new WebSocket(wsUrl);

@@ -238,2 +238,5 @@

var self = this;
if( message.user == self.myId && !matcher.self ) { return false; }
delete matcher.self;
var keys = Object.keys(matcher);

@@ -240,0 +243,0 @@ var matches;

2

package.json
{
"name": "tinybot",
"version": "1.0.8",
"version": "1.0.9",
"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",

@@ -39,3 +39,3 @@ # tinybot

Basic listener
Basic listener: fires for every message over slack websocket

@@ -42,0 +42,0 @@ ```js

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

slackTest.serve(6969, {
channels: [{ name: 'general', id: 'CG0' }]
channels: [{ name: 'general', id: 'CG0' }],
self: { id: 'DISBOT' }
}, function(err) {

@@ -62,3 +63,3 @@ if( err ) { return cb(err); }

it('matches a regexp', function(cb) {
bot.hears({filename: /n(.*)e/}, function(message, matches) {
bot.hears({'file.name': /n(.*)e/}, function(message, matches) {
expect(matches[1]).toEqual('op');

@@ -115,2 +116,14 @@ cb();

it('ignores messages from self', function(cb) {
var spy = expect.createSpy();
bot.hears({'text': /.+/}, spy);
bot.hearsOnce({'text': /.+/, self: true}, function() {
expect(spy).toNotHaveBeenCalled();
cb();
})
slackTest.socket.send({ text: 'foo', user: 'DISBOT'});
})
it('allows sending messages to channel based on name', function(cb) {

@@ -117,0 +130,0 @@ bot.hears({channel: '#general'}, function(message) {

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