chatgpt-on-wechat icon indicating copy to clipboard operation
chatgpt-on-wechat copied to clipboard

更新之后出错了

Open stupidloud opened this issue 2 years ago • 0 comments

前置确认

  1. 运行于国内网络环境,未开代理
  2. python 已安装:版本在 3.7 ~ 3.10 之间,依赖已安装
  3. 在已有 issue 中未搜索到类似问题
  4. FAQS 中无类似问题

问题描述

简要说明、截图、复现步骤等,也可以是需求或想法

终端日志 (如有报错)

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/itchat/components/register.py", line 60, in configured_reply
    r = replyFn(msg)
  File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 21, in handler_single_msg
    WechatChannel().handle(msg)
  File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 46, in handle
    other_user_id = msg['User']['UserName']     # 对手方id
KeyError: 'UserName'

看来是未加好友的情形下无法取得UserName

stupidloud avatar Feb 16 '23 05:02 stupidloud