Skip to content

Commit

Permalink
Merge branch 'master' into feat/version/3.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Skelmis authored Apr 20, 2024
2 parents c05e395 + bdeb22a commit 1b0eb07
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
- [ ] Guild config method names aren't duplicated
- [ ] New localizations have been added
- [ ] Documentation on ``docs.suggestions.gg`` has been updated
- [ ] Do these changes make sure not to expose anonymous suggestion authors?
- [ ] Do these changes have the correct default discord permissions setup?
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
aiodns==3.0.0
aiohttp==3.8.1
aiosignal==1.2.0
alaric==1.2.0
anyio==4.2.0
Expand Down
5 changes: 4 additions & 1 deletion suggestions/cogs/blacklist_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def __init__(self, bot):
self.bot: SuggestionsBot = bot
self.state: State = self.bot.state

@commands.slash_command()
@commands.slash_command(
dm_permission=False,
default_member_permissions=disnake.Permissions(manage_guild=True),
)
async def user(self, interaction: disnake.GuildCommandInteraction): ...

@user.sub_command_group()
Expand Down
12 changes: 10 additions & 2 deletions suggestions/cogs/suggestions_message_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def __init__(self, bot: SuggestionsBot):
self.state: State = self.bot.state
self.stats: Stats = self.bot.stats

@commands.message_command(name="Approve suggestion")
@commands.message_command(
name="Approve suggestion",
dm_permission=False,
default_member_permissions=disnake.Permissions(manage_guild=True),
)
@cooldowns.cooldown(1, 3, bucket=InteractionBucket.author)
@checks.ensure_guild_has_logs_channel_or_keep_logs()
async def approve_suggestion(self, interaction: disnake.GuildCommandInteraction):
Expand Down Expand Up @@ -71,7 +75,11 @@ async def approve_suggestion(self, interaction: disnake.GuildCommandInteraction)
self.stats.type.APPROVE_BY_MESSAGE_COMMAND,
)

@commands.message_command(name="Reject suggestion")
@commands.message_command(
name="Reject suggestion",
dm_permission=False,
default_member_permissions=disnake.Permissions(manage_guild=True),
)
@cooldowns.cooldown(1, 3, bucket=InteractionBucket.author)
@checks.ensure_guild_has_logs_channel_or_keep_logs()
async def reject_suggestion(self, interaction: disnake.GuildCommandInteraction):
Expand Down
2 changes: 1 addition & 1 deletion suggestions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ConflictingHandlerInformation(disnake.DiscordException):
class InvalidFileType(disnake.DiscordException):
"""The file you attempted to upload is not allowed."""


class SuggestionSecurityViolation(disnake.DiscordException):
"""A security violation occurred."""

Expand Down
4 changes: 4 additions & 0 deletions suggestions/objects/suggestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,10 @@ async def create_thread(self, message: disnake.Message, *, ih: InteractionHandle
thread = await message.create_thread(
name=f"Thread for suggestion {self.suggestion_id}"
)
if self.is_anonymous:
# Dont expose the anon author
return

try:
await thread.send(
ih.bot.get_localized_string(
Expand Down

0 comments on commit 1b0eb07

Please sign in to comment.