python-wechaty icon indicating copy to clipboard operation
python-wechaty copied to clipboard

EventErrorPayload has not attr code

Open me-v2 opened this issue 3 years ago • 4 comments

payload = EventErrorPayload(**payload_data) | TypeError: __init__() got an unexpected keyword argument 'code'

@dataclass class EventErrorPayload(EventPayloadBase): data: str sees: /wechaty_puppet/schemas/event.py

me-v2 avatar Apr 01 '22 03:04 me-v2

Can you give more info about the error?

  • token type
  • event_name
  • more context info

So I can help you fix this problem.

wj-Mcat avatar Apr 01 '22 03:04 wj-Mcat

tokenType: puppet_paimon_********

receive event <EventErrorPayload(code=36, ...) receive error info <{'code': 36, 'msg': 'The text (贾玲) is banned'}> EventErrorPayload has no attr "code" or msg.

code status 36 sometime 31. you should debug code status from where.

image

me-v2 avatar Apr 01 '22 08:04 me-v2

now, I directly edit event.py, add some fields(code, msg, data.....) avoid exception /Users/hiro/Library/Caches/pypoetry/virtualenvs/dichat-Yf_2revS-py3.8/lib/python3.8/site-packages/wechaty_puppet/schemas/event.py

me-v2 avatar Apr 01 '22 08:04 me-v2

This problem has been fixed by the new commit for wechaty-puppet. So you can upgrade the wechaty-puppet package to avoid this issue.

wj-Mcat avatar Apr 02 '22 11:04 wj-Mcat