Skip to content

random chat messages read for more info #1959

Answered by aesthetic0001
tk746 asked this question in Q&A
Discussion options

You must be logged in to vote

Elaborate. Do you mean two possible formats that it may use to respond? if that's the case, I guess a way could be to store them in a constant array with (possibly an object) info on where the username should be inserted and what the chat message is, then just use

Math.floor(Math.random * arrayName.length - 1)

to get a random index when u want to send a message and then send that message with the given info from the object u got from the index of arrayName
Hope this makes sense xD

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tk746
Comment options

@amoraschi
Comment options

@satyamedh
Comment options

Answer selected by tk746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants