-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
commands.bot_has_permissions doesn't work for slash or bridge commands in dms #1421
Closed
3 tasks done
Labels
bug
Something isn't working
Comments
This appears to stem to another issue where dm channels will always appear as partial messagables |
Lulalaby
added
bug
Something isn't working
and removed
unconfirmed bug
A bug report that needs triaging
labels
Jun 30, 2022
the issue didn't fix its now occuring on line 2119! Traceback:
File "/bot-dir/venv/lib/python3.10/site-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/bot-dir/venv/lib/python3.10/site-packages/discord/bot.py", line 1044, in on_interaction
await self.process_application_commands(interaction)
File "/bot-dir/venv/lib/python3.10/site-packages/discord/bot.py", line 736, in process_application_commands
await self.invoke_application_command(ctx)
File "/bot-dir/venv/lib/python3.10/site-packages/discord/bot.py", line 992, in invoke_application_command
await ctx.command.invoke(ctx)
File "/bot-dir/venv/lib/python3.10/site-packages/discord/commands/core.py", line 355, in invoke
await self.prepare(ctx)
File "/bot-dir/venv/lib/python3.10/site-packages/discord/commands/core.py", line 277, in prepare
if not await self.can_run(ctx):
File "/bot-dir/venv/lib/python3.10/site-packages/discord/commands/core.py", line 374, in can_run
return await async_all(predicate(ctx) for predicate in predicates) # type: ignore
File "/bot-dir/venv/lib/python3.10/site-packages/discord/utils.py", line 562, in async_all
for elem in gen:
File "/bot-dir/venv/lib/python3.10/site-packages/discord/commands/core.py", line 374, in <genexpr>
return await async_all(predicate(ctx) for predicate in predicates) # type: ignore
File "/bot-dir/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 2119, in predicate
permissions = ch.permissions_for(ctx.author) # type: ignore also environment changed slightly since full pycord release and 3.10.5
|
Why not use |
does it work with bridge commands? |
is there a bot_has_permissions equivalent? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
bot_has_permissions
works fine for prefix commands in dms but throws an error when using slash commands or bridge commandsReproduction Steps
create a slash command or bridge command
note: this was in a cog (not sure if it occurs otherwise)
use the
bot_has_permissions
checktry running the command in dms
Minimal Reproducible Code
Expected Results
correctly invoke the command and not throw an error like a prefix command usually does.
Actual Results
throws an error from
/lib-dir/ext/commands/core.py
on line 2082AttributeError: 'PartialMessageable' object has no attribute 'permissions_for'.
Intents
all
System Information
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: