discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Add command_id and custom_id attributes to Interaction

Open Soheab opened this issue 6 months ago • 0 comments

Summary

This PR adds the following attributes to Interaction for ease of access and type safety for people that want it:

  • command_id
  • custom_id

Both are from interaction.data and self-explanatory.

They are cached properties so they don’t exist unless used, and when they do, their values stay the same.

Checklist

  • [x] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
  • [ ] This PR fixes an issue.
  • [x] 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, ...)

Soheab avatar Sep 29 '25 17:09 Soheab