nextcord / nextcord-ext-menus

A nextcord menu and pagination extension that makes working with reaction menus and button component menus a bit easier
https://menus.docs.nextcord.dev
MIT License
26 stars 9 forks source link

fix: Permissions error with interaction menus in DM channels #57

Closed DenverCoder1 closed 1 year ago

DenverCoder1 commented 1 year ago

Summary

Fixes https://discord.com/channels/881118111967883295/1132658144133255178 (#ext-menus (deesiigneer#0))

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