metzz Posted November 26, 2019 Report Posted November 26, 2019 (edited) [ALREADY FIXED, PLEASE DELETE THIS POST.] Hello, im starting to learn nodejs and I have a problem if you could help me would be amazing! So I made this Steam Bot, which IDLE's a game and receives, responds to steam messages. But im trying to log everything in my console, like who sent me the message and whats the content of it. Ive searched for and found another guy who had this problem but for me it didnt fix it, this is my code: client.on("friendMessage", function(steamID, message) { client.getPersonas([steamID], function (personas) { const persona = personas[steamID.getSteamID64()]; const name = persona ? persona.player_name : (steamID.getSteamID64()); if (message != 'null') { client.chatMessage(steamID, config.mensagemAutomatica); console.log("Message received:", message,"||", "From:", name); } }) }); So whenever someone sends me a message, im getting the following error: const persona = personas[steamID.getSteamID64()]; ^ TypeError: Cannot read property '76561198171125906' of null at C:\Users\Administrator\Desktop\coding\steam-bot\bot.js:42:33 at Immediate.<anonymous> (C:\Users\Administrator\Desktop\coding\steam-bot\node_modules\@doctormckay\stdlib\components\promises.js:24:6) at processImmediate (internal/timers.js:439:21) Id appreciate any help! Edited November 26, 2019 by metzz Quote
metzz Posted November 26, 2019 Author Report Posted November 26, 2019 Already Fixed it, I saw the documentation and function needed to have err, as soon as i added error it worked! please DELETE my post. Quote
NoiseBaphomet Posted April 17, 2021 Report Posted April 17, 2021 Hi, I'm new, where can I find the documentation? I have error in "var persona = personas[steamID.getSteamID64()]; ^ in [ Quote
Dr. McKay Posted April 17, 2021 Report Posted April 17, 2021 2 hours ago, NoiseBaphomet said: Hi, I'm new, where can I find the documentation? I have error in "var persona = personas[steamID.getSteamID64()]; ^ in [ The documentation is on GitHub. I would need to see the entire error output to help you with that at all. Quote
NoiseBaphomet Posted April 17, 2021 Report Posted April 17, 2021 D:\bot\bot.js:75 var persona = personas[steamID.getSteamID64()]; ^ TypeError: Cannot read property '76561198987247955' of null at D:\bot\bot.js:75:27 at Immediate.<anonymous> (D:\bot\node_modules\steam-user\node_modules\@doctormckay\stdlib\components\promises.js:90:6) at processImmediate (internal/timers.js:461:21) 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.