Package discord4j.core.retriever
Class FallbackEntityRetriever
- java.lang.Object
-
- discord4j.core.retriever.FallbackEntityRetriever
-
- All Implemented Interfaces:
EntityRetriever
public class FallbackEntityRetriever extends Object implements EntityRetriever
-
-
Constructor Summary
Constructors Constructor Description FallbackEntityRetriever(EntityRetriever first, EntityRetriever fallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Channel>getChannelById(Snowflake channelId)Requests to retrieve the channel represented by the supplied ID.Mono<Guild>getGuildById(Snowflake guildId)Requests to retrieve the guild represented by the supplied ID.Flux<GuildChannel>getGuildChannels(Snowflake guildId)Requests to retrieve the guild's channels.Mono<GuildEmoji>getGuildEmojiById(Snowflake guildId, Snowflake emojiId)Requests to retrieve the guild emoji represented by the supplied IDs.Flux<GuildEmoji>getGuildEmojis(Snowflake guildId)Requests to retrieve the guild's emojis.Flux<Member>getGuildMembers(Snowflake guildId)Requests to retrieve the guild's members.Flux<Role>getGuildRoles(Snowflake guildId)Requests to retrieve the guild's roles.Flux<Guild>getGuilds()Requests to retrieve the guilds the current client is in.Mono<Member>getMemberById(Snowflake guildId, Snowflake userId)Requests to retrieve the member represented by the supplied IDs.Mono<Message>getMessageById(Snowflake channelId, Snowflake messageId)Requests to retrieve the message represented by the supplied IDs.Mono<Role>getRoleById(Snowflake guildId, Snowflake roleId)Requests to retrieve the role represented by the supplied IDs.Mono<User>getSelf()Requests to retrieve the bot user.Mono<Member>getSelfMember(Snowflake guildId)Requests to retrieve the bot user represented as amemberof the guild with the supplied ID.Mono<User>getUserById(Snowflake userId)Requests to retrieve the user represented by the supplied ID.
-
-
-
Constructor Detail
-
FallbackEntityRetriever
public FallbackEntityRetriever(EntityRetriever first, EntityRetriever fallback)
-
-
Method Detail
-
getChannelById
public Mono<Channel> getChannelById(Snowflake channelId)
Description copied from interface:EntityRetrieverRequests to retrieve the channel represented by the supplied ID.- Specified by:
getChannelByIdin interfaceEntityRetriever- Parameters:
channelId- The ID of the channel.- Returns:
- A
Monowhere, upon successful completion, emits theChannelas represented by the supplied ID. If an error is received, it is emitted through theMono.
-
getGuildById
public Mono<Guild> getGuildById(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild represented by the supplied ID.- Specified by:
getGuildByIdin interfaceEntityRetriever- Parameters:
guildId- The ID of the guild.- Returns:
- A
Monowhere, upon successful completion, emits theGuildas represented by the supplied ID. If an error is received, it is emitted through theMono.
-
getGuildEmojiById
public Mono<GuildEmoji> getGuildEmojiById(Snowflake guildId, Snowflake emojiId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild emoji represented by the supplied IDs.- Specified by:
getGuildEmojiByIdin interfaceEntityRetriever- Parameters:
guildId- The ID of the guild.emojiId- The ID of the emoji.- Returns:
- A
Monowhere, upon successful completion, emits theGuildEmojias represented by the supplied IDs. If an error is received, it is emitted through theMono.
-
getMemberById
public Mono<Member> getMemberById(Snowflake guildId, Snowflake userId)
Description copied from interface:EntityRetrieverRequests to retrieve the member represented by the supplied IDs. Depending on the implementation, it is possible to lazily request member entities from the Gateway, or the REST API.- Specified by:
getMemberByIdin interfaceEntityRetriever- Parameters:
guildId- The ID of the guild.userId- The ID of the user.- Returns:
- A
Monowhere, upon successful completion, emits theMemberas represented by the supplied IDs. If an error is received, it is emitted through theMono.
-
getMessageById
public Mono<Message> getMessageById(Snowflake channelId, Snowflake messageId)
Description copied from interface:EntityRetrieverRequests to retrieve the message represented by the supplied IDs.- Specified by:
getMessageByIdin interfaceEntityRetriever- Parameters:
channelId- The ID of the channel.messageId- The ID of the message.- Returns:
- A
Monowhere, upon successful completion, emits theMessageas represented by the supplied IDs. If an error is received, it is emitted through theMono.
-
getRoleById
public Mono<Role> getRoleById(Snowflake guildId, Snowflake roleId)
Description copied from interface:EntityRetrieverRequests to retrieve the role represented by the supplied IDs.- Specified by:
getRoleByIdin interfaceEntityRetriever- Parameters:
guildId- The ID of the guild.roleId- The ID of the role.- Returns:
- A
Monowhere, upon successful completion, emits theRoleas represented by the supplied IDs. If an error is received, it is emitted through theMono.
-
getUserById
public Mono<User> getUserById(Snowflake userId)
Description copied from interface:EntityRetrieverRequests to retrieve the user represented by the supplied ID.- Specified by:
getUserByIdin interfaceEntityRetriever- Parameters:
userId- The ID of the user.- Returns:
- A
Monowhere, upon successful completion, emits theUseras represented by the supplied ID. If an error is received, it is emitted through theMono.
-
getGuilds
public Flux<Guild> getGuilds()
Description copied from interface:EntityRetrieverRequests to retrieve the guilds the current client is in.- Specified by:
getGuildsin interfaceEntityRetriever- Returns:
- A
Fluxthat continually emits theguildsthat the current client is in. If an error is received, it is emitted through theFlux.
-
getSelf
public Mono<User> getSelf()
Description copied from interface:EntityRetrieverRequests to retrieve the bot user.- Specified by:
getSelfin interfaceEntityRetriever- Returns:
- A
Monowhere, upon successful completion, emits the botuser. If an error is received, it is emitted through theMono.
-
getSelfMember
public Mono<Member> getSelfMember(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the bot user represented as amemberof the guild with the supplied ID.- Specified by:
getSelfMemberin interfaceEntityRetriever- Parameters:
guildId- The ID of the guild.- Returns:
- A
Monowhere, upon successful completion, emits the botmember. If an error is received, it is emitted through theMono.
-
getGuildMembers
public Flux<Member> getGuildMembers(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild's members.- Specified by:
getGuildMembersin interfaceEntityRetriever- Parameters:
guildId- the ID of the guild.- Returns:
- A
Fluxthat continually emits themembersof the guild. If an error is received, it is emitted through theFlux.
-
getGuildChannels
public Flux<GuildChannel> getGuildChannels(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild's channels.The order of items emitted by the returned
Fluxis unspecified. UseOrderUtil.orderGuildChannels(Flux)to consistently order channels.- Specified by:
getGuildChannelsin interfaceEntityRetriever- Parameters:
guildId- the ID of the guild.- Returns:
- A
Fluxthat continually emits the guild'schannels. If an error is received, it is emitted through theFlux.
-
getGuildRoles
public Flux<Role> getGuildRoles(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild's roles.The order of items emitted by the returned
Fluxis unspecified. UseOrderUtil.orderRoles(Flux)to consistently order roles.- Specified by:
getGuildRolesin interfaceEntityRetriever- Returns:
- A
Fluxthat continually emits the guild'sroles. If an error is received, it is emitted through theFlux.
-
getGuildEmojis
public Flux<GuildEmoji> getGuildEmojis(Snowflake guildId)
Description copied from interface:EntityRetrieverRequests to retrieve the guild's emojis.- Specified by:
getGuildEmojisin interfaceEntityRetriever- Returns:
- A
Fluxthat continually emits the guild'semojis. If an error is received, it is emitted through theFlux.
-
-