Jump to content


Photo
Question

How can i put random responses?

node.js node-steam-user

  • Please log in to reply
1 reply to this topic

#1 takken

takken

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 11 September 2019 - 12:33 PM

I wanna make a bot wich responds randomly when the user typer !random, i have created a array with the  example: 

 var random = ["random","blabla","bla"]

 So i added the function:

 

function random_sentences(random) {
    return random[Math.floor(Math.random()*random.length)];
}

 

and if anyones type !random:

 

 else if(message == "!random"{

        client.chatMessage(random_sentences(random))
     }

 

this error appears:

                throw new Error("Unknown SteamID input format \"" + input + "\"");
                ^
 
Error: Unknown SteamID input format
 
I did like to know how the bot can reponse randomly.
Thanks


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 11 September 2019 - 10:48 PM

The first argument to client.chatMessage needs to be the SteamID of the user to whom you're sending the message.







Also tagged with one or more of these keywords: Question, node.js, node-steam-user

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users