From e8646a7dcbed3db686b7e07eefa68f9b1a1738fc Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 24 Dec 2024 04:10:24 +0100 Subject: [PATCH] Update redbot/core/bot.py --- redbot/core/bot.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index e2f9d177358..7b6d731fb81 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -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