aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/resources/easter/egghead_questions.json36
-rw-r--r--bot/seasons/easter/egghead_quiz.py13
2 files changed, 26 insertions, 23 deletions
diff --git a/bot/resources/easter/egghead_questions.json b/bot/resources/easter/egghead_questions.json
index 141a39d5..1de2b203 100644
--- a/bot/resources/easter/egghead_questions.json
+++ b/bot/resources/easter/egghead_questions.json
@@ -7,7 +7,7 @@
"The UK",
"Germany"
],
- "correct_answer": 4
+ "correct_answer": 3
},
{
"question": "The Easter Bunny was originally going to be a...",
@@ -17,7 +17,7 @@
"cat",
"dove"
],
- "correct_answer": 1
+ "correct_answer": 0
},
{
"question": "Which of the following is NOT a movie about Easter?",
@@ -27,7 +27,7 @@
"The Passion of the Christ",
"Here Comes Peter Cottontail"
],
- "correct_answer": 2
+ "correct_answer": 1
},
{
"question": "In Australia, what animal is used instead of the Easter Bunny?",
@@ -37,7 +37,7 @@
"koala",
"bilby"
],
- "correct_answer": 4
+ "correct_answer": 3
},
{
"question": "When was the first Earth Day?",
@@ -47,7 +47,7 @@
"1999",
"1970"
],
- "correct_answer": 3
+ "correct_answer": 2
},
{
"question": "Who is considered to be the founder of Earth Day?",
@@ -57,7 +57,7 @@
"Vice President Al Gore",
"Sentator Gaylord Nelson"
],
- "correct_answer": 4
+ "correct_answer": 3
},
{
"question": "Approximately how many countries participated in Earth Day 2000?",
@@ -67,7 +67,7 @@
"180",
"240"
],
- "correct_answer": 3
+ "correct_answer": 2
},
{
"question": "As Earth Day is this month, how old is the Earth?",
@@ -77,7 +77,7 @@
"10 billion years old",
"6.7 billion years old"
],
- "correct_answer": 1
+ "correct_answer": 0
},
{
"question": "As a celebration of Earth Day, what is the percentage of Oxygen in the Earth's atmosphere?",
@@ -87,7 +87,7 @@
"25%",
"31%"
],
- "correct_answer": 2
+ "correct_answer": 1
},
{
"question": "In what year did Google begin its tradition of April Fools Jokes?",
@@ -97,7 +97,7 @@
"2003",
"2007"
],
- "correct_answer": 2
+ "correct_answer": 1
},
{
"question": "Which type of chocolate is the most healthy?",
@@ -106,7 +106,7 @@
"White",
"Milk"
],
- "correct_answer": 1
+ "correct_answer": 0
},
{
"question": "How many bars of milk chocolate would you have to eat to get the same amount of caffeine as in one cup of coffee?",
@@ -116,7 +116,7 @@
"14",
"20"
],
- "correct_answer": 3
+ "correct_answer": 2
},
{
"question": "Aztecs used to use one of the ingedients of chocolate, cocoa beans, as...",
@@ -126,7 +126,7 @@
"dye",
"fertilizer"
],
- "correct_answer": 1
+ "correct_answer": 0
},
{
"question": "Which European country was the first to enjoy chocolate?",
@@ -136,7 +136,7 @@
"England",
"Switxherland"
],
- "correct_answer": 2
+ "correct_answer": 1
},
{
"question": "The first European Chocolate Shop opened in what city in 1657?",
@@ -146,7 +146,7 @@
"Zürich, Switzerland",
"London, England"
],
- "correct_answer": 4
+ "correct_answer": 3
},
{
"question": "On average, how many eggs does a hen lay in a year?",
@@ -156,7 +156,7 @@
"Between 300-330",
"Between 370-400"
],
- "correct_answer": 2
+ "correct_answer": 1
},
{
"question": "What determines the colour of an egg yolk?",
@@ -166,7 +166,7 @@
"The diet of a hen",
"The colour of a hen's feathers"
],
- "correct_answer": 3
+ "correct_answer": 2
},
{
"question": "What country produces the most eggs in a year?",
@@ -176,6 +176,6 @@
"The United States",
"Japan"
],
- "correct_answer": 1
+ "correct_answer": 0
}
] \ No newline at end of file
diff --git a/bot/seasons/easter/egghead_quiz.py b/bot/seasons/easter/egghead_quiz.py
index 056aedf8..8dd2c21d 100644
--- a/bot/seasons/easter/egghead_quiz.py
+++ b/bot/seasons/easter/egghead_quiz.py
@@ -22,7 +22,9 @@ EMOJIS = [
'\U0001f1f5', '\U0001f1f6', '\U0001f1f7', '\U0001f1f8', '\U0001f1f9',
'\U0001f1fa', '\U0001f1fb', '\U0001f1fc', '\U0001f1fd', '\U0001f1fe',
'\U0001f1ff'
-]
+] # Regional Indicators A-Z (used for voting)
+
+TIMELIMIT = 30
class EggheadQuiz(commands.Cog):
@@ -43,11 +45,12 @@ class EggheadQuiz(commands.Cog):
random_question = random.choice(EGGHEAD_QUESTIONS)
question, answers = random_question["question"], random_question["answers"]
answers = [(EMOJIS[i], a) for i, a in enumerate(answers)]
- correct = EMOJIS[random_question["correct_answer"]-1]
+ correct = EMOJIS[random_question["correct_answer"]]
valid_emojis = [emoji for emoji, _ in answers]
- description = "\n".join([f"{emoji} -> **{answer}**" for emoji, answer in answers])
+ description = f"You have {TIMELIMIT} seconds to vote.\n\n"
+ description += "\n".join([f"{emoji} -> **{answer}**" for emoji, answer in answers])
q_embed = discord.Embed(title=question, description=description, colour=Colours.pink)
@@ -57,11 +60,11 @@ class EggheadQuiz(commands.Cog):
self.quiz_messages[msg.id] = valid_emojis
- await asyncio.sleep(30)
+ await asyncio.sleep(TIMELIMIT)
del self.quiz_messages[msg.id]
- msg = await ctx.channel.get_message(msg.id) # Refreshes message
+ msg = await ctx.channel.fetch_message(msg.id) # Refreshes message
total_no = sum([len(await r.users().flatten()) for r in msg.reactions]) - len(valid_emojis) # - bot's reactions