Skip to content

Commit

Permalink
Update redbot/core/bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen authored Dec 24, 2024
1 parent a115b7d commit e8646a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions redbot/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,12 @@ async def ignored_channel_or_guild(
if ctx.channel.type is not discord.ChannelType.private:
raise TypeError("Can't check permissions for non-private PartialMessageable.")
is_private = True
if isinstance(ctx, discord.Interaction):
ctx: discord.Interaction
perms = ctx.permissions
# The permissions here are always linked to the interaction author &
# the channel it originated from.
else:
if isinstance(ctx, discord.Message):
perms = ctx.channel.permissions_for(author)
else:
# `permissions` attribute will use permissions from the interaction when possible,
# or `ctx.channel.permissions_for(author)` for non-interaction contexts.
perms = ctx.permissions
surpass_ignore = (
is_private
or perms.manage_guild
Expand Down

0 comments on commit e8646a7

Please # to comment.