Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

艾特色图姬GKD的时候会回复两遍没色图 #36

Closed
chenxuxin188 opened this issue Dec 22, 2019 · 0 comments
Closed

艾特色图姬GKD的时候会回复两遍没色图 #36

chenxuxin188 opened this issue Dec 22, 2019 · 0 comments

Comments

@chenxuxin188
Copy link

chenxuxin188 commented Dec 22, 2019

描述这个 bug
正则表达当中keyword那一部分替换成艾特一个憨批或者竹竹自己,会回复找不到色图。如果艾特竹竹,会回复两次。

如何复现
复现步骤(如果能复现)

  1. 竹竹发点 @某个憨批(或竹竹) 的色图

期望现象
回复找不到色图或者回复两次找不到色图。

截图及日志
截图之前没截图。。之前利用console测试过,艾特竹竹回复两遍是因为找不到色图的时候不会stopPropogation,groupmsg 和 groupmsgatme的commonhandler都会跑一次所以会发两遍。

平台

  • 操作系统:CentOS 7
  • Node 版本:6.11.3

附加内容
为了更方冲出色图,正则方式有改过,比如
"^(?.*?)GKD$"

有些憨批就会艾特姬器人来GKD
而且艾特某人的色图其实也挺有意思的……

我自己的解决方式是
在setu.js里
const atMyselfReg = / *\[CQ:at,qq=[0-9]*\] */;
一个艾特人的CQ码的正则表达

sendSetu的开头
const tt = context.message.replace(atMyselfReg, '');
const setuRegExec = setuReg.exec(tt);
然后找不到色图的时候也return true
在commonHandler里色图那部分IF条件里加了个

e.stopPropagation();

这样就可以

@某个憨批 发色图了。

话说大佬有赞助途径吗,感觉就这么白嫖代码还有大佬的色图库挺不好意思的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant