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.62k stars 234 forks source link

🐛🐛 Bug Report: AssertionError assert response is not None #364

Open HuGenCheng opened 2 years ago

HuGenCheng commented 2 years ago

Describe your problem

群发消息错误

Reproduce your problem

k = 0
for room in rooms:
   if room is not None:
     k = k + 1
     if k >= 7:
        await asyncio.sleep(random.randint(60, 120))
        k = 0
      await asyncio.sleep(random.randint(5, 20))
      await room.say(msg)

Error info

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "wechaty_client_pad.py", line 305, in execute
    await room.say(msg)
  File "/usr/local/lib/python3.7/site-packages/wechaty/user/room.py", line 289, in say
    mention_ids=mention_ids
  File "/usr/local/lib/python3.7/site-packages/wechaty_puppet_service/puppet.py", line 337, in message_send_text
    text=message, mentonal_ids=mention_ids)
  File "/usr/local/lib/python3.7/site-packages/wechaty_grpc/wechaty/__init__.py", line 438, in message_send_text
    "/wechaty.Puppet/MessageSendText", request, puppet.MessageSendTextResponse
  File "/usr/local/lib/python3.7/site-packages/betterproto/__init__.py", line 1125, in _unary_unary
    assert response is not None
AssertionError
bigbrother666sh commented 2 years ago

msg是文本么? say只支持文本和filebox。。。

wj-Mcat commented 2 years ago

from the above error log info, we can't find out the key error to help you fix this issue. Please post more detail info:

HuGenCheng commented 2 years ago

version of wechaty: wechaty 0.8.25
wechaty-grpc 0.20.19
wechaty-plugin-contrib 0.0.12
wechaty-puppet 0.3.dev10
wechaty-puppet-service 0.8.5

the type of msg is str