Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
MooshiMochi committed Mar 28, 2024
2 parents 51c41a9 + 53a3cf4 commit 186be3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

#### Consider supporting me on [Patreon](https://patreon.com/mooshi69) or [Ko-Fi](https://ko-fi.com/mooshi69)!

## // March 28th 2024

### Bug Fixes:

- Fixed failing permission check.

## // March 27th 2024

- Added EpsilonScan.fr (adult verison) to the bot.
Expand Down
7 changes: 3 additions & 4 deletions src/core/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ async def predicate(interaction: discord.Interaction) -> bool:
if not interaction.guild_id:
return True
member: discord.Member = interaction.guild.get_member(interaction.user.id)
if not member or member.guild_permissions < discord.Permissions(**perms):
missing_perms = check_missing_perms(member.guild_permissions, discord.Permissions(**perms))
missing_perms = check_missing_perms(member.guild_permissions, discord.Permissions(**perms))
if not member or missing_perms:
raise app_commands.MissingPermissions(missing_perms)
return True

Expand All @@ -45,8 +45,7 @@ async def predicate(interaction: discord.Interaction) -> bool:
# Check if the bot has the required permissions.
if not interaction.guild_id:
return True
if interaction.guild.me.guild_permissions < discord.Permissions(**perms):
missing_perms = check_missing_perms(interaction.guild.me.guild_permissions, discord.Permissions(**perms))
if missing_perms := check_missing_perms(interaction.guild.me.guild_permissions, discord.Permissions(**perms)):
raise app_commands.BotMissingPermissions(missing_perms)
return True

Expand Down

0 comments on commit 186be3e

Please sign in to comment.