Interaction.channel is of type PartialMessageable when the channel is a DM channel which causes an error when trying to call channel.permissions_for(me).
To fix this, we can use interaction.app_permissions whenever it is available.
This also adds support for passing a PartialMessageable as the channel parameter by assuming all permissions.
Test package early with:
pip install git+https://github.com/nextcord/nextcord-ext-menus.git@0ff6f0b33955bf3231f734642dad617d9d494c18#egg=nextcord-ext-menus
Checklist
[x] If code changes were made then they have been tested.
[ ] I have updated the documentation to reflect the changes.
[x] I have run task pyright and fixed the relevant issues.
[x] This PR fixes an issue.
[ ] This PR adds something new (e.g. new method or parameters).
[ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] This PR is not a code change (e.g. documentation, README, ...)
Summary
Fixes https://discord.com/channels/881118111967883295/1132658144133255178 (
#ext-menus (deesiigneer#0)
)Interaction.channel
is of typePartialMessageable
when the channel is a DM channel which causes an error when trying to callchannel.permissions_for(me)
.To fix this, we can use
interaction.app_permissions
whenever it is available.This also adds support for passing a
PartialMessageable
as thechannel
parameter by assuming all permissions.Test package early with:
pip install git+https://github.com/nextcord/nextcord-ext-menus.git@0ff6f0b33955bf3231f734642dad617d9d494c18#egg=nextcord-ext-menus
Checklist
task pyright
and fixed the relevant issues.