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: Adding reactions to interaction response in menu pages #41

Closed DenverCoder1 closed 2 years ago

DenverCoder1 commented 2 years ago

If there are reaction buttons, the full InteractionMessage must be fetched when send returns a PartialInteractionMessage.

PartialInteractionMessage does not support add_reactions, so it should not be returned when self.buttons contains elements.

This was working prior to nextcord 2.0.0b1 due to a statement that was intended to be future-proof:

message = await self.interaction.send(ephemeral=self.ephemeral, **kwargs)
return message or await self.interaction.original_message()

As prior to 2.0.0b1, message would always be None, this worked fine. When using nextcord 2.0.0b1 or later, this does not work for reaction menus.

BREAKING CHANGE

As this module now uses nextcord.PartialInteractionMessage in type checks, nextcord >= 2.0.0b1 is now required to run the module. When using 2.0.0a10 or earlier, there will be an error, module 'nextcord' has no attribute 'PartialInteractionMessage'.

Checklist