Open gpww opened 1 year ago
这里contact_id会拿到一个空"",可以先判空过滤一下绕过
It's not a bug in python-wechaty: you should check whether the text is mentional message with the following:
if await msg.mention_self():
pass
if await msg.mention_list():
mention_text = await msg.mention_text()
So please help yourself to upgrade the code. Good luck to you.
同样遇到这个问题,通过
if await msg.mention_self():
if await msg.mention_self():
pass
if await msg.mention_list():
keyword = await msg.mention_text()
这个代码没有解决问题。 使用 https://github.com/wechaty/python-wechaty/pull/390 ,可以解决问题,希望官方可以重视。 感谢@B1gM8c 的贡献。
According to the diffs
between https://github.com/wechaty/python-wechaty/pull/390 and https://github.com/wechaty/python-wechaty/tree/main, it seems that cached contacts is dirty not been updated. Fetching all of contacts works but violence.
I will try to merge this pr to fix this bug and refactor it later.
Environment
Description
Minimum reproducible code
text = await msg.mention_text()