Hello. I have a small problem... Sometimes the bot crashes with an error "Cannot read property 'player_name' of undefined" Here is my code:
bot.on('friendsList', function() {
for (var steamID in bot.myFriends) {
if(bot.myFriends[steamID] === 2) {
bot.getPersonas([steamID], function(getName) {
var friendName = getName[steamID].player_name;
//Some code
});
}
}
}); Where I erred ?