Skip to content

feat: Move ctx.respond to Interaction and implement Interaction.edit#2026

Merged
Lulalaby merged 5 commits intoPycord-Development:masterfrom
NeloBlivion:interaction_respond
Apr 25, 2023
Merged

feat: Move ctx.respond to Interaction and implement Interaction.edit#2026
Lulalaby merged 5 commits intoPycord-Development:masterfrom
NeloBlivion:interaction_respond

Conversation

@NeloBlivion
Copy link
Member

Summary

ctx.respond and ctx.edit have existed for a while now for convenient command responses, but the same can't be said for Interaction. This PR does the following:

  • ctx.respond is moved to Interaction; the ctx version now simply references self.interaction.respond
  • Interaction.edit is added as a shortcut for InteractionResponse.edit_message and Interaction.edit_original_response

Information

  • 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, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@NeloBlivion NeloBlivion requested a review from a team as a code owner April 24, 2023 20:56
@pullapprove4 pullapprove4 bot requested review from VincentRPS and plun1331 April 24, 2023 20:56
Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog

@Lulalaby Lulalaby added feature Implements a feature hold: changelog This pull request is missing a changelog entry labels Apr 25, 2023
@Lulalaby Lulalaby added priority: medium Medium Priority and removed hold: changelog This pull request is missing a changelog entry labels Apr 25, 2023
Lulalaby
Lulalaby previously approved these changes Apr 25, 2023
Signed-off-by: Lala Sabathil <lala@pycord.dev>
@Lulalaby
Copy link
Member

@NeloBlivion Unsure, but could it be that this is a breaking change?

@NeloBlivion
Copy link
Member Author

@NeloBlivion Unsure, but could it be that this is a breaking change?

Fortunately not, ctx.respond performs the exact same. We've already used the @property + copy_doc method in some other places in the library to essentially copy the same function to other classes.

@Lulalaby
Copy link
Member

oh interesting

@Lulalaby Lulalaby enabled auto-merge (squash) April 25, 2023 17:32
@Lulalaby Lulalaby merged commit 33d1744 into Pycord-Development:master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Implements a feature priority: medium Medium Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants