From d96efb13f5820c6f0a583a617da7ac77ac384bff Mon Sep 17 00:00:00 2001 From: James Dearlove <39483549+JamesDearlove@users.noreply.github.com> Date: Sat, 23 Dec 2023 22:50:42 +1000 Subject: [PATCH] Add allowed_mentions to ping messages (#187) Co-authored-by: Andrew Brown <92134285+andrewj-brown@users.noreply.github.com> --- uqcsbot/advent.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/uqcsbot/advent.py b/uqcsbot/advent.py index 92cdbdb..5f53d60 100644 --- a/uqcsbot/advent.py +++ b/uqcsbot/advent.py @@ -284,7 +284,10 @@ 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): @@ -292,7 +295,10 @@ 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]: @@ -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)