mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fix permissions fetching for User Installable Bots (#6457)
Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
parent
9392077434
commit
bd26e7d5af
@ -886,7 +886,12 @@ class Red(
|
|||||||
if ctx.channel.type is not discord.ChannelType.private:
|
if ctx.channel.type is not discord.ChannelType.private:
|
||||||
raise TypeError("Can't check permissions for non-private PartialMessageable.")
|
raise TypeError("Can't check permissions for non-private PartialMessageable.")
|
||||||
is_private = True
|
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 = (
|
surpass_ignore = (
|
||||||
is_private
|
is_private
|
||||||
or perms.manage_guild
|
or perms.manage_guild
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user