You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm recently migrating my Discord bot from discord.py==2.0 to disnake and I've been reading through code snippets and examples of migrated code. However, one thing that I stumbled upon is disnake.ApplicationCommandInteraction which has been used for examples inside the library. How is this different from the pre-existing disnake.Interaction class?
disnake.Interaction is the base interaction class and allows disnake to create subclasses of that so that the specific subclasses have their own relevant features. For instance, disnake.GuildCommandInteraction would be a subclass of disnake.Interaction, but have guild-specific features, for example, inter.guild would never be typed as Guild | None, because it would be None if this is in a DM.
Therefore, disnake.ApplicationCommandInteraction would have the application command-specific attributes, whereas disnake.Interaction would lack that, as it's mainly just a base class for all these other instances like ApplicationCommandInteraction, MessageInteraction, GuildCommandInteraction, UserCommandInteraction, and so much more :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! I'm recently migrating my Discord bot from
discord.py==2.0
todisnake
and I've been reading through code snippets and examples of migrated code. However, one thing that I stumbled upon isdisnake.ApplicationCommandInteraction
which has been used for examples inside the library. How is this different from the pre-existingdisnake.Interaction
class?Beta Was this translation helpful? Give feedback.
All reactions