Class GatewayDiscordClient
- java.lang.Object
-
- discord4j.core.GatewayDiscordClient
-
- All Implemented Interfaces:
EntityRetriever
public class GatewayDiscordClient extends Object implements EntityRetriever
An aggregation of all dependencies Discord4J requires to operate with the Discord Gateway, REST API and Voice Gateway. Maintains a set of connections to every shard logged in from the sameGatewayBootstrapand therefore tracks state updates from all connected shards.The following are some of the resources available through this aggregate:
- Access to the base
DiscordClientfor direct REST API operations throughrest(). - Access to
CoreResourceslike theRestClientused to perform API requests. - Access to
GatewayResourcesthat configure Gateway stores, actions and coordination among shards. - Access to
EventDispatcherpublishing events from all participating shards.
-
-
Constructor Summary
Constructors Constructor Description GatewayDiscordClient(DiscordClient discordClient, GatewayResources gatewayResources, Mono<Void> onDisconnect, GatewayClientGroup gatewayClientGroup, VoiceConnectionFactory voiceConnectionFactory, EntityRetrievalStrategy entityRetrievalStrategy, Set<String> completingChunkNonces)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Mono<Guild>createGuild(discord4j.core.spec.GuildCreateSpec spec)Requests to create a guild.discord4j.core.spec.GuildCreateMonocreateGuild(String name, Region region)Requests to create a guild.Mono<Guild>createGuild(Consumer<? super LegacyGuildCreateSpec> spec)Deprecated.usecreateGuild(GuildCreateSpec)orcreateGuild(String, Region)which offer an immutable approach to build specsdiscord4j.core.spec.UserEditMonoedit()Requests to edit this client (i.e., modify the current bot user).Mono<User>edit(discord4j.core.spec.UserEditSpec spec)Requests to edit this client (i.e., modify the current bot user).Mono<User>edit(Consumer<? super LegacyUserEditSpec> spec)Deprecated.useedit(UserEditSpec)oredit()which offer an immutable approach to build specsMono<ApplicationInfo>getApplicationInfo()Requests to retrieve the application info.Mono<Channel>getChannelById(Snowflake channelId)Requests to retrieve the channel represented by the supplied ID.CoreResourcesgetCoreResources()Returns the set of resources essential to operate on aDiscordClientfor entity manipulation, scheduling and API communication, like theRestClient,JacksonResourcesandReactorResources.EventDispatchergetEventDispatcher()Distributes events to subscribers.Optional<GatewayClient>getGatewayClient(int shardId)Returns aGatewayClientinstance created by thisGatewayDiscordClient, which is associated to a given shard index.GatewayClientGroupgetGatewayClientGroup()Returns theGatewayClientGroupcapable of performing operations across allGatewayClientinstances created or managed by thisGatewayDiscordClient.GatewayResourcesgetGatewayResources()Returns the set of resources essential to buildGatewayClientinstances and manage multiple Discord Gateway connections.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<Invite>getInvite(String inviteCode)Requests to retrieve an invite.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.Flux<Region>getRegions()Requests to retrieve the voice regions that are available.RestClientgetRestClient()Returns theRestClientused to execute REST API requests.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.SnowflakegetSelfId()Gets the bot user's ID.Mono<Member>getSelfMember(Snowflake guildId)Requests to retrieve the bot user represented as amemberof the guild with the supplied ID.Mono<GuildTemplate>getTemplateByCode(String templateCode)Requests to retrieve the template represented by the supplied code.Mono<User>getUserById(Snowflake userId)Requests to retrieve the user represented by the supplied ID.Flux<User>getUsers()Retrieve the currently stored (cached) users.VoiceConnectionFactorygetVoiceConnectionFactory()Returns theVoiceConnectionFactoryinstance created by thisGatewayDiscordClient.VoiceConnectionRegistrygetVoiceConnectionRegistry()Return theVoiceConnectionRegistryfor thisGatewayDiscordClient.Mono<Webhook>getWebhookById(Snowflake webhookId)Requests to retrieve the webhook represented by the supplied ID.Mono<Webhook>getWebhookByIdWithToken(Snowflake webhookId, String token)Requests to retrieve the webhook represented by the supplied ID and token.Mono<Void>logout()Disconnects thisGatewayDiscordClientfrom Discord upon subscribing.Flux<Event>on(ReactiveEventAdapter adapter)Applies a givenadapterto all events from this dispatcher.<E extends Event>
Flux<E>on(Class<E> eventClass)<E extends Event,T>
Flux<T>on(Class<E> eventClass, Function<E,Publisher<T>> mapper)Mono<Void>onDisconnect()Return aMonothat signals completion when allGatewayClientinstances in this shard group have disconnected.Flux<discord4j.discordjson.json.gateway.GuildMembersChunk>requestMemberChunks(discord4j.discordjson.json.gateway.RequestGuildMembers request)Submit aRequestGuildMemberspayload using the current Gateway connection and wait for its completion, delivering rawGuildMembersChunkelements asynchronously through aFlux.Flux<Member>requestMembers(Snowflake guildId)Flux<Member>requestMembers(Snowflake guildId, Set<Snowflake> userIds)Flux<Member>requestMembers(discord4j.discordjson.json.gateway.RequestGuildMembers request)DiscordClientrest()Access the parentDiscordClientcapable of performing direct REST API requests and REST entities.Mono<Void>updatePresence(ClientPresence clientPresence)Update the bot'sClientPresence(client status) for every shard in this shard group.Mono<Void>updatePresence(ClientPresence clientPresence, int shardId)Update the bot'sPresence(status) for the given shard index, provided it belongs in this shard group.EntityRetrieverwithRetrievalStrategy(EntityRetrievalStrategy retrievalStrategy)Applies the given strategy to retrieve entities using thisGatewayDiscordClient.
-
-
-
Constructor Detail
-
GatewayDiscordClient
public GatewayDiscordClient(DiscordClient discordClient, GatewayResources gatewayResources, Mono<Void> onDisconnect, GatewayClientGroup gatewayClientGroup, VoiceConnectionFactory voiceConnectionFactory, EntityRetrievalStrategy entityRetrievalStrategy, Set<String> completingChunkNonces)
-
-
Method Detail
-
rest
public DiscordClient rest()
Access the parentDiscordClientcapable of performing direct REST API requests and REST entities.- Returns:
- the
DiscordClientthat created thisGatewayDiscordClient
-
getCoreResources
public CoreResources getCoreResources()
Returns the set of resources essential to operate on aDiscordClientfor entity manipulation, scheduling and API communication, like theRestClient,JacksonResourcesandReactorResources.- Returns:
- the
RestResourcesfor the parentDiscordClient
-
getGatewayResources
public GatewayResources getGatewayResources()
Returns the set of resources essential to buildGatewayClientinstances and manage multiple Discord Gateway connections.- Returns:
- the
GatewayResourcestied to thisGatewayDiscordClient
-
getEventDispatcher
public EventDispatcher getEventDispatcher()
Distributes events to subscribers. Starting from v3.1, theEventDispatcheris capable of distributing events from allGatewayClientconnections (shards) that were specified when thisGatewayDiscordClientwas created.- Returns:
- the
EventDispatchertied to thisGatewayDiscordClient
-
getGatewayClient
public Optional<GatewayClient> getGatewayClient(int shardId)
Returns aGatewayClientinstance created by thisGatewayDiscordClient, which is associated to a given shard index.- Parameters:
shardId- the shard index used to get the client instance- Returns:
- a
GatewayClientinstance represented by the given shard, if present
-
getGatewayClientGroup
public GatewayClientGroup getGatewayClientGroup()
Returns theGatewayClientGroupcapable of performing operations across allGatewayClientinstances created or managed by thisGatewayDiscordClient.- Returns:
- a
GatewayClientGroupto aggregate gateway operations
-
getVoiceConnectionFactory
public VoiceConnectionFactory getVoiceConnectionFactory()
Returns theVoiceConnectionFactoryinstance created by thisGatewayDiscordClient.- Returns:
- a
VoiceConnectionFactoryinstance capable of initiating voice connections
-
getVoiceConnectionRegistry
public VoiceConnectionRegistry getVoiceConnectionRegistry()
Return theVoiceConnectionRegistryfor thisGatewayDiscordClient. This allows you to retrieve currently registeredVoiceConnectioninstances.- Returns:
- a
VoiceConnectionRegistryfor voice connections
-
getRestClient
public RestClient getRestClient()
Returns theRestClientused to execute REST API requests.- Returns:
- the
RestClienttied to this Gateway client.
-
getWebhookById
public Mono<Webhook> getWebhookById(Snowflake webhookId)
Requests to retrieve the webhook represented by the supplied ID. The bot must have the MANAGE_WEBHOOKS permission in the webhook's channel.
-
getWebhookByIdWithToken
public Mono<Webhook> getWebhookByIdWithToken(Snowflake webhookId, String token)
Requests to retrieve the webhook represented by the supplied ID and token. Doesn't return the user who created the webhook object. Doesn't require the bot to have the MANAGE_WEBHOOKS permission.- Parameters:
webhookId- The ID of the webhook.token- The authentication token of the webhook.- Returns:
- A
Monowhere, upon successful completion, emits theWebhookas represented by the supplied ID without the user field and with the token field. If an error is received, it is emitted through theMono.
-
getApplicationInfo
public Mono<ApplicationInfo> getApplicationInfo()
Requests to retrieve the application info.- Returns:
- A
Monowhere, upon successful completion, emits theapplication info. If an error is received, it is emitted through theMono.
-
getRegions
public Flux<Region> getRegions()
Requests to retrieve the voice regions that are available.
-
getTemplateByCode
public Mono<GuildTemplate> getTemplateByCode(String templateCode)
Requests to retrieve the template represented by the supplied code.- Parameters:
templateCode- The code of the template.- Returns:
- A
Monowhere, upon successful completion, emits theGuildTemplateas represented by the supplied code. If an error is received, it is emitted through theMono.
-
getSelfId
public Snowflake getSelfId()
Gets the bot user's ID.- Returns:
- The bot user's ID.
-
createGuild
@Deprecated public Mono<Guild> createGuild(Consumer<? super LegacyGuildCreateSpec> spec)
Deprecated.usecreateGuild(GuildCreateSpec)orcreateGuild(String, Region)which offer an immutable approach to build specsRequests to create a guild.- Parameters:
spec- AConsumerthat provides a "blank"LegacyGuildCreateSpecto be operated on.- Returns:
- A
Monowhere, upon successful completion, emits the createdGuild. If an error is received, it is emitted through theMono.
-
createGuild
public discord4j.core.spec.GuildCreateMono createGuild(String name, Region region)
Requests to create a guild. Properties specifying how to create the guild can be set via thewithXxxmethods of the returnedGuildCreateMono.- Parameters:
name- the name of the guild to createregion- the region of the guild to create- Returns:
- A
GuildCreateMonowhere, upon successful completion, emits the createdGuild. If an error is received, it is emitted through theGuildCreateMono.
-
createGuild
public Mono<Guild> createGuild(discord4j.core.spec.GuildCreateSpec spec)
Requests to create a guild.
-
updatePresence
public Mono<Void> updatePresence(ClientPresence clientPresence)
Update the bot'sClientPresence(client status) for every shard in this shard group.- Parameters:
clientPresence- The updated client status.- Returns:
- A
Monothat signals completion upon successful update. If an error is received, it is emitted through theMono.
-
updatePresence
public Mono<Void> updatePresence(ClientPresence clientPresence, int shardId)
Update the bot'sPresence(status) for the given shard index, provided it belongs in this shard group.- Parameters:
clientPresence- The updated client presence.- Returns:
- A
Monothat signals completion upon successful update. If an error is received, it is emitted through theMono.
-
edit
@Deprecated public Mono<User> edit(Consumer<? super LegacyUserEditSpec> spec)
Deprecated.useedit(UserEditSpec)oredit()which offer an immutable approach to build specsRequests to edit this client (i.e., modify the current bot user).- Parameters:
spec- AConsumerthat provides a "blank"LegacyUserEditSpecto be operated on.- Returns:
- A
Monowhere, upon successful completion, emits the editedUser. If an error is received, it is emitted through theMono.
-
edit
public discord4j.core.spec.UserEditMono edit()
Requests to edit this client (i.e., modify the current bot user). Properties specifying how to edit this client can be set via thewithXxxmethods of the returnedUserEditMono.
-
edit
public Mono<User> edit(discord4j.core.spec.UserEditSpec spec)
Requests to edit this client (i.e., modify the current bot user).
-
logout
public Mono<Void> logout()
Disconnects thisGatewayDiscordClientfrom Discord upon subscribing. AllGatewayClientinstances in this shard group will attempt to close their current Gateway session and complete thisMonoafter all of them have disconnected.- Returns:
- A
Monothat upon subscription, will disconnect each Gateway connection established by thisGatewayDiscordClientand complete after all of them have closed.
-
onDisconnect
public Mono<Void> onDisconnect()
Return aMonothat signals completion when allGatewayClientinstances in this shard group have disconnected.- Returns:
- a
Monothat will complete once allGatewayClientinstances in this shard group have disconnected.
-
on
public <E extends Event> Flux<E> on(Class<E> eventClass)
Retrieves aFluxwith elements of the givenEventtype. ThisFluxhas to be subscribed to in order to start processing. SeeEventclass for the list of possible event classes.Note: Errors occurring while processing events will terminate your sequence. If you wish to use a version capable of handling errors for you, use
on(Class, Function). See Reactive Streams Spec explaining this behavior.A recommended pattern to use this method is wrapping your code that may throw exceptions within a
flatMapblock and useMono.onErrorResume(Function),Flux.onErrorResume(Function)or equivalent methods to maintain the sequence active:client.on(MessageCreateEvent.class) .flatMap(event -> myCodeThatMightThrow(event) .onErrorResume(error -> { // log and then discard the error to keep the sequence alive log.error("Failed to handle event!", error); return Mono.empty(); })) .subscribe();For more alternatives to handling errors, please see Error Handling docs page.
- Type Parameters:
E- the type of the event class- Parameters:
eventClass- the event class to obtain events from- Returns:
- a new
Fluxwith the requested events
-
on
public <E extends Event,T> Flux<T> on(Class<E> eventClass, Function<E,Publisher<T>> mapper)
Retrieves aFluxwith elements of the givenEventtype, to be processed through a givenFunctionupon subscription. Errors occurring within the mapper will be logged and discarded, preventing the termination of the "infinite" event sequence. SeeEventclass for the list of possible event classes.There are multiple ways of using this event handling method, for example:
client.on(MessageCreateEvent.class, event -> { // myCodeThatMightThrow should return a Reactor type (Mono or Flux) return myCodeThatMightThrow(event); }) .subscribe(); client.on(MessageCreateEvent.class, event -> { // myCodeThatMightThrow *can* be blocking, so wrap it in a Reactor type return Mono.fromRunnable(() -> myCodeThatMightThrow(event)); }) .subscribe();Continuing the chain after
on(class, event -> ...)will require your own error handling strategy. Check the docs foron(Class)for more details.- Type Parameters:
E- the type of the event classT- the type of the event mapper function- Parameters:
eventClass- the event class to obtain events frommapper- an event mapping function called on each event. If you do not wish to perform further operations you can returnMono.empty().- Returns:
- a new
Fluxwith the type resulting from the given event mapper
-
on
public Flux<Event> on(ReactiveEventAdapter adapter)
Applies a givenadapterto all events from this dispatcher. Errors occurring within the mapper will be logged and discarded, preventing the termination of the "infinite" event sequence. This variant allows you to have a single subscriber to this dispatcher, which is useful to collect all startup events.A standard approach to this method is to subclass
ReactiveEventAdapter, overriding the methods you want to listen for:client.on(new ReactiveEventAdapter() { public Publisher<?> onReady(ReadyEvent event) { return Mono.fromRunnable(() -> System.out.println("Connected as " + event.getSelf().getTag())); } public Publisher<?> onMessageCreate(MessageCreateEvent event) { if (event.getMessage().getContent().equals("!ping")) { return event.getMessage().getChannel() .flatMap(channel -> channel.createMessage("Pong!")); } return Mono.empty(); } }).subscribe(); // nothing happens until you subscribeEach method requires a
Publisherreturn likeMonoorFluxand all errors will be logged and discarded. To use a synchronous implementation you can wrap your code withMono.fromRunnable(Runnable).Continuing the chain will require your own error handling strategy. Check the docs for
on(Class)for more details.- Parameters:
adapter- an adapter meant to be subclassed with its appropriate methods overridden- Returns:
- a new
Fluxwith the type resulting from the given event mapper
-
requestMembers
public Flux<Member> requestMembers(Snowflake guildId)
Return allmembersfrom the givenguildIdusing the current Gateway connection. This method performs a check to validate whether the given guild's data can be obtained from thisGatewayDiscordClient.
-
requestMembers
public Flux<Member> requestMembers(Snowflake guildId, Set<Snowflake> userIds)
Return a set ofmembersfrom the givenguildIdusing the current Gateway connection. This method performs a check to validate whether the given guild's data can be obtained from thisGatewayDiscordClient.
-
requestMembers
public Flux<Member> requestMembers(discord4j.discordjson.json.gateway.RequestGuildMembers request)
Submit aRequestGuildMemberspayload using the current Gateway connection and wait for its completion, deliveringMemberelements asynchronously through aFlux. This method performs a check to validate whether the given guild's data can be obtained from thisGatewayDiscordClient.
-
requestMemberChunks
public Flux<discord4j.discordjson.json.gateway.GuildMembersChunk> requestMemberChunks(discord4j.discordjson.json.gateway.RequestGuildMembers request)
Submit aRequestGuildMemberspayload using the current Gateway connection and wait for its completion, delivering rawGuildMembersChunkelements asynchronously through aFlux. This method performs a check to validate whether the given guild's data can be obtained from thisGatewayDiscordClient.A timeout given by is used to fail this request if the operation is unable to complete due to disallowed or disabled members intent. This is particularly relevant when requesting a complete member list. If the timeout is triggered, a
TimeoutExceptionis forwarded through theFlux.- Parameters:
request- the member request to submit. Create one usingRequestGuildMembers.builder().Flux.timeout(Duration)- Returns:
- a
FluxofGuildMembersChunkfor the givenGuild. If an error occurs, it is emitted through theFlux.
-
withRetrievalStrategy
public EntityRetriever withRetrievalStrategy(EntityRetrievalStrategy retrievalStrategy)
Applies the given strategy to retrieve entities using thisGatewayDiscordClient.- Parameters:
retrievalStrategy- the strategy to apply- Returns:
- an EntityRetriever able to retrieve entities using the given strategy
-
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.
-
-