Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求助,如果用于微信自动回复 #78

Open
taylorshuang opened this issue Apr 6, 2019 · 11 comments
Open

求助,如果用于微信自动回复 #78

taylorshuang opened this issue Apr 6, 2019 · 11 comments

Comments

@taylorshuang
Copy link

我想实现,别人@我,机器人就可以自动回复我设定内容。我用demo那个例子,每次是我自己说一句话,就回复一句,别人@我就没有任何反应,后台是有报错的,[E] ignore the messages from @@50b65cc0b7a3ba8c1107eb7ae99fb367986a829caf278f2aaad50760f38fd817

@taylorshuang
Copy link
Author

我打印msg的消息内容,msg.content是可以输出的,但msg.who,msg.ToUserName都是不是可读的字符串,很奇怪

@taylorshuang
Copy link
Author

消息的内容:不是我的,我是无辜的
谁:@b5bbbea72c91bda473aacbcdfdd5f875689f32ee1317928a0d9c83a5afc30c51
来自哪里:@b5bbbea72c91bda473aacbcdfdd5f875689f32ee1317928a0d9c83a5afc30c51
是不是群组:false
发送给谁:@c5924eb933bd000a2c7e4ed8a92590caac64d1642c8cd98cafda86e3b3ba23ba

@taylorshuang
Copy link
Author

contact := session.Cm.GetContactByUserName(msg.FromUserName) if contact == nil { logs.Error("ignore the messages from", msg.FromUserName) return },这段代码根据消息的所有者来获取群组,总感觉不对,返回都是nil

@taylorshuang
Copy link
Author

能不能把msg这个结构体的每个字段是个什么作用,在代码里面讲解下。我跑了一遍代码,toUsername应该是给别人发信息,Fromusername表示消息来自哪里,who表示谁发送消息。
我想做的一个应用,就是别人@机器人+关键字,机器人能够根据关键字回复对应的内容,但目前,别人@机器人,机器人是没法识别的。机器人只能对群里所有信息执行识别。

@taylorshuang
Copy link
Author

go的微信机器人,只有这个算全的,大家有推荐,或者一起把这个机器人维护好呀。。。

@taylorshuang
Copy link
Author

从我跑的代码来看,msg里面的字段都不是可读的字符串,不知道有没有办法变为可读。

@songtianyi
Copy link
Owner

我有空的时候看看是什么问题

@taylorshuang
Copy link
Author

@songtianyi 我测试了另一个wxbot,可以实现我说的功能。这个把版本的机器人可能太没维护了,有些功能可能有问题。

@max-min
Copy link

max-min commented Jun 18, 2019

@taylorshuang from,to,who都是字符串形式,如何和微信好友对应起来啊?

@max-min
Copy link

max-min commented Jun 19, 2019

@taylorshuang from,to,who都是字符串形式,如何和微信好友对应起来啊?

Done。需要调用一下接口获取一下用户列表

@ltto
Copy link

ltto commented Dec 9, 2019

@max-min 请问 获取用户列表的接口是什么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants