Please input your question:
User:hi
[ERROR][2023-12-20 14:29:35][chat_channel.py:300] - Worker return exception: 'isgroup'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/channel/chat_channel.py", line 169, in _handle
reply = self._generate_reply(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/channel/chat_channel.py", line 179, in _generate_reply
e_context = PluginManager().emit_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/plugins/plugin_manager.py", line 189, in emit_event
instance.handlers[e_context.event](e_context, *args, **kwargs)
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/plugins/linkai/linkai.py", line 112, in on_handle_context
if context.type == ContextType.TEXT and _find_file_id(context):
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/plugins/linkai/linkai.py", line 283, in _find_file_id
user_id = _find_user_id(context)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/plugins/linkai/linkai.py", line 265, in _find_user_id
if context["isgroup"]:
~~~~~~~^^^^^^^^^^^
File "/Users/xxx/Documents/workspace/chatgpt-on-wechat/bridge/context.py", line 46, in __getitem__
return self.kwargs[key]
~~~~~~~~~~~^^^^^
KeyError: 'isgroup'
前置确认
⚠️ 搜索issues中是否已存在类似问题
操作系统类型?
MacOS
运行的python版本是?
other
使用的chatgpt-on-wechat版本是?
Master (branch)
运行的
channel
类型是?wx(个人微信, itchat)
复现步骤 🕹
当设置channel为terminal时,执行错误
问题描述 😯
错误内容:
修改代码:
channel/chat_channel.py
:在
if context.get("isgroup", False)
判断没有isgroup
时增加该key
可以解决:终端日志 📒
Debug模式下,日志如下: