Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cogs/codebuddy_quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ async def leaderboard(self, interaction: discord.Interaction):
print(f"[Unexpected error in leaderboard command]: {e}")
try:
if not interaction.response.is_done():
await interaction.response.send_message("Error fetching leaderboard.", ephemeral=True)
await interaction.response.send_message("Failed to load the leaderboard. Please try again in a moment.", ephemeral=True)
else:
try:
await interaction.edit_original_response(content=" Error fetching leaderboard.")
await interaction.edit_original_response(content="Failed to load the leaderboard. Please try again in a moment.")
except discord.NotFound:
pass
except Exception:
Expand Down Expand Up @@ -332,7 +332,7 @@ async def codeleaderboard_prefix(self, ctx):

except Exception as e:
print(f"[Unexpected error in codeleaderboard command]: {e}")
await ctx.send(" Error fetching leaderboard.")
await ctx.send("Failed to load the leaderboard. Please try again in a moment.")

@app_commands.command(name="codestats", description="Show your personal coding quiz stats.")
async def codestats(self, interaction: discord.Interaction):
Expand All @@ -344,7 +344,7 @@ async def codestats(self, interaction: discord.Interaction):
gap, higher_id = await get_score_gap(user_id)
except Exception as e:
print(f"[Error fetching user stats]: {e}")
await interaction.response.send_message("Error fetching your stats.", ephemeral=True)
await interaction.response.send_message("Failed to load your stats. Please try again in a moment.", ephemeral=True)
return

# Haupt-Embed
Expand Down Expand Up @@ -372,7 +372,7 @@ async def codestats(self, interaction: discord.Interaction):
except Exception as e:
print(f"[Unexpected error in codestats command]: {e}")
try:
await interaction.response.send_message("Error displaying your stats.", ephemeral=True)
await interaction.response.send_message("Failed to load your stats. Please try again in a moment.", ephemeral=True)
except Exception:
pass

Expand All @@ -387,7 +387,7 @@ async def codestats_prefix(self, ctx):
gap, higher_id = await get_score_gap(user_id)
except Exception as e:
print(f"[Error fetching user stats]: {e}")
await ctx.send("Error fetching your stats.")
await ctx.send("Failed to load your stats. Please try again in a moment.")
return

# Haupt-Embed
Expand All @@ -414,7 +414,7 @@ async def codestats_prefix(self, ctx):

except Exception as e:
print(f"[Unexpected error in codestats command]: {e}")
await ctx.send("Error displaying your stats.")
await ctx.send("Failed to load your stats. Please try again in a moment.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it counts as a contribution I approve this.



Expand Down
Loading