Class MentionPaginationAction
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<java.util.List<T>>
-
- net.dv8tion.jda.core.requests.restaction.pagination.PaginationAction<Message,MentionPaginationAction>
-
- net.dv8tion.jda.client.requests.restaction.pagination.MentionPaginationAction
-
- All Implemented Interfaces:
java.lang.Iterable<Message>
public class MentionPaginationAction extends PaginationAction<Message,MentionPaginationAction>
PaginationAction
that paginates the endpointRoute.Self.GET_RECENT_MENTIONS
.Must provide not-null
Guild
to compile a valid guild mentions pagination route., else it uses the global pagination route.Limits:
Minimum - 1
Maximum - 100Example
MentionPaginationAction mentions = guild.getRecentMentions(); mentions.setEveryone(false); for (Message message : mentions) { System.out.printf("%#s: %s\n", message.getAuthor(), message.getContent()); }
- Since:
- 3.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.restaction.pagination.PaginationAction
PaginationAction.PaginationIterator
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.RestAction
RestAction.EmptyRestAction<T>
-
-
Field Summary
-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description MentionPaginationAction(Guild guild)
Creates a new MentionPaginationAction
This constructor effectively makes this target specifically only the recent mentions for the specifiedGuild
!
To get the global scope useMentionPaginationAction(net.dv8tion.jda.core.JDA)
instead.MentionPaginationAction(JDA api)
Creates a new MentionPaginationAction
This constructor effectively makes this target all recent mentions to get the recent mentions for a specificGuild
useMentionPaginationAction(net.dv8tion.jda.core.entities.Guild)
instead!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Guild
getGuild()
The current targetGuild
for this MentionPaginationAction.MentionPaginationAction
setEveryone(boolean isEveryoneMention)
Sets whether this MentionPaginationAction should include mentions that mention the public role of a Guild.MentionPaginationAction
setRole(boolean isRoleMention)
Sets whether this MentionPaginationAction should include mentions that mention a role in a Guild.-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.pagination.PaginationAction
cache, cacheSize, forEachAsync, forEachAsync, forEachRemaining, forEachRemainingAsync, forEachRemainingAsync, getCached, getFirst, getLast, getLimit, getMaxLimit, getMinLimit, isCacheEnabled, isEmpty, iterator, limit, parallelStream, setCheck, spliterator, stream, takeAsync, takeRemainingAsync
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Constructor Detail
-
MentionPaginationAction
public MentionPaginationAction(JDA api)
Creates a new MentionPaginationAction
This constructor effectively makes this target all recent mentions to get the recent mentions for a specificGuild
useMentionPaginationAction(net.dv8tion.jda.core.entities.Guild)
instead!- Parameters:
api
- The current JDA entity
-
MentionPaginationAction
public MentionPaginationAction(Guild guild)
Creates a new MentionPaginationAction
This constructor effectively makes this target specifically only the recent mentions for the specifiedGuild
!
To get the global scope useMentionPaginationAction(net.dv8tion.jda.core.JDA)
instead.- Parameters:
guild
- The Non-Null targetGuild
- Throws:
java.lang.NullPointerException
- If the providedguild
isnull
-
-
Method Detail
-
getGuild
public Guild getGuild()
The current targetGuild
for this MentionPaginationAction.
This can benull
if this MentionPaginationAction does not target mentions from a specific Guild!- Returns:
- Possibly-null target Guild
-
setEveryone
public MentionPaginationAction setEveryone(boolean isEveryoneMention)
Sets whether this MentionPaginationAction should include mentions that mention the public role of a Guild.
Default:true
- Parameters:
isEveryoneMention
- Whether to include everyone mentions- Returns:
- The current MentionPaginationAction for chaining convenience
-
setRole
public MentionPaginationAction setRole(boolean isRoleMention)
Sets whether this MentionPaginationAction should include mentions that mention a role in a Guild.
Default:true
- Parameters:
isRoleMention
- Whether to include role mentions- Returns:
- The current MentionPaginationAction for chaining convenience
-
-