Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. var Discord = require("discord.js");
  2. var client = new Discord.Client();
  3. function Magic8Ball() {
  4. var answers = ['Maybe.', 'Certainly not.', 'I hope so.', 'Bink.',
  5. 'There is a good chance.', 'Quite likely.', 'I think so.', 'I hope not.',
  6. 'I hope so.', 'Never!', 'Youre not funny.', ':joy:', 'Pfft.', 'Hell, yes.', 'Hell to the no.', 'The future is bleak.',
  7. 'The future is uncertain.', 'I would rather not say.', 'Who cares?',
  8. 'Possibly.', 'Never, ever, ever.', 'There is a small chance.', 'Yes!'];
  9. return answers[Math.floor(Math.random()*answers.length)];
  10. }
  11. client.on("message", msg => {
  12. if (msg.content.startsWith("!8ball")) {
  13. msg.channel.sendMessage('Your anwser is: ' + Magic8Ball());
  14. }
  15. });
  16.  
  17. client.on('ready', () => {
  18. console.log('I am ready!');
  19. });
  20.  
  21. client.login("botlogincodehere");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement