Advertisement
Xbobcatx420

ojjjoj

Sep 26th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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: ["Tea Cup", "Tea Cup#3343"] },
  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.   { q: "What is the capital of Turkey?", a: ["ankara"] },
  27.   { q: "How many continents are there?", a: ["Seven"] },
  28.   { q: "How many time zones are there in the world?", a: ["Twenty-four"] },
  29.   { q: "Which European river does flow through six different countries? ", a: ["Donau river"] },
  30.   { q: "What is the capital city of Australia ? ", a: ["Canberra"] },
  31.   { q: "Urticaria is a skin disease otherwise known as what?    ", a: ["Hives"] },
  32.   { q: "What kind of animal is the largest living creature on Earth ", a: ["Whale"] },
  33.   { q: "What do dragonflies prefer to eat?", a: ["Mosquitoes"] },
  34.   { q: "What do you get when you crossbreed a donkey and a horse?   ", a: ["Hinny"] },
  35.   { q: "Which insects cannot fly, but can jump higher than 30 cm?   ", a: ["Fleas"] },
  36.   { q: "In which city is the oldest zoo in the world?   ", a: ["Vienna"] },
  37.   { q: "After which animals are the Canary Islands named?   ", a: ["Dogs"] },
  38.   { q: "What is the food of penguins?   ", a: ["Plankton"] },
  39.   { q: "In which city was the Titanic built?", a: ["Belfast"] },
  40.   { q: "On which island was Napoleon born?  ", a: ["Corsica"] },
  41.   { q: "Which building in Athens was destroyed by a Venetian cannon ball in the 17th century?   ", a: ["Parthenon"] },
  42.   { q: "Which country sent its navy around the world to fight the Japanese in 1904? ", a: ["Russia"] },
  43.   { q: "What is the name of the network of computers from which the Internet has emerged?   ", a: ["Arpanet"] },
  44.   { q: "In what year was Google launched on the web?    ", a: ["1998"] },
  45.   { q: "Which unit is an indication for the sound quality of MP3?   ", a: ["Kbps"] },
  46.   { q: "In which Nintendo DS game do you have to raise a puppy as well as possible? ", a: ["Nintendogs"] }
  47. ];
  48. const options = {
  49.   max: 1,
  50.   time: 30000,
  51.   errors: ["time"],
  52. };
  53.  
  54. module.exports.run = async (bot, message, args) => {
  55.  
  56.   const item = quiz[Math.floor(Math.random() * quiz.length)];
  57.   await message.channel.send(item.q);
  58.   try {
  59.     const collected = await message.channel.awaitMessages(answer => item.a.includes(answer.content.toLowerCase()), options);
  60.     const winnerMessage = collected.first();
  61.     return message.channel.send({embed: new Discord.RichEmbed()
  62.                                  .setAuthor(`Winner: ${winnerMessage.author.tag}`, winnerMessage.author.displayAvatarURL)
  63.                                  .setTitle(`Correct Answer: \`${winnerMessage.content}\``)
  64.                                  .setFooter(`Question: ${item.q}`)
  65.                                  .setColor(message.guild.me.displayHexColor)
  66.                                 })
  67.   } catch (_) {
  68.     return message.channel.send({embed: new Discord.RichEmbed()
  69.                                  .setAuthor('No one got the answer in time!')
  70.                                  .setTitle(`Correct Answer(s): \`${item.a}\``)
  71.                                  .setFooter(`Question: ${item.q}`)
  72.                                 })
  73.   }
  74. }
  75. module.exports.help = {
  76. name: "quiz"
  77. }
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement