Skip to content

Add specialized "target" getters in context interactions #2869

@freya022

Description

@freya022

General Troubleshooting

  • I have checked for similar issues on the Issue-tracker.
  • I have updated to the latest JDA version
  • I have checked the branches or the maintainers' PRs for upcoming features.

Feature Request

For discoverability purposes, JDA should have MessageContextInteraction#getTargetMessage() and UserContextInteraction#getTargetUser(), which are the same as getTarget().

It will especially help for UserContextInteraction as it inherits getUser() from Interaction, which is NOT the same as getTarget

Example Use-Case

public void onGetUserAvatar(UserContextInteractionEvent event) {
    final var user = event.getTargetUser(); // same as: event.getTarget()

    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions