Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allowed_mentions to ping messages #187

Merged
merged 2 commits into from
Dec 23, 2023
Merged
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
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