Jump to content
McKay Development
Slime

Something wierd with sending messages

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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...