Package discord4j.core.retriever
Class StoreEntityRetriever
- java.lang.Object
-
- discord4j.core.retriever.StoreEntityRetriever
-
- All Implemented Interfaces:
EntityRetriever
public class StoreEntityRetriever extends Object implements EntityRetriever
-
-
Constructor Summary
Constructors Constructor Description StoreEntityRetriever(GatewayDiscordClient gateway)
-
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.Flux<AutoModRule>
getGuildAutoModRules(Snowflake guildId)
Requests to retrieve the guild's automod rules.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<GuildSticker>
getGuildStickerById(Snowflake guildId, Snowflake stickerId)
Requests to retrieve the guild sticker represented by the supplied IDs.Flux<GuildSticker>
getGuildStickers(Snowflake guildId)
Requests to retrieve the guild's stickers.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<ScheduledEvent>
getScheduledEventById(Snowflake guildId, Snowflake eventId)
Requests to retrieve theScheduledEvent
represented by the supplied IDs.Flux<ScheduledEvent>
getScheduledEvents(Snowflake guildId)
Requests to retrieve the guild's scheduled events.Flux<ScheduledEventUser>
getScheduledEventUsers(Snowflake guildId, Snowflake eventId)
Requests to retrieve the users that subscribed to the event 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 amember
of the guild with the supplied ID.Mono<User>
getUserById(Snowflake userId)
Requests to retrieve the user represented by the supplied ID.
-
-
-
Constructor Detail
-
StoreEntityRetriever
public StoreEntityRetriever(GatewayDiscordClient gateway)
-
-
Method Detail
-
getChannelById
public Mono<Channel> getChannelById(Snowflake channelId)
Description copied from interface:EntityRetriever
Requests to retrieve the channel represented by the supplied ID.- Specified by:
getChannelById
in interfaceEntityRetriever
- Parameters:
channelId
- The ID of the channel.- Returns:
- A
Mono
where, upon successful completion, emits theChannel
as 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:EntityRetriever
Requests to retrieve the guild represented by the supplied ID.- Specified by:
getGuildById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.- Returns:
- A
Mono
where, upon successful completion, emits theGuild
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getGuildStickerById
public Mono<GuildSticker> getGuildStickerById(Snowflake guildId, Snowflake stickerId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild sticker represented by the supplied IDs.- Specified by:
getGuildStickerById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.stickerId
- The ID of the sticker.- Returns:
- A
Mono
where, upon successful completion, emits theGuildSticker
as represented by the supplied IDs. If an error is received, it is emitted through theMono
.
-
getGuildEmojiById
public Mono<GuildEmoji> getGuildEmojiById(Snowflake guildId, Snowflake emojiId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild emoji represented by the supplied IDs.- Specified by:
getGuildEmojiById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.emojiId
- The ID of the emoji.- Returns:
- A
Mono
where, upon successful completion, emits theGuildEmoji
as 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:EntityRetriever
Requests 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:
getMemberById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.userId
- The ID of the user.- Returns:
- A
Mono
where, upon successful completion, emits theMember
as 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:EntityRetriever
Requests to retrieve the message represented by the supplied IDs.- Specified by:
getMessageById
in interfaceEntityRetriever
- Parameters:
channelId
- The ID of the channel.messageId
- The ID of the message.- Returns:
- A
Mono
where, upon successful completion, emits theMessage
as 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:EntityRetriever
Requests to retrieve the role represented by the supplied IDs.- Specified by:
getRoleById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.roleId
- The ID of the role.- Returns:
- A
Mono
where, upon successful completion, emits theRole
as 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:EntityRetriever
Requests to retrieve the user represented by the supplied ID.- Specified by:
getUserById
in interfaceEntityRetriever
- Parameters:
userId
- The ID of the user.- Returns:
- A
Mono
where, upon successful completion, emits theUser
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getGuilds
public Flux<Guild> getGuilds()
Description copied from interface:EntityRetriever
Requests to retrieve the guilds the current client is in.- Specified by:
getGuilds
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits theguilds
that the current client is in. If an error is received, it is emitted through theFlux
.
-
getSelf
public Mono<User> getSelf()
Description copied from interface:EntityRetriever
Requests to retrieve the bot user.- Specified by:
getSelf
in interfaceEntityRetriever
- Returns:
- A
Mono
where, 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:EntityRetriever
Requests to retrieve the bot user represented as amember
of the guild with the supplied ID.- Specified by:
getSelfMember
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.- Returns:
- A
Mono
where, 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:EntityRetriever
Requests to retrieve the guild's members.- Specified by:
getGuildMembers
in interfaceEntityRetriever
- Parameters:
guildId
- the ID of the guild.- Returns:
- A
Flux
that continually emits themembers
of the guild. If an error is received, it is emitted through theFlux
.
-
getGuildChannels
public Flux<GuildChannel> getGuildChannels(Snowflake guildId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild's channels.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderGuildChannels(Flux)
to consistently order channels.- Specified by:
getGuildChannels
in interfaceEntityRetriever
- Parameters:
guildId
- the ID of the guild.- Returns:
- A
Flux
that 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:EntityRetriever
Requests to retrieve the guild's roles.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderRoles(Flux)
to consistently order roles.- Specified by:
getGuildRoles
in interfaceEntityRetriever
- Returns:
- A
Flux
that 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:EntityRetriever
Requests to retrieve the guild's emojis.- Specified by:
getGuildEmojis
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits the guild'semojis
. If an error is received, it is emitted through theFlux
.
-
getGuildStickers
public Flux<GuildSticker> getGuildStickers(Snowflake guildId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild's stickers.- Specified by:
getGuildStickers
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits the guild'sstickers
. If an error is received, it is emitted through theFlux
.
-
getGuildAutoModRules
public Flux<AutoModRule> getGuildAutoModRules(Snowflake guildId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild's automod rules.- Specified by:
getGuildAutoModRules
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits the guild'sAutoModRule
. If an error is received, it is emitted through theFlux
.
-
getScheduledEventById
public Mono<ScheduledEvent> getScheduledEventById(Snowflake guildId, Snowflake eventId)
Description copied from interface:EntityRetriever
Requests to retrieve theScheduledEvent
represented by the supplied IDs.- Specified by:
getScheduledEventById
in interfaceEntityRetriever
- Parameters:
guildId
- The ID of the guild.eventId
- The ID of the scheduled event.- Returns:
- A
Mono
where, upon successful completion, emits theScheduledEvent
as represented by the supplied IDs. If an error is received, it is emitted through theMono
.
-
getScheduledEvents
public Flux<ScheduledEvent> getScheduledEvents(Snowflake guildId)
Description copied from interface:EntityRetriever
Requests to retrieve the guild's scheduled events.- Specified by:
getScheduledEvents
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits the guild'sevents
. If an error is received, it is emitted through theFlux
.
-
getScheduledEventUsers
public Flux<ScheduledEventUser> getScheduledEventUsers(Snowflake guildId, Snowflake eventId)
Description copied from interface:EntityRetriever
Requests to retrieve the users that subscribed to the event represented by the supplied IDs.- Specified by:
getScheduledEventUsers
in interfaceEntityRetriever
- Returns:
- A
Flux
that continually emits the event'susers
. If an error is received, it is emitted through theFlux
.
-
-