puppet-xp icon indicating copy to clipboard operation
puppet-xp copied to clipboard

使用Contact.alias()、Message.mentionSelf()等时,返回的数值不正确

Open zhuangzihan opened this issue 3 years ago • 2 comments

1、同一个对话框,talkerIdtoId 都是固定的,不管是哪个人发,机器人永远是 toId,这也导致了 Message.self() 方法一直是 false 2、Contact.alias() 获取到的都为空,不管有无备注 3、Message.mentionSelf() 返回的结果一直都为 false

zhuangzihan avatar Jan 15 '22 15:01 zhuangzihan

This issue should have been fixed by PR #66 and #76

ericcug avatar Feb 11 '22 09:02 ericcug

我试过了手动替换代码到最新(2月15日)【因为无论我如何npm upgrade,哪怕是指定版本号,都会给我安装 1.10.2版本,但我看你们最新版本是 1.10.19】 然而题主的这几个问题依然在。(我是使用Python-wechaty,已经更新到0.85版本)

2022-03-12 13:35:09,680 - Contact - INFO - Contact alias <None>
2022-03-12 13:35:09,689 - Contact - INFO - Contact alias(None) rejected: ('can"t get contact<wxid_a6xxa7n11u5j22> alias', None, None)
您还没有为联系人设置任何别名大兄弟666

群里面的群昵称也不行,导致 mention总是@对方的名称,而非群备注

2022-03-12 13:36:49,665 - Room - INFO - Room say <dong, ['wxid_a6xxa7n11u5j22']>
2022-03-12 13:36:49,666 - Contact - INFO - Contact alias <None>
2022-03-12 13:36:49,668 - Contact - INFO - Contact alias(None) rejected: ('can"t get contact<wxid_a6xxa7n11u5j22> alias', None, None)

不仅如此,现在同一个对话窗口,自己账号从另外设备发出的消息自动同步过来的,也会被认为是对方发来的,也就是msg.is_self()还是不能正确取值

另外file_box也是不支持的……

Exception in callback AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...not defined")>) at C:\Users\Zhao\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py:65
handle: <Handle AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...not defined")>) at C:\Users\Zhao\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py:65>
Traceback (most recent call last):
  File "C:\Users\Zhao\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Zhao\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\asyncio.py", line 71, in callback
    self.emit("error", exc)
  File "C:\Users\Zhao\AppData\Local\Programs\Python\Python39\lib\site-packages\wechaty\wechaty.py", line 289, in emit
    return super().emit(event, *args, **kwargs)
  File "C:\Users\Zhao\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\Zhao\AppData\Local\Programs\Python\Python39\lib\site-packages\pyee\base.py", line 139, in _emit_handle_potential_error
    raise error
  File "C:\Users\Zhao\puppet-try.py", line 53, in on_message
    await msg.say(file_box)
NameError: name 'file_box' is not defined

bigbrother666sh avatar Mar 12 '22 12:03 bigbrother666sh