aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/challenges.py
diff options
context:
space:
mode:
authorGravatar Robin <[email protected]>2023-03-03 12:08:22 -0600
committerGravatar GitHub <[email protected]>2023-03-03 12:08:22 -0600
commite38e090e9c0822c4e019273a979e434e4406ef6a (patch)
tree882f1ebf82aa53a5cbd4544203802118c844cd42 /bot/exts/utilities/challenges.py
parentMerge branch 'python-discord:main' into undeprecate-bookmark (diff)
parentfixed embed interaction and randomly choosing a kata (#1218) (diff)
Merge branch 'main' into undeprecate-bookmark
Diffstat (limited to 'bot/exts/utilities/challenges.py')
-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]