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

Commit

Permalink
Fix cnnot find roles of undefined (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
shipengqi authored Apr 26, 2019
1 parent 93c558d commit 92444e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ yarn global add sactive-bot
- Bot server authentication
- Crypto all sensitive information
- Render card
- Docker version, kubernetes yaml file
- Docker version, add kubernetes yaml file
- Wechat Adapter
- [WeChat Protocol](http://www.blogjava.net/yongboy/archive/2015/11/05/410636.html)
- [WeixinBot](https://github.com/Urinx/WeixinBot)
Expand Down
4 changes: 2 additions & 2 deletions lib/middlewares/filter_middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function filterMiddleware(context, next, done) {
robot.processStatus.str = msg.message.text;
}
}
// ignore if user doesn't @bot
// ignore if user doesn't @<bot name>
if (!botNameReg.test(msg.message.text)) {
robot.processStatus.toBot = false;
return done();
Expand All @@ -42,7 +42,7 @@ function filterMiddleware(context, next, done) {
}
// ignore message from system user in mattermost channel
if (robot.adapterName === 'mattermost') {
if (msg.message.user.room_name !== '' && msg.message.user.mm.roles.startsWith('system') && !msg.message.text.startsWith('@')) {
if (msg.message.user.room_name !== '' && !msg.message.text.startsWith('@')) {
return done();
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sactive-bot",
"version": "1.3.14",
"version": "1.3.15",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 92444e3

Please sign in to comment.