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

请教群聊如何关闭默认@就自动回复,只保留关键词触发 #35

Closed
Lancenas opened this issue Feb 2, 2023 · 10 comments
Closed

Comments

@Lancenas
Copy link

Lancenas commented Feb 2, 2023

请教群聊中如何关闭默认@触发回复,只保留关键词触发回复。
另外群聊机器回复最好也添加前缀,识别真人。

@zhayujie
Copy link
Owner

zhayujie commented Feb 3, 2023

1.关闭@回复:这个暂时不支持,后续可以增加一个配置项来实现。 不过是什么场景需要 被@ 但不回复呢
2.群聊回复前缀: 这个我后面加一个配置项来实现

@Lancenas
Copy link
Author

Lancenas commented Feb 3, 2023

1.关闭@回复:这个暂时不支持,后续可以增加一个配置项来实现。 不过是什么场景需要 被@ 但不回复呢 2.群聊回复前缀: 这个我后面加一个配置项来实现

群聊信息很多的时候,查看聊天信息时分清bot和真人很累。群友希望需要时用关键词触发,不需要时不影响正常聊天。
我查了代码就是没找到,这是itchat里面控制的吗?

@zhayujie
Copy link
Owner

zhayujie commented Feb 3, 2023

1.关闭@回复:这个暂时不支持,后续可以增加一个配置项来实现。 不过是什么场景需要 被@ 但不回复呢 2.群聊回复前缀: 这个我后面加一个配置项来实现

群聊信息很多的时候,查看聊天信息时分清bot和真人很累。群友希望需要时用关键词触发,不需要时不影响正常聊天。 我查了代码就是没找到,这是itchat里面控制的吗?

这个是项目代码里控制的,在 wechat_channel.py 中,晚点我可以加一下这个功能

@Lancenas
Copy link
Author

Lancenas commented Feb 3, 2023

1.关闭@回复:这个暂时不支持,后续可以增加一个配置项来实现。 不过是什么场景需要 被@ 但不回复呢 2.群聊回复前缀: 这个我后面加一个配置项来实现

群聊信息很多的时候,查看聊天信息时分清bot和真人很累。群友希望需要时用关键词触发,不需要时不影响正常聊天。 我查了代码就是没找到,这是itchat里面控制的吗?

这个是项目代码里控制的,在 wechat_channel.py 中,晚点我可以加一下这个功能

@Lancenas Lancenas closed this as completed Feb 3, 2023
@zhayujie
Copy link
Owner

zhayujie commented Feb 3, 2023

@Lancenas 这两个功能还需要嘛

@Lancenas
Copy link
Author

Lancenas commented Feb 4, 2023

@Lancenas 这两个功能还需要嘛

需要的!昨天小号被微信以第三方客户端冻结了,刚刚解冻。

@zhayujie
Copy link
Owner

zhayujie commented Feb 4, 2023

功能已添加,重新拉取代码后,需要在config.json中加上两个配置, group_at_off 为 true 表示关闭群聊@触发,group_chat_reply_prefix 为群聊回复内容的前缀。

示例如下:

{
  "open_ai_api_key": "YOUR API KEY",
  "single_chat_prefix": ["bot", "@bot"],
  "single_chat_reply_prefix": "[bot] ",
  "group_chat_prefix": ["@bot"],
  "group_name_white_list": ["ChatGPT测试群"],
  "image_create_prefix": ["", "", "找一张"],
  "group_at_off": true,
  "group_chat_reply_prefix": "[bot] ",
}

@Lancenas
Copy link
Author

Lancenas commented Feb 5, 2023

功能已添加,重新拉取代码后,需要在config.json中加上两个配置, group_at_off 为 true 表示关闭群聊@触发,group_chat_reply_prefix 为群聊回复内容的前缀。

示例如下:

{
  "open_ai_api_key": "YOUR API KEY",
  "single_chat_prefix": ["bot", "@bot"],
  "single_chat_reply_prefix": "[bot] ",
  "group_chat_prefix": ["@bot"],
  "group_name_white_list": ["ChatGPT测试群"],
  "image_create_prefix": ["", "", "找一张"],
  "group_at_off": true,
  "group_chat_reply_prefix": "[bot] ",
}

谢谢!

@chendong0
Copy link

在Linux部署代码,扫码登陆后只能在微信的“文件传输”窗口聊天,如何调出机器人放到群组里?看了说明,找不到头绪。

@yuzhouchaoreng
Copy link

[WARNING][2023-05-01 07:55:31][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[INFO][2023-05-01 07:55:31][bridge.py:30] - create bot chatGPT for chat
[INFO][2023-05-01 07:55:31][chat_gpt_bot.py:49] - [CHATGPT] query=你好呀
[WARNING][2023-05-01 07:55:33][chat_gpt_bot.py:142] - [CHATGPT] Exception: Incorrect API key provided: YOUR API KEY. You can find your API key at https://platform.openai.com/account/api-keys.
[INFO][2023-05-01 07:55:33][wechat_channel.py:187] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧), receiver=filehelper
[WARNING][2023-05-01 07:55:46][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[WARNING][2023-05-01 07:55:58][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[WARNING][2023-05-01 07:56:24][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[INFO][2023-05-01 07:56:24][chat_gpt_bot.py:49] - [CHATGPT] query=怎么回事
[WARNING][2023-05-01 07:56:24][chat_gpt_bot.py:142] - [CHATGPT] Exception: Incorrect API key provided: YOUR API KEY. You can find your API key at https://platform.openai.com/account/api-keys.
[INFO][2023-05-01 07:56:24][wechat_channel.py:187] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧), receiver=filehelper
[WARNING][2023-05-01 08:02:37][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[INFO][2023-05-01 08:02:37][chat_gpt_bot.py:49] - [CHATGPT] query=怎么回事
[WARNING][2023-05-01 08:02:38][chat_gpt_bot.py:142] - [CHATGPT] Exception: Incorrect API key provided: YOUR API KEY. You can find your API key at https://platform.openai.com/account/api-keys.
[INFO][2023-05-01 08:02:38][wechat_channel.py:187] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧), receiver=filehelper
[WARNING][2023-05-01 08:12:27][wechat_message.py:68] - [WX]get other_user_id failed: 'NickName'
[INFO][2023-05-01 08:12:27][chat_gpt_bot.py:49] - [CHATGPT] query=为什么你只会这一句
[WARNING][2023-05-01 08:12:28][chat_gpt_bot.py:142] - [CHATGPT] Exception: Incorrect API key provided: YOUR API KEY. You can find your API key at https://platform.openai.com/account/api-keys.
[INFO][2023-05-01 08:12:28][wechat_channel.py:187] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧), receiver=filehelper
只会回复“[ERROR]
我现在有点累了,等会再来吧)”怎么回事

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

4 participants