Class GenericMessageReactionEvent

    • Constructor Detail

      • GenericMessageReactionEvent

        public GenericMessageReactionEvent​(@Nonnull
                                           JDA api,
                                           long responseNumber,
                                           @Nullable
                                           User user,
                                           @Nullable
                                           Member member,
                                           @Nonnull
                                           MessageReaction reaction,
                                           long userId)
    • Method Detail

      • getUserId

        @Nonnull
        public java.lang.String getUserId()
        The id for the user who owns the reaction.
        Returns:
        The user id
      • getUserIdLong

        public long getUserIdLong()
        The id for the user who owns reaction.
        Returns:
        The user id
      • getUser

        @Nullable
        public User getUser()
        The reacting User
        This might be missing if the user was not cached. Use retrieveUser() to load the user.
        Returns:
        The reacting user or null if this information is missing
      • retrieveUser

        @Nonnull
        @CheckReturnValue
        public RestAction<User> retrieveUser()
        Retrieves the User who owns the reaction.
        If a user is known, this will return getUser().
        Returns:
        RestAction - Type: User
        Since:
        4.2.1
      • retrieveMember

        @Nonnull
        @CheckReturnValue
        public RestAction<Member> retrieveMember()
        Retrieves the Member who owns the reaction.
        If a member is known, this will return getMember().

        Note that banning a member will also fire MessageReactionRemoveEvent and no member will be available in those cases. An UNKNOWN_MEMBER error response should be the failure result.

        Returns:
        RestAction - Type: Member
        Throws:
        java.lang.IllegalStateException - If this event is not from a guild
        Since:
        4.2.1
      • retrieveMessage

        @Nonnull
        @CheckReturnValue
        public RestAction<Message> retrieveMessage()
        Retrieves the message for this reaction event.
        Simple shortcut for getChannel().retrieveMessageById(getMessageId()).

        The Message.getMember() method will always return null for the resulting message. To retrieve the member you can use getGuild().retrieveMember(message.getAuthor()).

        Returns:
        RestAction - Type: Message
        Since:
        4.2.1