Class MentionPaginationAction

  • All Implemented Interfaces:
    java.lang.Iterable<Message>

    public class MentionPaginationAction
    extends PaginationAction<Message,​MentionPaginationAction>
    PaginationAction that paginates the endpoint Route.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 - 100

    Example

    
     MentionPaginationAction mentions = guild.getRecentMentions();
     mentions.setEveryone(false);
     for (Message message : mentions)
     {
         System.out.printf("%#s: %s\n", message.getAuthor(), message.getContent());
     }
     
    Since:
    3.0
    • Constructor Detail

      • MentionPaginationAction

        public MentionPaginationAction​(Guild guild)
        Creates a new MentionPaginationAction
        This constructor effectively makes this target specifically only the recent mentions for the specified Guild!
        To get the global scope use MentionPaginationAction(net.dv8tion.jda.core.JDA) instead.
        Parameters:
        guild - The Non-Null target Guild
        Throws:
        java.lang.NullPointerException - If the provided guild is null
    • Method Detail

      • getGuild

        public Guild getGuild()
        The current target Guild for this MentionPaginationAction.
        This can be null 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