Interface EntityRetriever

All Known Implementing Classes:
FallbackEntityRetriever, GatewayDiscordClient, RestEntityRetriever, StoreEntityRetriever

public interface EntityRetriever
Abstraction for entity retrieval.
  • Method Details

    • getChannelById

      Mono<Channel> getChannelById(Snowflake channelId)
      Requests to retrieve the channel represented by the supplied ID.
      Parameters:
      channelId - The ID of the channel.
      Returns:
      A Mono where, upon successful completion, emits the Channel as represented by the supplied ID. If an error is received, it is emitted through the Mono.
    • getGuildById

      Mono<Guild> getGuildById(Snowflake guildId)
      Requests to retrieve the guild represented by the supplied ID.
      Parameters:
      guildId - The ID of the guild.
      Returns:
      A Mono where, upon successful completion, emits the Guild as represented by the supplied ID. If an error is received, it is emitted through the Mono.
    • getGuildStickerById

      Mono<GuildSticker> getGuildStickerById(Snowflake guildId, Snowflake stickerId)
      Requests to retrieve the guild sticker represented by the supplied IDs.
      Parameters:
      guildId - The ID of the guild.
      stickerId - The ID of the sticker.
      Returns:
      A Mono where, upon successful completion, emits the GuildSticker as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getGuildEmojiById

      Mono<GuildEmoji> getGuildEmojiById(Snowflake guildId, Snowflake emojiId)
      Requests to retrieve the guild emoji represented by the supplied IDs.
      Parameters:
      guildId - The ID of the guild.
      emojiId - The ID of the emoji.
      Returns:
      A Mono where, upon successful completion, emits the GuildEmoji as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getMemberById

      Mono<Member> getMemberById(Snowflake guildId, Snowflake userId)
      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.
      Parameters:
      guildId - The ID of the guild.
      userId - The ID of the user.
      Returns:
      A Mono where, upon successful completion, emits the Member as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getMessageById

      Mono<Message> getMessageById(Snowflake channelId, Snowflake messageId)
      Requests to retrieve the message represented by the supplied IDs.
      Parameters:
      channelId - The ID of the channel.
      messageId - The ID of the message.
      Returns:
      A Mono where, upon successful completion, emits the Message as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getRoleById

      Mono<Role> getRoleById(Snowflake guildId, Snowflake roleId)
      Requests to retrieve the role represented by the supplied IDs.
      Parameters:
      guildId - The ID of the guild.
      roleId - The ID of the role.
      Returns:
      A Mono where, upon successful completion, emits the Role as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getUserById

      Mono<User> getUserById(Snowflake userId)
      Requests to retrieve the user represented by the supplied ID.
      Parameters:
      userId - The ID of the user.
      Returns:
      A Mono where, upon successful completion, emits the User as represented by the supplied ID. If an error is received, it is emitted through the Mono.
    • getGuilds

      Flux<Guild> getGuilds()
      Requests to retrieve the guilds the current client is in.
      Returns:
      A Flux that continually emits the guilds that the current client is in. If an error is received, it is emitted through the Flux.
    • getSelf

      Mono<User> getSelf()
      Requests to retrieve the bot user.
      Returns:
      A Mono where, upon successful completion, emits the bot user. If an error is received, it is emitted through the Mono.
    • getSelfMember

      Mono<Member> getSelfMember(Snowflake guildId)
      Requests to retrieve the bot user represented as a member of the guild with the supplied ID.
      Parameters:
      guildId - The ID of the guild.
      Returns:
      A Mono where, upon successful completion, emits the bot member. If an error is received, it is emitted through the Mono.
    • getGuildMembers

      Flux<Member> getGuildMembers(Snowflake guildId)
      Requests to retrieve the guild's members.
      Parameters:
      guildId - the ID of the guild.
      Returns:
      A Flux that continually emits the members of the guild. If an error is received, it is emitted through the Flux.
    • getGuildChannels

      Flux<GuildChannel> getGuildChannels(Snowflake guildId)
      Requests to retrieve the guild's channels.

      The order of items emitted by the returned Flux is unspecified. Use OrderUtil.orderGuildChannels(Flux) to consistently order channels.

      Parameters:
      guildId - the ID of the guild.
      Returns:
      A Flux that continually emits the guild's channels. If an error is received, it is emitted through the Flux.
    • getGuildRoles

      Flux<Role> getGuildRoles(Snowflake guildId)
      Requests to retrieve the guild's roles.

      The order of items emitted by the returned Flux is unspecified. Use OrderUtil.orderRoles(Flux) to consistently order roles.

      Parameters:
      guildId - The ID of the guild.
      Returns:
      A Flux that continually emits the guild's roles. If an error is received, it is emitted through the Flux.
    • getGuildEmojis

      Flux<GuildEmoji> getGuildEmojis(Snowflake guildId)
      Requests to retrieve the guild's emojis.
      Parameters:
      guildId - The ID of the guild.
      Returns:
      A Flux that continually emits the guild's emojis. If an error is received, it is emitted through the Flux.
    • getStageInstanceByChannelId

      Mono<StageInstance> getStageInstanceByChannelId(Snowflake channelId)
      Requests to retrieve the stage instance associated to the supplied channel ID.
      Parameters:
      channelId - The ID of the channel.
      Returns:
      A Mono where, upon successful completion, emits the StageInstance associated to the supplied channel ID. If an error is received, it is emitted through the Mono.
    • getGuildStickers

      Flux<GuildSticker> getGuildStickers(Snowflake guildId)
      Requests to retrieve the guild's stickers.
      Parameters:
      guildId - The ID of the guild.
      Returns:
      A Flux that continually emits the guild's stickers. If an error is received, it is emitted through the Flux.
    • getThreadMemberById

      Mono<ThreadMember> getThreadMemberById(Snowflake threadId, Snowflake userId)
      Requests to retrieve the thread member associated to the supplied thread ID and user ID.
      Parameters:
      threadId - The ID of the thread.
      userId - The ID of the user.
      Returns:
      A Mono where, upon successful completion, emits the ThreadMember associated to the supplied thread ID and user ID. If an error is received, it is emitted through the Mono.
    • getThreadMembers

      Flux<ThreadMember> getThreadMembers(Snowflake threadId)
      Requests to retrieve the thread's members.
      Parameters:
      threadId - The ID of the thread.
      Returns:
      A Flux that continually emits the thread's members. If an error is received, it is emitted through the Flux.
    • getGuildAutoModRules

      Flux<AutoModRule> getGuildAutoModRules(Snowflake guildId)
      Requests to retrieve the guild's automod rules.
      Returns:
      A Flux that continually emits the guild's AutoModRule. If an error is received, it is emitted through the Flux.
    • getScheduledEventById

      Mono<ScheduledEvent> getScheduledEventById(Snowflake guildId, Snowflake eventId)
      Requests to retrieve the ScheduledEvent represented by the supplied IDs.
      Parameters:
      guildId - The ID of the guild.
      eventId - The ID of the scheduled event.
      Returns:
      A Mono where, upon successful completion, emits the ScheduledEvent as represented by the supplied IDs. If an error is received, it is emitted through the Mono.
    • getScheduledEvents

      Flux<ScheduledEvent> getScheduledEvents(Snowflake guildId)
      Requests to retrieve the guild's scheduled events.
      Returns:
      A Flux that continually emits the guild's events. If an error is received, it is emitted through the Flux.
    • getScheduledEventUsers

      Flux<ScheduledEventUser> getScheduledEventUsers(Snowflake guildId, Snowflake eventId)
      Requests to retrieve the users that subscribed to the event represented by the supplied IDs.
      Returns:
      A Flux that continually emits the event's users. If an error is received, it is emitted through the Flux.