Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kennedysmartins/58b681b3d49085a452882105e401db36 to your computer and use it in GitHub Desktop.
Save kennedysmartins/58b681b3d49085a452882105e401db36 to your computer and use it in GitHub Desktop.
Random function & Fun ball8 command
//Random function
function rand(min, max) { //Random Function
return Math.floor(Math.random() * (max - min) + min);
}
//Ball8 command
} else if (msg.body.startsWith('!ball8')) { //Ball8 fun game
var args = msg.body.split(' ');
var bola8palavras = ["It's right", "It definitely is", "Without a doubt", "Yes, definitely", "You can count on it", "In my opinion, yes", "Probably", "It seems so", " Yes "," Signs point to yes "," Vague answer try again "," Ask again later "," I better not tell you now "," I can't predict now "," Focus and ask again " , "Don't count on it", "My answer is no", "My sources say no", "Looks like no", "Very Doubtful"];
if (args.length >= 2) {
msg.reply('*Ball8 response:* '+bola8palavras[rand(1,bola8palavras.length)]); //requires random function
}
else {
client.sendMessage(msg.from,'_Have you heard of the mysteries of the 8 ball? What has the property of predicting the future? No? Well, my friend, get ready to know the most mysterious mysteries that are hidden within the universe. Ask the 8-ball to respond._\n\n_Use !ball8 [Ask]_');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment