Class RestEntityRetriever

java.lang.Object
discord4j.core.retriever.RestEntityRetriever
All Implemented Interfaces:
EntityRetriever

public class RestEntityRetriever extends Object implements EntityRetriever
  • Constructor Details

  • Method Details

    • 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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      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 interface EntityRetriever
      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

      public Flux<Guild> getGuilds()
      Description copied from interface: EntityRetriever
      Requests to retrieve the guilds the current client is in.
      Specified by:
      getGuilds in interface EntityRetriever
      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

      public Mono<User> getSelf()
      Description copied from interface: EntityRetriever
      Requests to retrieve the bot user.
      Specified by:
      getSelf in interface EntityRetriever
      Returns:
      A Mono where, upon successful completion, emits the bot user. If an error is received, it is emitted through the Mono.
    • getSelfMember

      public Mono<Member> getSelfMember(Snowflake guildId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the bot user represented as a member of the guild with the supplied ID.
      Specified by:
      getSelfMember in interface EntityRetriever
      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

      public Flux<Member> getGuildMembers(Snowflake guildId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the guild's members.
      Specified by:
      getGuildMembers in interface EntityRetriever
      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

      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. Use OrderUtil.orderGuildChannels(Flux) to consistently order channels.

      Specified by:
      getGuildChannels in interface EntityRetriever
      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

      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. Use OrderUtil.orderRoles(Flux) to consistently order roles.

      Specified by:
      getGuildRoles in interface EntityRetriever
      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

      public Flux<GuildEmoji> getGuildEmojis(Snowflake guildId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the guild's emojis.
      Specified by:
      getGuildEmojis in interface EntityRetriever
      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.
    • getGuildStickers

      public Flux<GuildSticker> getGuildStickers(Snowflake guildId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the guild's stickers.
      Specified by:
      getGuildStickers in interface EntityRetriever
      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

      public Mono<ThreadMember> getThreadMemberById(Snowflake threadId, Snowflake userId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the thread member associated to the supplied thread ID and user ID.
      Specified by:
      getThreadMemberById in interface EntityRetriever
      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

      public Flux<ThreadMember> getThreadMembers(Snowflake threadId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the thread's members.
      Specified by:
      getThreadMembers in interface EntityRetriever
      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

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

      public Mono<ScheduledEvent> getScheduledEventById(Snowflake guildId, Snowflake eventId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the ScheduledEvent represented by the supplied IDs.
      Specified by:
      getScheduledEventById in interface EntityRetriever
      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

      public Flux<ScheduledEvent> getScheduledEvents(Snowflake guildId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the guild's scheduled events.
      Specified by:
      getScheduledEvents in interface EntityRetriever
      Returns:
      A Flux that continually emits the guild's events. If an error is received, it is emitted through the Flux.
    • 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 interface EntityRetriever
      Returns:
      A Flux that continually emits the event's users. If an error is received, it is emitted through the Flux.
    • getStageInstanceByChannelId

      public Mono<StageInstance> getStageInstanceByChannelId(Snowflake channelId)
      Description copied from interface: EntityRetriever
      Requests to retrieve the stage instance associated to the supplied channel ID.
      Specified by:
      getStageInstanceByChannelId in interface EntityRetriever
      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.