Interface ChunkingFilter

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ChunkingFilter
Filter function for member chunking of guilds.
The filter decides based on the provided guild id whether chunking should be done on guild initialization.

To use chunking, the GUILD_MEMBERS intent must be enabled! Otherwise you must use NONE!

Since:
4.1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ChunkingFilter
    Chunk all guilds
    static final ChunkingFilter
    Do not chunk any guilds (lazy loading)
  • Method Summary

    Modifier and Type
    Method
    Description
    exclude(long... ids)
    Factory method to disable chunking for a blacklist of guild ids.
    boolean
    filter(long guildId)
    Decide whether the specified guild should chunk members.
    include(long... ids)
    Factory method to chunk a whitelist of guild ids.
  • Field Details

  • Method Details

    • filter

      boolean filter(long guildId)
      Decide whether the specified guild should chunk members.
      Parameters:
      guildId - The guild id
      Returns:
      True, if this guild should chunk
    • include

      @Nonnull static ChunkingFilter include(@Nonnull long... ids)
      Factory method to chunk a whitelist of guild ids.
      All guilds that are not mentioned will use lazy loading.

      This is useful to only chunk specific guilds like the hub server of a bot.

      Parameters:
      ids - The ids that should be chunked
      Returns:
      The resulting filter
    • exclude

      @Nonnull static ChunkingFilter exclude(@Nonnull long... ids)
      Factory method to disable chunking for a blacklist of guild ids.
      All guilds that are not mentioned will use chunking.

      This is useful when the bot is only in one very large server that takes most of its memory and should be ignored instead.

      Parameters:
      ids - The ids that should not be chunked
      Returns:
      The resulting filter