Package com.github.ygimenez.model
Class PaginationEventWrapper
java.lang.Object
com.github.ygimenez.model.PaginationEventWrapper
Wrapper for library events containing necessary data for handling.
-
Constructor Summary
ConstructorsConstructorDescriptionPaginationEventWrapper(Object source, net.dv8tion.jda.api.entities.User user, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, String messageId, Object content, boolean isFromGuild)Constructs a newPaginationEventWrapperinstance. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the button which triggered the event.Retrieves theMessageID.Retrieves source event.net.dv8tion.jda.api.entities.UsergetUser()Retrieves theUserwho pressed the button.booleanRetrieves whether the event happened in a guild or not.net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Message>Fetch theMessagefrom the event'sMessageID.
-
Constructor Details
-
PaginationEventWrapper
public PaginationEventWrapper(Object source, net.dv8tion.jda.api.entities.User user, net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, String messageId, Object content, boolean isFromGuild)Constructs a newPaginationEventWrapperinstance. You probably shouldn't be creating one yourself.- Parameters:
source- The source event, will be either aGenericMessageReactionEventor aButtonInteractionEvent.user- TheUserwho triggered the event.channel- TheMessageChannelwhere the event happened.messageId- TheMessageID.content- The button which was pressed, will be either aMessageReactionor aButton.isFromGuild- Whether the event happened on aGuildor not.
-
-
Method Details
-
getSource
Retrieves source event.- Returns:
- The source event.
-
getUser
public net.dv8tion.jda.api.entities.User getUser()Retrieves theUserwho pressed the button.- Returns:
- The
Userwho pressed the button.
-
getMessageId
Retrieves theMessageID.- Returns:
- The
MessageID.
-
retrieveMessage
public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Message> retrieveMessage()Fetch theMessagefrom the event'sMessageID.- Returns:
- The
RestActionfor retrieving theMessage.
-
getContent
Retrieves the button which triggered the event.- Returns:
- The button which triggered the event.
-
isFromGuild
public boolean isFromGuild()Retrieves whether the event happened in a guild or not.- Returns:
- Whether the event happened in a guild or not.
-