mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-03-07 12:48:35 -05:00
Handle UIB interactions for ignoring channels. (#6503)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com> Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
@@ -819,6 +819,9 @@ class Red(
|
||||
Whether or not the message is eligible to be treated as a command.
|
||||
"""
|
||||
|
||||
# NOTE: any changes to implementation here may need to be made
|
||||
# in the `RedTree.interaction_check` as well
|
||||
|
||||
channel = message.channel
|
||||
guild = message.guild
|
||||
|
||||
@@ -911,7 +914,18 @@ class Red(
|
||||
return True
|
||||
|
||||
if isinstance(ctx.channel, discord.Thread):
|
||||
channel = ctx.channel.parent
|
||||
if isinstance(ctx, discord.Interaction) and ctx.is_user_integration():
|
||||
ctx: discord.Interaction
|
||||
# This is a user installed interaction, and thus... We're doomed!
|
||||
# We must mock an object because we don't have the channel cached,
|
||||
# and we are unable to fetch a full channel from the interaction
|
||||
# #BlameDiscord, See Red#6501 for more details.
|
||||
|
||||
# LIMITATIONS: Due the fact that we don't know the categories either as they aren't...
|
||||
# communicated in the interaction, we can't check for category ignores.
|
||||
channel = discord.Object(id=ctx.channel.parent_id)
|
||||
else:
|
||||
channel = ctx.channel.parent
|
||||
thread = ctx.channel
|
||||
else:
|
||||
channel = ctx.channel
|
||||
|
||||
Reference in New Issue
Block a user