Skip to content

Commit

Permalink
slightly improve register messages
Browse files Browse the repository at this point in the history
still not ephemeral, because it's probably useful to see if people
are having problems with the command.
  • Loading branch information
katrinafyi committed Dec 1, 2024
1 parent 344c0f6 commit 5e16939
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions uqcsbot/advent.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,10 @@ async def register_command(self, interaction: discord.Interaction, aoc_name: str
members = self._get_members(year)
if aoc_name not in [member.name for member in members]:
await interaction.edit_original_response(
content=f"Could not find the Advent of Code name `{aoc_name}` within the UQCS leaderboard."
content=(
f"Could not find the Advent of Code name `{aoc_name}` within the UQCS leaderboard. Make sure your name appears at: "
+ LEADERBOARD_VIEW_URL.format(code=UQCS_LEADERBOARD, year=year)
)
)
return
member = [member for member in members if member.name == aoc_name]
Expand All @@ -687,13 +690,17 @@ async def register_command(self, interaction: discord.Interaction, aoc_name: str
)
if query is not None:
discord_user = self.bot.uqcs_server.get_member(query.discord_userid)
is_self = False
if discord_user:
discord_ping = discord_user.mention
is_self = discord_user.id == interaction.user.id
else:
discord_ping = f"someone who doesn't seem to be in the server (discord id = {query.discord_userid})"
await interaction.edit_original_response(
content=f"Advent of Code name `{aoc_name}` is already registered to {discord_ping}. Please contact committee if this is your Advent of Code name."
)
if not is_self:
message = f"Advent of Code name `{aoc_name}` is already registered to {discord_ping}. Please contact committee if this is your Advent of Code name."
else:
message = f"Advent of Code name `{aoc_name}` is already registered to you ({discord_ping})! Please contact committee if this is incorrect."
await interaction.edit_original_response(content=message)
return

discord_id = interaction.user.id
Expand Down

0 comments on commit 5e16939

Please sign in to comment.