Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to make random responses

//I USE THIS IN DISCORD.JS V12. OTHER THINGS MAY NEED OTHER CODE.
const replies = ['reply1', 'reply2', 'reply3']; //Extend this if you want more messages.
const result = Math.floor(Math.random() * replies.length); //This will choose a random response.
//Use ${replies[result]} at your message if you want to add it to something else.
message.channel.send(`${replies[result]}`); //You can even change text around it, pretty cool.
Comment

PREVIOUS NEXT
Code Example
Javascript :: save action hide element in jquery 
Javascript :: append string in variable using jquery in each loop 
Javascript :: how er create json data file to train our rasa model 
Javascript :: what is a 0 based language 
Javascript :: npm react native turn by turn navigation 
Javascript :: no styles are appearing in angular calendar 
Javascript :: Map the peoples of Ray such as their first name comes first in the string in js 
Javascript :: srcset vue 
Javascript :: elasticsearch transport client example 
Javascript :: unexpected template string expression no-template-curly-in-string react 
Javascript :: PlayerInteractEntityEvent get called twice 
Javascript :: cancel drop down list onchange event javascript 
Javascript :: jwtdecode has no call signatures angular 
Javascript :: javascript middleware getter and setter 
Javascript :: foreach access this 
Javascript :: render blaze in react 
Javascript :: why does my react project dosent have any class 
Javascript :: optimized lots of html elements 
Javascript :: get every other item in an array 
Javascript :: javascript sistemas 
Javascript :: multiple set in meteor user 
Javascript :: firefox extension make ajax request 
Javascript :: vuejs use set to prevent duplicates 
Javascript :: svn node remains in conflict 
Javascript :: mongodb hasOwnProperty returns false 
Javascript :: copy two fields to one javascript 
Javascript :: .env file vars nto defined in child directory 
Javascript :: error message remove after checkbox fill in jquery 
Javascript :: dwhdjksbhds efedhgsd djsioqdhsjd 
Javascript :: concept of node js with react js 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =