summary refs log tree commit diff stats
path: root/components
diff options
context:
space:
mode:
authorsuhas <hi@suhas.one>2023-11-21 19:14:37 -0600
committersuhas <hi@suhas.one>2023-11-21 19:14:37 -0600
commit452a79d4dc567290ca94989ec5c6588374f9e572 (patch)
treed8d47813ef36e3b222c3c2de283ab323941c51ee /components
parentd58d72a84eecd4754a5ed00d765b2f470ff6b5db (diff)
downloadqbb-452a79d4dc567290ca94989ec5c6588374f9e572.tar.gz
wrong answer shaming :troll:
Diffstat (limited to 'components')
-rw-r--r--components/AnswerModal.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/components/AnswerModal.py b/components/AnswerModal.py
index 384835e..bc74272 100644
--- a/components/AnswerModal.py
+++ b/components/AnswerModal.py
@@ -39,9 +39,9 @@ class Answer(Modal, title="Submit Answer"):
             e.color = Color.green()
             e.title = '[CORRECT!] Random Tossup'
             e.description = ".".join(self.view.tossup['sentences'][0:self.view.i+1]) + " **(BUZZ)** " + ".".join(self.view.tossup['sentences'][self.view.i+1:])
-            e.add_field(name='Your answer', value=self.answer.value)
-            e.add_field(name='Official answer', value=self.view.tossup['answer'])
-            e.add_field(name='Answered by', value=interaction.user.mention)
+            e.add_field(name='Correct answer', value=self.answer.value, inline=True)
+            e.add_field(name='Official answer', value=self.view.tossup['answer'], inline=True)
+            e.add_field(name='Answered by', value=interaction.user.mention, inline=True)
             items = self.view.children
             for item in items:
                 if isinstance(item, Button):
@@ -59,8 +59,13 @@ class Answer(Modal, title="Submit Answer"):
         elif answer_check_data['directive'] == 'prompt':
             await interaction.response.send_message("Prompt! Try answering the question again", ephemeral=True)
         else:
-            await interaction.response.send_message(f"Incorrect! You've been locked out from the question. The correct answer was {self.view.tossup['answer']}", ephemeral=True)
+            if interaction.message is None:
+                return
+            e = interaction.message.embeds[0]
             self.view.already_answered.append(interaction.user.id)
+            e.add_field(name="Incorrect answer", value=self.answer.value, inline=False)
+            await interaction.response.edit_message(embed=e)
+            await interaction.followup.send(f"Incorrect! You've been locked out from the question. The correct answer was {self.view.tossup['answer']}", ephemeral=True)
             await db.user.upsert(
                 where={'id': interaction.user.id},
                 data={