-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Function message.to(): Contact|Room
bug
#88
Comments
Thanks for the report. The behavior you reported is confirmed. And I agree that room() should has the same behavior in all conditions. However, your issue lead me to re-think about the Wechaty Message design: is there any reason for Currently However, Wechaty treats Contact and Room as two totally different things. This design is because I believe it should: Contact is a person, Room is a group of persons. At last, I believe that it is really confusing that After that, the Will commit the code later. |
message.to(): Contact|Room
bug
Thanks, About your question, maybe there is no reason for to() to return a Room instance, if function message.room(room:Room) can set the destination for message. But it seems cannot work well as shown in #89 |
Run
npm run doctor
orwechaty run doctor
(for docker user), paste output hereWechaty Doctor
Code
I' trying use message.to() method, the full code as follows
Expected behavior
When someone(not the bot itself) says "hello" in the room, m.to() should return room, but now, m.room() return contact
Steps to reproduce the behavior (and fixes, if any)
I login in with username '李佳芮' , then create a room called 'testmsg'.
When the bot itself speaking in the room 'testmsg', m.to() return the room 'testmsg' as expected.
Log as follows:(console.log(
MessageReciver:${to} content:${content} form:${from} in room: ${room}
) )When other people speaking in room 'testmsg' ,m.to() return to the contact which username is '李佳芮'.(I think it should return room)
Log as follows:(console.log(
MessageReciver:${to} content:${content} form:${from} in room: ${room}
) )While, I think this message 's receiver is the room 'testmsg', so it should return room 'testmsg' , not the bot.
I wonder know is it a bug or you intented this return value? Thanks.
The text was updated successfully, but these errors were encountered: