Skip to content
This repository was archived by the owner on May 27, 2020. It is now read-only.

Commit 92444e3

Browse files
authored
Fix cnnot find roles of undefined (#8)
1 parent 93c558d commit 92444e3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ yarn global add sactive-bot
8383
- Bot server authentication
8484
- Crypto all sensitive information
8585
- Render card
86-
- Docker version, kubernetes yaml file
86+
- Docker version, add kubernetes yaml file
8787
- Wechat Adapter
8888
- [WeChat Protocol](http://www.blogjava.net/yongboy/archive/2015/11/05/410636.html)
8989
- [WeixinBot](https://github.com/Urinx/WeixinBot)

lib/middlewares/filter_middleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function filterMiddleware(context, next, done) {
2929
robot.processStatus.str = msg.message.text;
3030
}
3131
}
32-
// ignore if user doesn't @bot
32+
// ignore if user doesn't @<bot name>
3333
if (!botNameReg.test(msg.message.text)) {
3434
robot.processStatus.toBot = false;
3535
return done();
@@ -42,7 +42,7 @@ function filterMiddleware(context, next, done) {
4242
}
4343
// ignore message from system user in mattermost channel
4444
if (robot.adapterName === 'mattermost') {
45-
if (msg.message.user.room_name !== '' && msg.message.user.mm.roles.startsWith('system') && !msg.message.text.startsWith('@')) {
45+
if (msg.message.user.room_name !== '' && !msg.message.text.startsWith('@')) {
4646
return done();
4747
}
4848
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sactive-bot",
3-
"version": "1.3.14",
3+
"version": "1.3.15",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)