Q:

I made a 8 Ball code but it is only giving me 1 anwser

I am making a Discord Bot for me and my friends. I have made a 8Ball script and it is only giving me 1 answer. Here is my variable:
var rand = ['Yes', 'No', 'Why are you even trying?', 'What do you think? NO', 'Maybe', 'Never', 'Yep'];

var yesOrNo = rand[Math.floor(Math.random()*rand.length)];

And here is the command that is running the variable:
if(input == "!8BALL")
{
    bot.reply(message, 'Your anwser is: ' + yesOrNo);
}

A:

You should make a function and call it when the user puts in !8BALL.
function doMagic8BallVoodoo() {
    var rand = ['Yes', 'No', 'Why are you even trying?', 'What do you think? NO', 'Maybe', 'Never', 'Yep'];

    return rand[Math.floor(Math.random()*rand.length)];
}

// Later in the code:
if(input == "!8BALL")
{
    bot.reply(message, 'Your anwser is: ' + doMagic8BallVoodoo());
}

