Skip to content

Commit

Permalink
Add allowed_mentions to ping messages (#187)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Brown <[email protected]>
  • Loading branch information
JamesDearlove and andrewj-brown authored Dec 23, 2023
1 parent 3cc856b commit d96efb1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions uqcsbot/advent.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,21 @@ async def reminder_fifteen_minutes(self):
The function used within the AOC reminder 15 minutes before each challenge starts.
"""
await self.channel.send(
f"{self.role.mention}Today's Advent of Code puzzle is released in 15 minutes."
f"{self.role.mention} Today's Advent of Code puzzle is released in 15 minutes.",
allowed_mentions=discord.AllowedMentions(
everyone=False, users=False, roles=True
),
)

async def reminder_released(self):
"""
The function used within the AOC reminder when each challenge starts.
"""
await self.channel.send(
f"{self.role.mention}Today's Advent of Code puzzle has been released. Good luck!"
f"{self.role.mention} Today's Advent of Code puzzle has been released. Good luck!",
allowed_mentions=discord.AllowedMentions(
everyone=False, users=False, roles=True
),
)

def _get_previous_winner_aoc_ids(self, year: int) -> List[int]:
Expand Down Expand Up @@ -962,7 +968,10 @@ async def add_winners_command(
winners_message += " and "

await interaction.edit_original_response(
content=f"The results are in! Out of {number_of_potential_winners} potential participants, {winners_message} have recieved a prize from participating in Advent of Code: {prize}"
content=f"The results are in! Out of {number_of_potential_winners} potential participants, {winners_message} have recieved a prize from participating in Advent of Code: {prize}",
allowed_mentions=discord.AllowedMentions(
everyone=False, users=True, roles=False
),
)

@app_commands.checks.has_permissions(manage_guild=True)
Expand Down

0 comments on commit d96efb1

Please sign in to comment.