Jump to content
McKay Development

Client.getPersonas() doesn't do anything


Benja1006

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...