Jump to content


Photo
Question

Something wierd with sending messages

nodejs bot

  • Please log in to reply
3 replies to this topic

#1 Slime

Slime

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 29 March 2019 - 04:51 AM

I've tried sending all my friends a message. so i made a function for that:

function messageAllCommand() {
    var messageAll = readlineSync.question('Enter message: ');
    for (var friend in client.myFriends) {
        console.log(friend);
        client.chatMessage(friend, messageAll);
    }
}

but somewhy, it seems really random who gets the message tho it prints everyone's id it but still don't send everyone the message.
here are the ID's:
https://pastebin.com/5NGqV340

E.G: it printed the user id:

    76561198278317090

but didn't sent the message.
and it printed the user id:
    76561198173748582
this time it sent the message.
I checked and friendsList was emitted before

BTW this forum is real good and i get answers. ;)


Edited by Slime, 29 March 2019 - 04:52 AM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,111 posts

Posted 29 March 2019 - 02:33 PM

You're almost definitely being rate-limited by Steam to prevent spam.



#3 Slime

Slime

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 29 March 2019 - 03:49 PM

I've delayed it but it still doesn't seems to send all messages and always the same people get messaged...

function messageAllCommand() {
    var messageAll = readlineSync.question('Enter message: ');
    for (var friend in client.myFriends) {
        console.log(friend);
        client.chatMessage(friend, messageAll);
        await sleep(100);
    }
}
function sleep(ms) {
    return new Promise(resolve => {
        setTimeout(resolve, ms);
    });

I've just noticed that everyone who didn't get the message haven't spoke with me for a while. and even people it didn't send the message to got it after i talked with them... wierd...


Edited by Slime, 29 March 2019 - 04:03 PM.


#4 Slime

Slime

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 30 March 2019 - 01:35 AM

You're almost definitely being rate-limited by Steam to prevent spam.

forgot to quote.. see the above ^







Also tagged with one or more of these keywords: Question, nodejs, bot

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users