Skip to content

Commit

Permalink
Add allowed_mentions to ping messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDearlove committed Dec 3, 2023
1 parent 5efdfa0 commit 1476053
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 1476053

Please sign in to comment.