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
When bot quit the room, bot still thought it in the room. #1345
Labels
Comments
Please see the related commit and test again. |
It didn't fix. WeChaty Version:0.15.179 Brief Log:
Full Log:12:27:46 VERB PuppetPadchat onPadchatMessage({id=878676533023475898, type=Text(5)})
rawPayload: { content: 'ding',
continue: 1,
description: 'wechaty-alias : ding',
from_user: 'qq512436430',
msg_id: '878676533023475898',
msg_source: '<msgsource />\n',
msg_type: 5,
status: 1,
sub_type: 1,
timestamp: 1529036865,
to_user: 'wxid_zj2cahpwzgie12',
uin: 324216852 }
12:27:46 VERB Message static create(878676533023475898)
12:27:46 SILL Accessory #17<Message> constructor()
12:27:46 VERB Message constructor(878676533023475898) for class Message
12:27:46 VERB Message ready()
12:27:46 SILL Puppet messagePayloadCache(878676533023475898) cache MISS
12:27:46 VERB Puppet messagePayload(id=878676533023475898, dirty=false)
12:27:46 SILL Puppet messagePayloadCache(878676533023475898) cache MISS
12:27:46 VERB PuppetPadChat messageRawPayloadParser({msg_id="878676533023475898"})
12:27:46 SILL PuppetPadchat messagePayload({"id":"878676533023475898","timestamp":1529036865,"type":6,"fromId":"qq512436430","toId":"wxid_zj2cahpwzgie12","text":"ding"})
12:27:46 SILL Puppet messagePayload(878676533023475898) cache SET
12:27:46 SILL Contact ready() @ PuppetPadchat<default>
12:27:46 SILL Contact ready() isReady() true
12:27:46 SILL Contact ready() @ PuppetPadchat<default>
12:27:46 SILL Contact ready() isReady() true
12:27:46 SILL Contact alias()
12:27:46 SILL Contact alias()
<李佳芮>:Message#Text(Contact<wechaty-alias>►Contact<苏轼>)<ding>
12:27:46 VERB Puppet selfId()
12:27:46 VERB Room find({ topic: /^ding/i })
12:27:46 VERB Room findAll()
12:27:46 VERB Puppet roomSearch({"topic":{}})
12:27:46 VERB PuppetPadchat roomList()
12:27:46 VERB PuppetPadchatManager getRoomIdList()
12:27:46 VERB PuppetPadchatManager getRoomIdList()=239
12:27:46 SILL PuppetPadchat roomList()=239
12:27:46 SILL Puppet roomSearch() allRoomIdList.length=239
...
12:27:46 INFO Bot onMessage: dingRoom not found, try to create one
12:27:46 SILL Contact alias()
12:27:46 INFO Bot createDingRoom(Contact<wechaty-alias>)
12:27:46 INFO Bot getHelperContact()
12:27:46 VERB Contact find({"name":"李卓桓"})
12:27:46 VERB Cotnact findAll({ name: 李卓桓 })
12:27:46 VERB Puppet contactSearch(query={"name":"李卓桓"}, )
12:27:46 VERB Puppet contactQueryFilterFactory({"name":"李卓桓"})
12:27:46 SILL Contact ready() @ PuppetPadchat<default>
12:27:46 SILL Contact ready() isReady() true
12:27:46 INFO Bot getHelperContact() ok. got: 李卓桓
12:27:46 SILL Contact alias()
12:27:46 SILL Contact alias()
12:27:46 VERB Bot contactList: Contact<wechaty-alias>,Contact<李卓桓>
12:27:46 SILL Contact alias()
12:27:46 SILL Contact alias()
12:27:46 VERB Room create(Contact<wechaty-alias>,Contact<李卓桓>, ding)
12:27:46 VERB PuppetPadchat roomCreate(qq512436430,lizhuohuan, ding)
12:27:46 SILL PadchatRpc rpcCall(WXCreateChatRoom, ["[\"qq512436430\",\"lizhuohuan\"]"])
12:27:47 SILL PadchatRpc WXCreateChatRoom(userList.length=2) = "{"message":"\n\u0010Everything is OK","status":0,"user_name":"\n\u00138894025622@chatroom"}"
12:27:47 VERB Puppet roomPayload(id=8894025622@chatroom, dirty=false)
...
12:27:48 VERB Room say(ding - created, )
12:27:48 VERB PuppetPadchat messageSend({"roomId":"8894025622@chatroom"}, ding - created)
12:27:48 SILL PadchatRpc rpcCall(WXSendMsg, ["8894025622@chatroom","ding - created",""])
createDingRoom id: 8894025622@chatroom
12:27:49 INFO Bot manageDingRoom()
.....
// This maybe the bot quit room log
12:28:07 VERB PuppetPadchat onPadchatMessage({id=1703148901488591281, type=StatusNotify(5)})
rawPayload: { content:
'<msg>\n<op id=\'2\'>\n<username>8894025622@chatroom</username>\n</op>\n</msg>',
continue: 1,
description: '',
from_user: 'wxid_zj2cahpwzgie12',
msg_id: '1703148901488591281',
msg_source: '',
msg_type: 5,
status: 1,
sub_type: 51,
timestamp: 1529036886,
to_user: '8894025622@chatroom',
uin: 324216852 }
12:28:07 VERB Message static create(1703148901488591281)
12:28:07 SILL Accessory #19<Message> constructor()
12:28:07 VERB Message constructor(1703148901488591281) for class Message
12:28:07 VERB Message ready()
12:28:07 SILL Puppet messagePayloadCache(1703148901488591281) cache MISS
12:28:07 VERB Puppet messagePayload(id=1703148901488591281, dirty=false)
12:28:07 SILL Puppet messagePayloadCache(1703148901488591281) cache MISS
12:28:07 VERB PuppetPadChat messageRawPayloadParser({msg_id="1703148901488591281"})
12:28:07 SILL PuppetPadchat messagePayload({"id":"1703148901488591281","timestamp":1529036886,"type":0,"fromId":"wxid_zj2cahpwzgie12","roomId":"8894025622@chatroom","text":"<msg>\n<op id='2'>\n<username>8894025622@chatroom</username>\n</op>\n</msg>"})
12:28:07 SILL Puppet messagePayload(1703148901488591281) cache SET
12:28:07 SILL Contact ready() @ PuppetPadchat<default>
12:28:07 SILL Contact ready() isReady() true
12:28:07 VERB Room ready()
12:28:07 SILL Puppet roomPayloadCache(8894025622@chatroom) cache MISS
12:28:07 VERB Puppet roomPayload(id=8894025622@chatroom, dirty=false)
12:28:07 SILL Puppet roomPayloadCache(8894025622@chatroom) cache MISS
12:28:07 VERB PuppetPadchat roomRawPayload(8894025622@chatroom)
12:28:07 VERB PuppetPadchatManager roomRawPayload(8894025622@chatroom)
12:28:07 SILL PuppetPadchatManager roomRawPayload(8894025622@chatroom) retry() attempt=1
12:28:07 SILL PadchatRpc rpcCall(WXGetContact, ["8894025622@chatroom"])
12:28:07 SILL PadchatRpc WXGetContact(8894025622@chatroom) result: {"big_head":"","chatroom_id":700000001,"chatroom_owner":"wxid_zj2cahpwzgie12","city":"","country":"","intro":"","label":"","max_member_count":500,"member":"[\"qq512436430\",\"lizhuohuan\",\"wxid_zj2cahpwzgie12\"]\n","member_count":3,"message":"","nick_name":"ding - created","provincia":"","py_initial":"DINGCREATED","quan_pin":"dingcreated","remark":"","remark_py_initial":"","remark_quan_pin":"","sex":0,"signature":"","small_head":"http://wx.qlogo.cn/mmcrhead/jMZK9Ytd7E2Gtkjv6jwZxpFe6bhzKXJv785waftereKnp0Y84ic3Pl3zUZKuWLk9mSgn6BtK1bwibMCDVY7nNQibX0nWpwS70HJ/0","status":0,"stranger":"v1_5849ae973baa6de4b10617e64d21b15a956d6775013ffce7afe987a6c0626bf611b32a9aae385be9ec7e4931f802a0a0@stranger","ticket":"","user_name":"8894025622@chatroom"}
12:28:07 VERB PuppetPadchat roomRawPayloadParser(rawPayload.user_name="8894025622@chatroom")
12:28:07 SILL Puppet roomPayload(8894025622@chatroom) cache SET
12:28:07 VERB PuppetPadchat roomMemberList(8894025622@chatroom)
12:28:07 VERB PuppetPadchatManager getRoomMemberIdList(8894025622)
12:28:07 SILL PuppetPadchatManager syncRoomMember(8894025622@chatroom)
12:28:07 SILL PadchatRpc rpcCall(WXGetChatRoomMember, ["8894025622@chatroom"])
12:28:07 SILL PadchatRpc WXGetChatRoomMember() result: {"chatroom_id":700000001,"count":3,"member":"[{\"big_head\":\"http://wx.qlogo.cn/mmhead/ver_1/wN7tTZj7LiaR7k8rqALz17nYnHvTSichOiclE7SB8ljd4u9sZLtJf7ibOa8jXYibTwU5rA7F7zISXG6SxzEKTPSnDaQ/0\",\"chatroom_nick_name\":\"\",\"invited_by\":\"wxid_zj2cahpwzgie12\",\"nick_name\":\"李佳芮\",\"small_head\":\"http://wx.qlogo.cn/mmhead/ver_1/wN7tTZj7LiaR7k8rqALz17nYnHvTSichOiclE7SB8ljd4u9sZLtJf7ibOa8jXYibTwU5rA7F7zISXG6SxzEKTPSnDaQ/132\",\"user_name\":\"qq512436430\"},{\"big_head\":\"http://wx.qlogo.cn/mmhead/v
12:28:07 SILL PuppetPadchatManager syncRoomMember(8894025622@chatroom) total 6 members
12:28:07 VERB PuppetPadchatManager getRoomMemberIdList(8894025622) length=3
12:28:07 SILL PuppetPadchat roomMemberList()=3
.....
12:28:35 VERB PuppetPadchat onPadchatMessage({id=1534500513732973396, type=Text(5)})
rawPayload: { content: 'ding',
continue: 1,
description: 'wechaty-alias : ding',
from_user: 'qq512436430',
msg_id: '1534500513732973396',
msg_source: '<msgsource />\n',
msg_type: 5,
status: 1,
sub_type: 1,
timestamp: 1529036914,
to_user: 'wxid_zj2cahpwzgie12',
uin: 324216852 }
12:28:35 VERB Message static create(1534500513732973396)
12:28:35 SILL Accessory #20<Message> constructor()
12:28:35 VERB Message constructor(1534500513732973396) for class Message
12:28:35 VERB Message ready()
12:28:35 SILL Puppet messagePayloadCache(1534500513732973396) cache MISS
12:28:35 VERB Puppet messagePayload(id=1534500513732973396, dirty=false)
12:28:35 SILL Puppet messagePayloadCache(1534500513732973396) cache MISS
12:28:35 VERB PuppetPadChat messageRawPayloadParser({msg_id="1534500513732973396"})
12:28:35 SILL PuppetPadchat messagePayload({"id":"1534500513732973396","timestamp":1529036914,"type":6,"fromId":"qq512436430","toId":"wxid_zj2cahpwzgie12","text":"ding"})
12:28:35 SILL Puppet messagePayload(1534500513732973396) cache SET
12:28:35 SILL Contact ready() @ PuppetPadchat<default>
12:28:35 SILL Contact ready() isReady() true
12:28:35 SILL Contact ready() @ PuppetPadchat<default>
12:28:35 SILL Contact ready() isReady() true
12:28:35 SILL Contact alias()
12:28:35 SILL Contact alias()
<李佳芮>:Message#Text(Contact<wechaty-alias>►Contact<苏轼>)<ding>
12:28:35 VERB Puppet selfId()
12:28:35 VERB Room find({ topic: /^ding/i })
12:28:35 VERB Room findAll()
12:28:35 VERB Puppet roomSearch({"topic":{}})
12:28:35 VERB PuppetPadchat roomList()
12:28:35 VERB PuppetPadchatManager getRoomIdList()
12:28:35 VERB PuppetPadchatManager getRoomIdList()=240
12:28:35 SILL PuppetPadchat roomList()=240
12:28:35 SILL Puppet roomSearch() allRoomIdList.length=240
....
12:28:35 VERB Puppet roomQueryFilterFactory({"topic":{}})
12:28:35 SILL Puppet roomSearch() roomIdList filtered. result length=1
12:28:35 VERB Room ready()
12:28:35 VERB Room topic()
12:28:35 INFO Bot onMessage: got dingRoom: ding - created
12:28:35 VERB PuppetPadchat roomMemberList(8894025622@chatroom)
12:28:35 VERB PuppetPadchatManager getRoomMemberIdList(8894025622)
12:28:35 VERB PuppetPadchatManager getRoomMemberIdList(8894025622) length=3
12:28:35 SILL PuppetPadchat roomMemberList()=3
12:28:35 INFO Bot onMessage: sender has already in dingRoom
12:28:35 VERB Contact say(no need to ding again, because you are already in ding room)
12:28:35 VERB PuppetPadchat messageSend({"contactId":"qq512436430"}, no need to ding again, because you are already in ding room)
12:28:35 SILL PadchatRpc rpcCall(WXSendMsg, ["qq512436430","no need to ding again, because you are already in ding room",""]) |
Did you |
yes, code as follows: /**
* find room name start with "ding"
*/
try {
const dingRoom = await this.Room.find({ topic: /^ding/i })
if (dingRoom) {
/**
* room found
*/
log.info('Bot', 'onMessage: got dingRoom: %s', await dingRoom.topic())
if (await dingRoom.has(from)) {
/**
* speaker is already in room
*/
log.info('Bot', 'onMessage: sender has already in dingRoom')
from.say('no need to ding again, because you are already in ding room')
// sendMessage({
// content: 'no need to ding again, because you are already in ding room'
// , to: sender
// })
} else { |
huan
added a commit
that referenced
this issue
Jun 15, 2018
Merged
fix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wechaty version:
0.15.172
Bug
When bot quit the room, bot still thought it in the room.
Reproduce:
room-bot.ts
Expect
the bot will create a ding Room again
Actual
bot says it has already had ding room and the sender is already in dingRoom
Full log
The text was updated successfully, but these errors were encountered: