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

Fix permissions fetching for User Installable Bots #6457

Merged
merged 8 commits into from
Dec 24, 2024
7 changes: 6 additions & 1 deletion redbot/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +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
perms = ctx.channel.permissions_for(author)
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
Loading