New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hubot-friends/hubot-slack

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hubot-friends/hubot-slack - npm Package Compare versions

Comparing version

to
1.0.10

2

package.json
{
"name": "@hubot-friends/hubot-slack",
"version": "1.0.9",
"version": "1.0.10",
"description": "A new Slack adapter for Hubot",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/hubot-friends/hubot-slack#readme",

@@ -382,3 +382,7 @@ const {Adapter, TextMessage, EnterMessage, LeaveMessage, TopicMessage, CatchAllMessage, User} = require.main.require("hubot/es2015.js");

if(text.includes(`<@${botId}>`)) {
if(this.robot.alias) {
return text.replace(`<@${botId}>`, `${this.robot.alias}`);
} else {
return text.replace(`<@${botId}>`, `@${botName}`);
}
}

@@ -385,0 +389,0 @@ return text;

const {describe, it, beforeEach, before, after} = require('node:test');
const assert = require('node:assert/strict');
const Module = require('module');
const SlackBot = require('../src/bot.js');

@@ -352,2 +353,14 @@ const hookModuleToReturnMockFromRequire = (module, mock) => {

it('Should preprend our alias to a name-lacking message addressed to us in a DM', function(t, done) {
const bot = new SlackBot({alias: '!', logger: {info(){}, debug(){}}}, {appToken: ''});
bot.self = {
user_id: '1234'
}
const text = bot.replaceBotIdWithName({
text: '<@1234> foo',
})
assert.deepEqual(text, '! foo');
done()
});
it('Should NOT prepend our name to a name-containing message addressed to us in a DM', function(t, done) {

@@ -354,0 +367,0 @@ const bot_name = slackbot.robot.name;