Package discord4j.core.shard
Interface MemberRequestFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A filter to customize the guild member request strategy. Applied on each GUILD_CREATE returning a potentially
delayed
Mono
that, if containing true
, guild members should be requested.
The following built-in factories exist:
all()
to use a filter requesting ALL members on startupnone()
to disable this featurewithLargeGuilds()
to only request from large guilds (default)withGuilds(Snowflake...)
to request from specific guilds
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MemberRequestFilter
Request members from all large guilds. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemberRequestFilter
all()
Request members from all guilds.apply
(discord4j.discordjson.json.GuildCreateData guildCreateData) default MemberRequestFilter
Transform this currentMemberRequestFilter
by applying the givenFunction
to derive a newMono
ofboolean
.static MemberRequestFilter
none()
Do not request guild members.static MemberRequestFilter
withGuilds
(Snowflake... guildIds) Request guild members for the given guildSnowflake
IDs.static MemberRequestFilter
Request members from large guilds.
-
Field Details
-
DEFAULT
Request members from all large guilds.
-
-
Method Details
-
all
Request members from all guilds.- Returns:
- a
MemberRequestFilter
requesting members from all guilds
-
none
Do not request guild members.- Returns:
- a
MemberRequestFilter
not requesting any member
-
withLargeGuilds
Request members from large guilds.- Returns:
- a
MemberRequestFilter
requesting members from large guilds
-
withGuilds
Request guild members for the given guildSnowflake
IDs.- Returns:
- a
MemberRequestFilter
requesting members from the given guilds
-
apply
Obtain aMono
ofBoolean
for the givenGuildCreateData
. If the resulting sequence containstrue
, then members will be requested through the Gateway for this guild.- Parameters:
guildCreateData
- the guild triggering this filter- Returns:
- a
Mono
indicating if a guild should have their members requested
-
as
Transform this currentMemberRequestFilter
by applying the givenFunction
to derive a newMono
ofboolean
.- Parameters:
transformer
- the function to transform thisMemberRequestFilter
- Returns:
- a transformed
MemberRequestFilter
-