Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const quiz = [
  3. { q: "What color is the sky?", a: ["no color", "invisible"] },
  4. { q: "Name a soft drink brand.", a: ["pepsi", "coke", "rc", "7up", "sprite", "mountain dew"] },
  5. { q: "Name a programming language.", a: ["actionscript", "coffeescript", "c", "c++", "basic", "python", "perl", "javascript", "dotnet", "lua", "crystal", "go", "d", "php", "ruby", "rust", "dart", "java", "javascript"] },
  6. { q: "Who's a good boy?", a: ["you are", "whirl"] },
  7. { q: "Who created me?", a: ["lone wolf", "lone wolf#2094"] },
  8. { q: "What programming language am I made in?", a: ["javascript",] },
  9. { q: "Name the seventh planet from the Sun.", a: ["uranus"] },
  10. { q: "Name the World's biggest island.", a: ["greenland",] },
  11. { q: "What's the World's longest river?", a: ["amazon", "amazon river"] },
  12. { q: "Name the World's largest ocean.", a: ["pacific", "pacific ocean"] },
  13. { q: "Name one of the three primary colors.", a: ["blue", "red", "yellow"] },
  14. { q: "How many colors are there in a rainbow?", a: ["7", "seven"] },
  15. { q: "What do you call a time span of one thousand years?", a: ["millennium"] },
  16. { q: "How many squares are there on a chess board?", a: ["64", "sixty four"] },
  17. { q: "How many degrees are found in a circle?", a: ["360", "360 degrees", "three hundred sixty"] },
  18. { q: "The Dewey Decimal system is used to categorize what?", a: ["books"] },
  19. { q: "How many points does a compass have?", a: ["32", "thirty two"] },
  20. { q: "How many strings does a cello have?", a: ["4", "four"] },
  21. { q: "How many symphonies did Beethoven compose?", a: ["9", "nine"] },
  22. { q: "How many lines should a limerick have?", a: ["5", "five"] },
  23. { q: "What is the most basic language Microsoft made?", a: ["visual basic"] },
  24. { q: "What is the most complicated language?", a: ["binary"] },
  25. { q: "'OS' computer abbreviation usually means?", a: ["operating system"] }
  26. ];
  27. const options = {
  28. max: 1,
  29. time: 300000,
  30. errors: ["time"],
  31. };
  32.  
  33. module.exports.run = async (bot, message, args) => {
  34.  
  35. const item = quiz[Math.floor(Math.random() * quiz.length)];
  36. await message.channel.send(item.q);
  37. try {
  38. const collected = await message.channel.awaitMessages(answer => item.a.includes(answer.content.toLowerCase()), options);
  39. const winnerMessage = collected.first();
  40. return message.channel.send({embed: new Discord.RichEmbed()
  41. .setAuthor(`Winner: ${winnerMessage.author.tag}`, winnerMessage.author.displayAvatarURL)
  42. .setTitle(`Correct Answer: \`${winnerMessage.content}\``)
  43. .setFooter(`Question: ${item.q}`)
  44. .setColor(`${message.guild.me.displayHexColor!=='#000000' ? message.guild.me.displayHexColor : 0xffffff}`)
  45. })
  46. } catch (_) {
  47. return message.channel.send({embed: new Discord.RichEmbed()
  48. .setAuthor('No one got the answer in time!')
  49. .setTitle(`Correct Answer(s): \`${item.a}\``)
  50. .setFooter(`Question: ${item.q}`)
  51. })
  52. }
  53. }
  54.  
  55.  
  56. exports.help = {
  57. name: "quiz",
  58. category: "Fun",
  59. aliases: [
  60. "none"
  61. ],
  62. usage:"w?quiz",
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement