wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.55k stars 229 forks source link

[Bug]: #387

Open ZQ7 opened 1 year ago

ZQ7 commented 1 year ago

Environment

- wechaty: 0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: padlocal
- the version of wechaty docker container: [0.65]

Description

Exception in callback AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...ertionError()>) at /usr/local/python3/lib/python3.10/site-packages/pyee/asyncio.py:65
handle: <Handle AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...ertionError()>) at /usr/local/python3/lib/python3.10/site-packages/pyee/asyncio.py:65>
Traceback (most recent call last):
  File "/usr/local/python3/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/python3/lib/python3.10/site-packages/pyee/asyncio.py", line 71, in callback
    self.emit("error", exc)
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/wechaty.py", line 332, in emit
    return super().emit(event, *args, **kwargs)
  File "/usr/local/python3/lib/python3.10/site-packages/pyee/base.py", line 179, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/usr/local/python3/lib/python3.10/site-packages/pyee/base.py", line 139, in _emit_handle_potential_error
    raise error
  File "/home/python3/chatgpt-on-wechat/channel/wechat/wechaty_channel.py", line 71, in on_message
    mention_content = await msg.mention_text()  # 返回过滤掉@name后的消息
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/user/message.py", line 480, in mention_text
    mention_list = await self.mention_list()
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/user/message.py", line 460, in mention_list
    contacts = [
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/user/message.py", line 461, in <listcomp>
    await id_to_contact(contact_id)
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/user/message.py", line 456, in id_to_contact
    await contact.ready()
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty/user/contact.py", line 285, in ready
    self.payload = await self.puppet.contact_payload(
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty_puppet_service/puppet.py", line 550, in contact_payload
    response = await self.puppet_stub.contact_payload(id=contact_id)
  File "/usr/local/python3/lib/python3.10/site-packages/wechaty_grpc/wechaty/__init__.py", line 119, in contact_payload
    return await self._unary_unary(
  File "/usr/local/python3/lib/python3.10/site-packages/betterproto/__init__.py", line 1125, in _unary_unary
    assert response is not None

Minimum reproducible code

mention_content = await msg.mention_text()