aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Henri <[email protected]>2023-03-03 08:42:08 +0100
committerGravatar GitHub <[email protected]>2023-03-03 07:42:08 +0000
commit3e244cc54c8786896e9b3a3f6344d0205f4b4c17 (patch)
tree7a262d4e0cd716581802c6355eba0c0aae447b18
parentBump pre-commit from 3.1.0 to 3.1.1 (#1221) (diff)
fixed embed interaction and randomly choosing a kata (#1218)
Co-authored-by: Xithrius <[email protected]>
-rw-r--r--bot/exts/utilities/challenges.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/bot/exts/utilities/challenges.py b/bot/exts/utilities/challenges.py
index 54e57212..46bc0fae 100644
--- a/bot/exts/utilities/challenges.py
+++ b/bot/exts/utilities/challenges.py
@@ -84,6 +84,7 @@ class InformationDropdown(ui.Select):
# The attribute is not set during initialization.
result_embed = self.mapping_of_embeds[self.values[0]]
await self.original_message.edit(embed=result_embed)
+ await interaction.response.defer()
class Challenges(commands.Cog):
@@ -122,12 +123,8 @@ class Challenges(commands.Cog):
if not first_kata_div:
raise commands.BadArgument("No katas could be found with the filters provided.")
- elif len(first_kata_div) >= 3:
- first_kata_div = choice(first_kata_div[:3])
- elif "q=" not in search_link:
- first_kata_div = choice(first_kata_div)
else:
- first_kata_div = first_kata_div[0]
+ first_kata_div = choice(first_kata_div)
# There are numerous divs before arriving at the id of the kata, which can be used for the link.
first_kata_id = first_kata_div.a["href"].split("/")[-1]