ChatGPT-wechat-bot icon indicating copy to clipboard operation
ChatGPT-wechat-bot copied to clipboard

群聊有问题啊,关键词为空,@我之后,没有回复消息

Open goushijie opened this issue 2 years ago • 8 comments

          群聊有问题啊,关键词为空,@我之后,没有回复消息

Originally posted by @ivil in https://github.com/AutumnWhj/ChatGPT-wechat-bot/issues/48#issuecomment-1345459985 是的群聊有问题,私聊正常

goushijie avatar Feb 04 '23 22:02 goushijie

是这样的,我也遇到了

hello-eternity avatar Feb 05 '23 06:02 hello-eternity

同问

runto2006 avatar Feb 05 '23 07:02 runto2006

这个我稍微改了一下代码,反正目前是有效的,更改的文件时index.ts(虽然我也没完全看懂)

const pattern = RegExp(`${config.groupKey}`);
    if (config.autoReply) {
      if (content.startsWith(config.groupKey)) {
        const groupContent = content.replace(pattern, '');
        replyMessage(room, content.trim());
        return;
      } else {
        console.log(
          'Content is not within the scope of the customizition format'
        );
      }
    }

具体的细节还是等待作者更改,这么修改之后相当于简化了识别方式,你需要提前把groupkey设置为需要的形式比如 @wechat_name @runto2006 @goushijie

hello-eternity avatar Feb 05 '23 09:02 hello-eternity

问题貌似出在群昵称上,仅当没有设置群昵称、用户直接at你的微信名的时候才能匹配识别

0x00A0 avatar Feb 07 '23 02:02 0x00A0

问题貌似出在群昵称上,仅当没有设置群昵称、用户直接at你的微信名的时候才能匹配识别

我试了 但还是没有用

KerWingis avatar Feb 08 '23 13:02 KerWingis

这个我稍微改了一下代码,反正目前是有效的,更改的文件时index.ts(虽然我也没完全看懂)

const pattern = RegExp(`${config.groupKey}`);
    if (config.autoReply) {
      if (content.startsWith(config.groupKey)) {
        const groupContent = content.replace(pattern, '');
        replyMessage(room, content.trim());
        return;
      } else {
        console.log(
          'Content is not within the scope of the customizition format'
        );
      }
    }

具体的细节还是等待作者更改,这么修改之后相当于简化了识别方式,你需要提前把groupkey设置为需要的形式比如 @wechat_name @runto2006 @goushijie

这样改了之后所有的群聊都会触发 啊哈哈 我被一个群踢了

biweilong avatar Feb 09 '23 03:02 biweilong