Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: on_application_command event #961

Closed
wants to merge 4 commits into from

Conversation

MaskDuck
Copy link
Contributor

Summary

closes #958

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
    • I have run task pyright and fixed the relevant issues.
  • 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, ...)

@EmreTech EmreTech changed the title feat: application_command event feat: on_application_command event Dec 31, 2022
@EmreTech EmreTech added t: enhancement Type: enhancement - new feature or request p: low Priority: low - not important to be worked on s: awaiting review Status: the issue or PR is awaiting reviews labels Dec 31, 2022
docs/api.rst Outdated Show resolved Hide resolved
@@ -1374,6 +1374,8 @@ def parse_message_reaction_remove_emoji(self, data) -> None:

def parse_interaction_create(self, data) -> None:
interaction = self._get_client().get_interaction(data=data)
if data["type"] == 2: # application command
self.dispatch("application_command", interaction)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to provide the corresponding application command object with this event because Interaction.application_command hasn't been set at this point.

docs/api.rst Outdated Show resolved Hide resolved

.. versionadded:: 2.4

:param interaction: The interaction object containing the command information.
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I told you in a previous review comment, the interaction object at the time of dispatch doesn't actually contain the application command object.

Co-authored-by: Emre Terzioglu <50607143+EmreTech@users.noreply.github.com>
@MaskDuck
Copy link
Contributor Author

i do not have enough energy to continue this PR.

@MaskDuck MaskDuck closed this Mar 21, 2023
@EmreTech EmreTech removed the s: awaiting review Status: the issue or PR is awaiting reviews label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: low Priority: low - not important to be worked on t: enhancement Type: enhancement - new feature or request
Projects
No open projects
Status: Invalid/Closed
Development

Successfully merging this pull request may close these issues.

on_application_command event
2 participants