Jump to content
McKay Development

Toad

Member
  • Content Count

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. What should I do in my case? I am passing it a steamid and it's throwing.
  2. Thanks for all the advice, been working at it and learning. Curious about the getPersonas function. Two of my attemps are: const myarray = [steamid]; const response = client.getPersonas(myarray); console.log(response); and client.getPersonas([steamid], function (personas) { var persona = personas[steamid.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamid.getSteamID64() + "]"); console.log(name) }); First one says something about a promise callback waiting, the second one throws 'Cannot read property '76561199066343914' of null'.
  3. Putting more than two if statements causes the behavior I found. client.on('friendMessage', function(steamid, message){ if (message == '!hello'){ client.chatMessage(steamid, 'Hiya'); } if (message == '!why'){ client.chatMessage(steamid, 'Because you told me to'); } if (message == '!lol'){ client.chatMessage(steamid, 'You are funny'); } else { client.chatMessage(steamid, 'Adios'); } }); Only command that works properly is !lol, all the others work but they also call the else statement.
  4. Yeah I didn't copy and paste the code fully, there is a closed paren and semicolon at the very end. Just edited it. If someone just sends me just !Hello, it sends both messages. Idk.. weird.
  5. I'll have to give that a try when I get a minute, thank you. Syntax errors? How so? It is running right now. const client = new SteamUser(); const logOnOptions = { accountName: password: }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Logged into Steam'); client.setPersona(SteamUser.EPersonaState.Online); }); client.on('friendMessage', function(steamid, message){ if (message == '!Hello'){ client.chatMessage(steamid, 'Hiya'); } else { client.chatMessage(steamid, 'Adios!'); } }): This should only send "Hiya" if someone sends me !Hello I thought? Can't figure out why it sends both messages when I get !Hello
  6. Are you referring to 'tradeOffers' event? I'm not sure how to utilize it as you describe. I can subscribe or listen for the event but it still only gives me an integer 'count' I thought? Off topic question but why don't if/else statements operate like they usually do? client.on('friendMessage', function(steamid, message){ if (message == '!Hello){ client.chatMessage(steamid, 'Hi there friend!'); } else { client.chatMessage(steamid, 'Adios amigo!'); } } With the code above, when someone sends me '!Hello', it sends them: Hi there friend! Adios amigo!
  7. Thanks again for the response. For reference, I am using node. I looked at what you linked...so basically, I need to grab hold of the sender id, check if it's a 'tradeoffer', and respond back? If so, I'm not sure how to do that. Friendmessage.bbc_code_parsed, then in that, somehow access if it has the tradeoffer tag?
  8. Thanks the response. When you say trade offer BBcode, can you elaborate? I currently have switch statements that listen for specific messages, so idk if instead listening to trade offers and sending a message that way is better? Eh, just really confused on the documentation.
  9. When a user sends a trade offer, a notification appears in the steam chat. How do I capture that? Ie, when I get that notification, I want to respond.
×
×
  • Create New...