-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Handle UIB interactions for ignoring channels. #6503
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
base: V3/develop
Are you sure you want to change the base?
Handle UIB interactions for ignoring channels. #6503
Conversation
Fixes the issues for pure app commands, but there is still a remaining error for hybrids in particular. Not sure if we want to just fix that here, or if we want to save that for another PR. File "venv\lib\site-packages\redbot\core\_global_checks.py", line 8, in check_message_is_eligible_as_command
return await ctx.bot.message_eligible_as_command(ctx.message)
File "venv\lib\site-packages\redbot\core\bot.py", line 844, in message_eligible_as_command
if not can_user_send_messages_in(guild.me, channel):
File "venv\lib\site-packages\redbot\core\utils\__init__.py", line 724, in can_user_send_messages_in
perms = channel.permissions_for(obj)
File "venv\lib\site-packages\discord\threads.py", line 425, in permissions_for
raise ClientException('Parent channel not found')
discord.errors.ClientException: Parent channel not found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only really concerned about proper documentation here - there used to be just one flow that everything went through. Now that we continue to have to fix things for various interactions and the implementation is split between different places, it would be good to inform the code reader about the traps - see the review comment for a specific suggestion.
It might also be worth updating help text / messages from the [p]ignore
command such that the user knows that the category ignores won't apply to user-installed commands.
if ctx.interaction is not None: | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a comment here and possibly also in Red.message_eligible_as_command
so that we don't introduce discrepancies when changing the logic in the future:
if ctx.interaction is not None: | |
return True | |
if ctx.interaction is not None: | |
# equivalent checks are performed by `RedTree.interaction_check` | |
return True |
Description of the changes
Fixes #6501, this PR handles User Installed Bot interactions where they will error out on trying to check from Threads, as it cannot get the channels it need. Furthermore, this handling like this will NOT check for categories, as the bot cannot gather those from a context where it can only get information from the interaction. Tough luck...
Have the changes in this PR been tested?
Yes, but only internally, this must be tested by trying to reproduce the original error from #6501