Jump to content
McKay Development

Ron

Member
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Ron's Achievements

  1. Yeah this.client.users[steam_id] is undefined. Roughly 1 minute after the login, it's called upon an API HTTP request.
  2. log.info(this.data.name, 'Recipient: ' + this.client.users[steam_id].player_name + ', Player state: ' + this.client.users[steam_id].persona_state);
  3. 1. Yes, since it succeeded sending the message to other players. 2. client.users doesn't provide the data for all users. I have a user who is a Steam friend (myFriends[steam_id] returns 3, aka friend enum), and when using client.users it doesn't find him. Any idea?
  4. Hey, Running into a bit of an issue sometimes with persona_state, it's sometimes null for some reason. Code: Bot.prototype.sendMessage = function(steam_id, send_offline, message) { if (this.client.myFriends[steam_id] === undefined || this.client.myFriends[steam_id] === 2 || this.client.myFriends[steam_id] === 4) { log.error(this.data.name, 'The message recipient is not a friend.'); return false; } this.client.getPersonas([steam_id], (personas) => { if (send_offline == false && personas[steam_id].persona_state == 0) { log.info(this.data.name, 'The recipient is offline, and the request has disabled offline sending.'); return false; } else { // temp. debug log.info(this.data.name, 'Name: ' + personas[steam_id].player_name + ', State: ' + personas[steam_id].persona_state); } log.info(this.data.name, 'Sending the message...'); this.client.chatMessage(steam_id, message); log.success(this.data.name, 'Success!'); return true; }); }; What could cause this? The player it tries to send the message to is a friend, so that's not the issue.
×
×
  • Create New...