Benja1006 Posted January 17, 2020 Report Posted January 17, 2020 Hi, i'm currently trying to make a simple donation bot, and wan't to use Client.getPersonas() to get their usernames. Currently it seems as though the program is skipping over the function. It doesn't return an error, but it also doesn't do anything, and anything in the callback isn't run. I would love some help. This is my code: console.log(offer.partner.accountid); console.log(toReceive); client.getPersonas([offer.partner.accountid], (err, personas) => { if (err){ console.log(err); } console.log(offer.partner.accountid.getSteamID64()); console.log(personas); var partnerPersona = personas[offer.partner.accountid.getSteamID64()]; var partnerName = partnerPersona ? partnerPersona.player_name : ("[" + offer.partner.accountid.getSteamID64() + "]"); console.log(partnerPersona); // the player's name is now available as name return bot.channels.get(process.env.DEFAULT).send(`Thank you ${partnerName} for donating ${toReceive}!`); }); console.log("afterwards"); I see the first to console.logs in the console, as well as the last one, but nothing on the inside. Quote
Dr. McKay Posted January 17, 2020 Report Posted January 17, 2020 Just [offer.partner]. You need to either pass a SteamID object or a string that can parse into one. Passing just an accountid won't work. 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.