timgfxx Posted August 13, 2016 Report Posted August 13, 2016 I might be doing this wrong. This is my code: client.on("chatUserLeft", function(chatID, userID) { if (userID.getSteamID64() !== owner) { client.chatMessage(userID, "I hope your issue has been resolved! Whenever you have another question feel free to open another chat :)"); } client.leaveChat(chatID); }); owner = my steamid64. The error I'm getting: C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-user\components\chat.js:512 delete this.chats[sid64].members[target64]; ^ TypeError: Cannot read property 'members' of undefined at SteamUser._handlers.(anonymous function) (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-user\components\chat.js:512:28) at SteamUser._handleMessage (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-user\components\messages.js:198:29) at emitThree (events.js:116:13) at CMClient.emit (events.js:194:7) at CMClient._netMsgReceived (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-client\lib\cm_client.js:278:8) at CMClient.handlers.(anonymous function) (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-client\lib\cm_client.js:386:8) at CMClient._netMsgReceived (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-client\lib\cm_client.js:260:24) at emitOne (events.js:96:13) at TCPConnection.emit (events.js:188:7) at TCPConnection._readPacket (C:\Users\Tim\Desktop\Steam Bots\Assistant\node_modules\steam-client\lib\tcp_connection.js:73:7) [nodemon] app crashed - waiting for file changes before starting... Help is appreciated. Quote
Dr. McKay Posted August 13, 2016 Report Posted August 13, 2016 This is a bug in the module. How frequently does this happen? Is there a reproducible test case? Quote
timgfxx Posted August 13, 2016 Author Report Posted August 13, 2016 (edited) This is a bug in the module. How frequently does this happen? Is there a reproducible test case?It happens every time. What I did was use a timeout to delay it by 3 seconds, which worked at first, but still often gives this error: https://i.gyazo.com/132dd4ff83f1fa01f762aaa6c0deaa24.png. It doesnt always happen everytime, it does like every 30 minutes. Is there a way of fixing this? And what causes this? Edited August 13, 2016 by timgfxx Quote
Dr. McKay Posted August 13, 2016 Report Posted August 13, 2016 Well the error in that screenshot you just provided is caused by you attempting to leave a chat when you aren't connected to Steam. When you say it happens "every time", it happens every time what happens? Every time someone leaves a chat? Quote
timgfx Posted August 13, 2016 Report Posted August 13, 2016 Well the error in that screenshot you just provided is caused by you attempting to leave a chat when you aren't connected to Steam. When you say it happens "every time", it happens every time what happens? Every time someone leaves a chat?In the code I posted in the original post it would crash every time a user left a chat. So that means my session expired? Quote
Dr. McKay Posted August 14, 2016 Report Posted August 14, 2016 No, the original post code is crashing due to some bug that I need to track down. What kind of chat is this? Group chat or multi-user? Also, is the chatEnter event being emitted for it? Can you also listen for chatLeft and see in what order stuff is being emitted? Quote
timgfx Posted August 14, 2016 Report Posted August 14, 2016 (edited) No, the original post code is crashing due to some bug that I need to track down. What kind of chat is this? Group chat or multi-user? Also, is the chatEnter event being emitted for it? Can you also listen for chatLeft and see in what order stuff is being emitted?Multi user I think, the bot invites a user and me. Currently the bot doesn't listen for chatEnter and chatLeft. Only chatUserJoined and charUserLeft, they are both emitted and leaveChat() causes an error in chatUserLeft. I can test chatEnter and chatLeft later today, does steam-user have a debug mode? Edited August 14, 2016 by timgfx Quote
Dr. McKay Posted August 14, 2016 Report Posted August 14, 2016 There isn't any debug mode that would be terribly useful for this, I'm afraid. Quote
timgfxx Posted August 14, 2016 Author Report Posted August 14, 2016 There isn't any debug mode that would be terribly useful for this, I'm afraid. Okay..... So there's no way to fix it? It just crashed again with the same error >.< Quote
timgfxx Posted August 14, 2016 Author Report Posted August 14, 2016 There isn't any debug mode that would be terribly useful for this, I'm afraid.Another question,Why is this called twice? (Line 103 and 105) msg.writeUint64(this.steamID.getSteamID64()); Maybe you have to change this.steamID to steamID, because: SteamUser.prototype.leaveChat = function(steamID) { Testing it out right now! Quote
timgfxx Posted August 14, 2016 Author Report Posted August 14, 2016 There isn't any debug mode that would be terribly useful for this, I'm afraid.Wait a minute, nevermind my last reply. steamID == null if you're not connected to steam, that must be the problem.... I am confused.. how Quote
Dr. McKay Posted August 15, 2016 Report Posted August 15, 2016 Can I see the code that creates the chat and invites the users? Quote
timgfxx Posted August 15, 2016 Author Report Posted August 15, 2016 Can I see the code that creates the chat and invites the users? client.createChatRoom(null, senderID, function(result, chatID) { client.inviteToChat(chatID.getSteamID64(), owner); client.chatMessage(owner, "\nA user needs support: steam://friends/joinchat/" + chatID.getSteamID64()); client.chatMessage(senderID, "\nA new chat has been created.\nClick here to join the chat: steam://friends/joinchat/" + chatID.getSteamID64()); }); Thats called when the bot receives "support" as a message Quote
timgfxx Posted August 16, 2016 Author Report Posted August 16, 2016 Can I see the code that creates the chat and invites the users? Please try fixing it ASAP if you can, my bot keeps crashing Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.