wechaty / puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
https://wechaty.js.org/docs/puppet-providers/padlocal
Apache License 2.0
642 stars 88 forks source link

msg.to_contact() fail [using python0-wecahty] #156

Closed bigbrother666sh closed 2 years ago

bigbrother666sh commented 2 years ago

requirements

Describe your problem

RT can not get the contact object via msg.to_contact()

Reproduce your problem

if msg.type() == MessageType.MESSAGE_TYPE_CONTACT:
        owner = await msg.to_contact()
        await bot.Friendship.add(owner, 'invite_tuanzhang')

Error info

2022-04-16 12:22:39,290 - Message - INFO - Message to Contact
Exception in callback AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...ertionError()>) at C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py:65
handle: <Handle AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...ertionError()>) at C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py:65>
Traceback (most recent call last):
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py", line 71, in callback
    self.emit("error", exc)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\wechaty\wechaty.py", line 289, in emit
    return super().emit(event, *args, **kwargs)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\base.py", line 179, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\base.py", line 139, in _emit_handle_potential_error
    raise error
  File "C:\Users\bigbr\puppet-try.py", line 63, in on_message
    owner = await msg.to_contact()
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\wechaty\user\message.py", line 575, in to_contact
    contact_id = await self.puppet.message_contact(self.message_id)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\wechaty_puppet_service\puppet.py", line 494, in message_contact
    response = await self.puppet_stub.message_contact(id=message_id)
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\wechaty_grpc\wechaty\__init__.py", line 330, in message_contact
    return await self._unary_unary(
  File "C:\Users\bigbr\AppData\Local\Programs\Python\Python39\lib\site-packages\betterproto\__init__.py", line 1121, in _unary_unary
    assert response is not None

gateway 04:22:34 ERR PuppetServiceImpl grpcError() messageContact() rejection: not implement

padlocal commented 2 years ago

This message types is not supported by padlocal yet.

bigbrother666sh commented 2 years ago

了解