Closed Ran-Xing closed 2 years ago
亲爱的大佬,能看看这个问题吗?
message.mention() ⇒ Promise <Contact []> The method gets you the message mentioned contactList and returns Promise <Contact []> - > message mentioned contactList.
message.mention.Self() would not work as expected. You could use message.mentionSelf() instead.
@ericcug There is only mentionSelf() in go-wechaty, which is the problem I mentioned.
Could you give more details? I'm not get your point.
As I quoted above, message.mention() return a contact list not only a contact. message.mention.self() will not work like that you expected, there is no self() for a contactList.
Both message.mention() and message.mentionSelf() works in TypeScript. Or you should try latest version.
@ericcug I am using the go-wechaty library, but the author tested the padlocal protocol normally
This is the case, for example
Botname= helloword
UserA: `@helloword` (with spaces here)
or
UserA: `@helloword How are you!` (There is content after the nickname)
Both cases use `message.MentionSelf()` ,,,,, Result :`message.MentionSelf()== false`
That is, it can't detect someone @ the robot
I don't know much about golang. mentionSelf is async and don't forget await
code in js:
let atMe = await message.mentionSelf()
你好,系统运营中,添加到新群,报错,是不是因为XP协议,不知道入群,无法更新群列表信息。所以找不到报错。这个暂时不发解决吧
if (await message.mentionSelf()) {
console.log('this message were mentioned me! [You were mentioned] tip ([有人@我]的提示)')
}
有人@我,在有消息时无法正常显示
@keac 我现在都是login的时候把名字存起来名字切片,哈哈哈
[有人@我]的提示 message.mention() ⇒ Promise <Contact []> 版本: wechaty@1.11 wechaty-puppet-xp wechaty/go-wechaty#108