Interface Guild

All Superinterfaces:
Entity, HasApplication, HasIcon, HasName, HasNullableDescription, HasOwner, RequiresCatnip, Snowflake, Timestamped
All Known Implementing Classes:
GuildImpl

Represents a Discord guild. A guild is colloquially referred to as a server, both in the client UI and by users.
Since:
9/6/18
Author:
natanbc
  • Field Details

  • Method Details

    • splash

      @Nullable @CheckReturnValue String splash()
      Returns:
      The splash image for the guild. May be null.
    • splashUrl

      @Nullable @CheckReturnValue String splashUrl(@Nonnull ImageOptions options)
      The CDN URL of the guild's splash image.
      Parameters:
      options - The options to configure the URL returned.
      Returns:
      The CDN URL.
    • splashUrl

      @Nullable @CheckReturnValue default String splashUrl()
      Returns:
      The CDN URL of the guild's splash image.
    • selfMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> selfMember()
      Returns:
      The self member as an user of the guild.
    • owner

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<User> owner()
      Specified by:
      owner in interface HasOwner
      Returns:
      The owner of the guild.
    • ownerMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> ownerMember()
      Returns:
      The Member of the guild's owner.
    • owned

      @CheckReturnValue boolean owned()
      Returns:
      Whether the guild is owned by the current user.
    • ownerId

      @Nonnull @CheckReturnValue default String ownerId()
      Specified by:
      ownerId in interface HasOwner
      Returns:
      The id of the user who owns the guild.
    • ownerIdAsLong

      @CheckReturnValue long ownerIdAsLong()
      Specified by:
      ownerIdAsLong in interface HasOwner
      Returns:
      The id of the user who owns the guild.
    • permissions

      @Nonnull @CheckReturnValue Set<Permission> permissions()
      Returns:
      Total permissions for the user in the guild. Does NOT include channel overrides.
    • region

      @Nonnull @CheckReturnValue String region()
      Returns:
      The region that the guild's voice servers are located in.
    • afkChannelId

      @Nullable @CheckReturnValue default String afkChannelId()
      Returns:
      The id of the afk voice channel for the guild.
    • afkChannelIdAsLong

      @CheckReturnValue long afkChannelIdAsLong()
      Returns:
      The id of the afk voice channel for the guild.
    • afkTimeout

      @CheckReturnValue int afkTimeout()
      Returns:
      The amount of time a user must be afk for before they're moved to the afk channel.
    • verificationLevel

      @Nonnull @CheckReturnValue Guild.VerificationLevel verificationLevel()
      Returns:
      The verification level set for the guild.
    • defaultMessageNotifications

      @Nonnull @CheckReturnValue Guild.NotificationLevel defaultMessageNotifications()
      Returns:
      The notification level set for the guild.
    • explicitContentFilter

      @Nonnull @CheckReturnValue Guild.ContentFilterLevel explicitContentFilter()
      Returns:
      The explicit content filter level set for the guild.
    • features

      @Nonnull @CheckReturnValue List<GuildFeature> features()
      Returns:
      The list of features enabled for the guild.
    • mfaLevel

      @Nonnull @CheckReturnValue Guild.MFALevel mfaLevel()
      Returns:
      The MFA level set for guild administrators.
    • widgetEnabled

      @CheckReturnValue boolean widgetEnabled()
      Returns:
      Whether or not the guild's widget is enabled.
    • widgetChannelId

      @Nullable @CheckReturnValue default String widgetChannelId()
      Returns:
      The channel the guild's widget is set for, if enabled.
    • widgetChannelIdAsLong

      @CheckReturnValue long widgetChannelIdAsLong()
      Returns:
      The channel the guild's widget is set for, if enabled.
    • systemChannelId

      @Nullable @CheckReturnValue default String systemChannelId()
      Returns:
      The id of the channel used for system messages (ex. the built-in member join messages).
    • systemChannelIdAsLong

      @CheckReturnValue long systemChannelIdAsLong()
      Returns:
      The id of the channel used for system messages (ex. the built-in member join messages).
    • joinedAt

      @CheckReturnValue OffsetDateTime joinedAt()
      Returns:
      The date/time that the current user joined the guild at.
    • joinedAtTimestamp

      @Nonnull default String joinedAtTimestamp(@Nonnull Timestamped.TimestampStyle style)
    • large

      @CheckReturnValue boolean large()
      Returns:
      Whether or not this guild is considered "large."
    • maxPresences

      @Nonnegative @CheckReturnValue int maxPresences()
      Returns:
      The maximum number of presences the guild can have. Will be 0 if no value was present.
    • maxMembers

      @Nonnegative @CheckReturnValue int maxMembers()
      Returns:
      The maximum number of members the guild can have. Will be 0 if no value was present.
    • approximateMemberCount

      @Nonnegative @CheckReturnValue int approximateMemberCount()
      Returns:
      The approximate member count the guild currently has. Will be 0 if no value was present.
    • approximatePresenceCount

      @Nonnegative @CheckReturnValue int approximatePresenceCount()
      Returns:
      The approximate presence count the guild currently has. Will be 0 if no value was present.
    • vanityUrlCode

      @Nullable @CheckReturnValue String vanityUrlCode()
      Returns:
      The vanity invite code for this guild, ie. discord.gg/vanity_code.
    • banner

      @Nullable @CheckReturnValue String banner()
      Returns:
      The guild's banner hash.
    • premiumTier

      @Nonnull @CheckReturnValue Guild.PremiumTier premiumTier()
      Returns:
      The guild's Nitro Boost tier.
    • premiumSubscriptionCount

      @Nonnegative @CheckReturnValue int premiumSubscriptionCount()
      Returns:
      The number of members providing Nitro Boosts to this guild.
    • preferredLocale

      @Nonnull @CheckReturnValue String preferredLocale()
      Returns:
      The preferred locale for this guild. Defaults to en-US. Is only modifiable on guilds that have GuildFeature.DISCOVERABLE set.
    • unavailable

      @CheckReturnValue default boolean unavailable()
      Returns:
      Whether or not this guild is currently unavailable.
    • memberCount

      @Nonnegative @CheckReturnValue default long memberCount()
      Returns:
      The number of users in this guild.
    • roles

      @Nonnull @CheckReturnValue default NamedCacheView<Role> roles()
      Returns:
      All roles in this guild.
    • emojis

      @Nonnull @CheckReturnValue default NamedCacheView<Emoji.CustomEmoji> emojis()
      Returns:
      All custom emoji in this guild.
    • members

      @Nonnull @CheckReturnValue default NamedCacheView<Member> members()
      Returns:
      All members in this guild.
    • channels

      @Nonnull @CheckReturnValue default NamedCacheView<GuildChannel> channels()
      Returns:
      All channels in this guild.
    • voiceStates

      @Nonnull @CheckReturnValue default CacheView<VoiceState> voiceStates()
      Returns:
      All voice states for this guild.
    • member

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> member(String id)
      Parameters:
      id - The id of the member to get.
      Returns:
      The member object for the user with the given id. May be null if the user is not a member of the guild.
    • member

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> member(long id)
      Parameters:
      id - The id of the member to get.
      Returns:
      The member object for the user with the given id. May be null if the user is not a member of the guild.
    • role

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Role> role(String id)
      Parameters:
      id - The id of the role to get.
      Returns:
      The role object with the given id, or null if no such role exists.
    • role

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Role> role(long id)
      Parameters:
      id - The id of the role to get.
      Returns:
      The role object with the given id, or null if no such role exists.
    • channel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<GuildChannel> channel(String id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
    • channel

      @Nonnull @CheckReturnValue default GuildChannel channel(long id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
    • textChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<TextChannel> textChannel(String id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a text channel.
    • textChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<TextChannel> textChannel(long id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a text channel.
    • voiceChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<VoiceChannel> voiceChannel(String id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a voice channel.
    • voiceChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<VoiceChannel> voiceChannel(long id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a voice channel.
    • category

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Category> category(String id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a category.
    • category

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Category> category(long id)
      Parameters:
      id - The id of the channel to get.
      Returns:
      The channel, or null if it isn't present.
      Throws:
      IllegalArgumentException - If the channel is not a category.
    • emoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji> emoji(String id)
      Parameters:
      id - The id of the emoji to fetch.
      Returns:
      The emoji, or null if it isn't present.
    • emoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji> emoji(long id)
      Parameters:
      id - The id of the emoji to fetch.
      Returns:
      The emoji, or null if it isn't present.
    • emojiByName

      @Nonnull @CheckReturnValue default Collection<Emoji.CustomEmoji> emojiByName(String name)
      Parameters:
      name - The name of the emoji to fetch
      Returns:
      A possibly-empty collection of all emojis with matching names.
    • fetchRoles

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Role> fetchRoles()
      Fetch all roles for this guild from the API.
      Returns:
      A Observable that completes when the roles are fetched.
    • fetchChannels

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<GuildChannel> fetchChannels()
      Fetch all channels for this guild from the API.
      Returns:
      A Observable that completes when the channels are fetched.
    • fetchInvites

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<CreatedInvite> fetchInvites()
      Fetch all invites for this guild from the API.
      Returns:
      A Observable that completes when the invites are fetched.
    • fetchWebhooks

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Webhook> fetchWebhooks()
      Fetch all webhooks for this guild.
      Returns:
      A Observable that completes when the webhooks are fetched.
    • fetchEmojis

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Emoji.CustomEmoji> fetchEmojis()
      Fetch all emojis for this guild.
      Returns:
      A Observable that completes when the emojis are fetched.
    • fetchEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> fetchEmoji(@Nonnull String emojiId)
      Fetch a single emoji from this guild.
      Parameters:
      emojiId - The id of the emoji to fetch.
      Returns:
      A Observable that completes when the emoji is fetched.
    • createEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull byte[] image, @Nonnull Collection<String> roles, @Nullable String reason)
      Create a new emoji on the guild.
      Parameters:
      name - The new emoji's name.
      image - The image for the new emoji.
      roles - The roles that can use the new emoji.
      reason - The reason that will be displayed in audit log.
      Returns:
      A Observable that completes when the emoji is created.
    • createEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull byte[] image, @Nonnull Collection<String> roles)
      Create a new emoji on the guild.
      Parameters:
      name - The new emoji's name.
      image - The image for the new emoji.
      roles - The roles that can use the new emoji.
      Returns:
      A Observable that completes when the emoji is created.
    • createEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull URI imageData, @Nonnull Collection<String> roles, @Nullable String reason)
      Create a new emoji on the guild.
      Parameters:
      name - The new emoji's name.
      imageData - The image for the new emoji.
      roles - The roles that can use the new emoji.
      reason - The reason that will be displayed in audit log.
      Returns:
      A Observable that completes when the emoji is created.
    • createEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull URI imageData, @Nonnull Collection<String> roles)
      Create a new emoji on the guild.
      Parameters:
      name - The new emoji's name.
      imageData - The image for the new emoji.
      roles - The roles that can use the new emoji.
      Returns:
      A Observable that completes when the emoji is created.
    • modifyEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> modifyEmoji(@Nonnull String emojiId, @Nonnull String name, @Nonnull Collection<String> roles, @Nullable String reason)
      Modify the given emoji.
      Parameters:
      emojiId - The id of the emoji to modify.
      name - The name of the emoji. To not change it, pass the old name.
      roles - The roles that can use the emoji. To not change it, pass the old roles.
      reason - The reason that will be displayed in audit log.
      Returns:
      A Observable that completes when the emoji is modified.
    • modifyEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> modifyEmoji(@Nonnull String emojiId, @Nonnull String name, @Nonnull Collection<String> roles)
      Modify the given emoji.
      Parameters:
      emojiId - The id of the emoji to modify.
      name - The name of the emoji. To not change it, pass the old name.
      roles - The roles that can use the emoji. To not change it, pass the old roles.
      Returns:
      A Observable that completes when the emoji is modified.
    • deleteEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable deleteEmoji(@Nonnull String emojiId, @Nullable String reason)
      Delete the given emoji from the guild.
      Parameters:
      emojiId - The id of the emoji to delete.
      reason - The reason that will be displayed in audit log.
      Returns:
      A Observable that completes when the emoji is deleted.
    • deleteEmoji

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable deleteEmoji(@Nonnull String emojiId)
      Delete the given emoji from the guild.
      Parameters:
      emojiId - The id of the emoji to delete.
      Returns:
      A Observable that completes when the emoji is deleted.
    • leave

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable leave()
      Leave this guild.
      Returns:
      A Observable that completes when the guild is left.
    • delete

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable delete()
      Delete this guild.
      Returns:
      A Observable that completes when the guild is deleted.
    • closeVoiceConnection

      default void closeVoiceConnection()
      Closes the voice connection for this guild. This method is equivalent to guild.catnip().{@link com.mewna.catnip.Catnip#closeVoiceConnection(String) closeVoiceConnection}(guild.id())
      See Also:
    • edit

      @Nonnull @CheckReturnValue default Guild.GuildEditFields edit()
      Edit this guild.
      Returns:
      A guild editor that can complete the editing.
    • ban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(@Nonnull String userId, @Nullable String reason, @Nonnegative int deleteMessageDays)
      Bans a user from a guild. Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to ban.
      reason - The reason of the ban.
      deleteMessageDays - The history of messages, in days, that will be deleted
      Returns:
      A Observable that completes when the member got banned
    • ban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(long userId, @Nullable String reason, @Nonnegative int deleteMessageDays)
      Bans a user from a guild. Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to ban.
      reason - The reason of the ban.
      deleteMessageDays - The history of messages, in days, that will be deleted
      Returns:
      A Observable that completes when the member got banned
    • ban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(long userId, @Nonnegative int deleteMessageDays)
      Bans a user from a guild. Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to ban.
      deleteMessageDays - The history of messages, in days, that will be deleted
      Returns:
      A Observable that completes when the member got banned
    • ban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(@Nonnull Member member, @Nullable String reason, @Nonnegative int deleteMessageDays)
      Bans a user from a guild. Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      member - The member to ban.
      reason - The reason of the ban.
      deleteMessageDays - The history of messages, in days, that will be deleted
      Returns:
      A Observable that completes when the member got banned
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull String userId, @Nullable String reason)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to unban
      reason - The reason for the unban
      Returns:
      A Observable that completes when the ban got removed
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull String userId)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to unban
      Returns:
      A Observable that completes when the ban got removed
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(long userId, @Nullable String reason)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to unban
      reason - The reason for the unban
      Returns:
      A Observable that completes when the ban got removed
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(long userId)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to unban
      Returns:
      A Observable that completes when the ban got removed
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull User user, @Nullable String reason)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      user - The the user to unban
      reason - The that will be displayed in audit log
      Returns:
      A Observable that completes when the ban got removed
    • unban

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull User user)
      Removes a users ban from the Guild Needs Permission.BAN_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      user - The the user to unban
      Returns:
      A Observable that completes when the ban got removed
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(@Nonnull String userId, @Nullable String reason)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to kick
      reason - The reason for the kick
      Returns:
      A Observable that is finished when the user got kicked
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(@Nonnull String userId)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to kick
      Returns:
      A Observable that is finished when the user got kicked
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(long userId, @Nullable String reason)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to kick
      reason - The reason for the kick
      Returns:
      A Observable that is finished when the user got kicked
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(long userId)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      userId - The id of the user to kick
      Returns:
      A Observable that is finished when the user got kicked
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(Member member, @Nullable String reason)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      member - The member to kick
      reason - The reason for the kick
      Returns:
      A Observable that is finished when the user got kicked
    • kick

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(Member member)
      Kicks a member from the Guild. Needs Permission.KICK_MEMBERS and permission to interact with the target PermissionUtil.canInteract(Member, Member)
      Parameters:
      member - The member to kick
      Returns:
      A Observable that is finished when the user got kicked
    • changeNickName

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<String> changeNickName(@Nonnull String nickname, @Nullable String reason)
      Changes the nick of the bots user on the guild Needs Permission.CHANGE_NICKNAME
      Parameters:
      nickname - The new nickname
      reason - The reason of the nickname change
      Returns:
      A Observable containing the new nickname
      Throws:
      IllegalArgumentException - If the nickname is longer than NICKNAME_MAX_LENGTH
    • modifyGuildMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyGuildMember(@Nonnull Member member, @Nonnull MemberData data)
      Parameters:
      member - The member to modify.
      data - The parts of the member to update.
      Returns:
      A Completable that completes when the update is completed.
    • modifyGuildMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyGuildMember(@Nonnull Member member, @Nonnull MemberData data, @Nullable String reason)
      Parameters:
      member - The member to modify.
      data - The parts of the member to update.
      reason - The audit log reason for the update.
      Returns:
      A Completable that completes when the update is completed.
    • channelPositionUpdater

      @Nonnull @CheckReturnValue default PositionUpdater channelPositionUpdater()
      Returns:
      A new updater for channels in this guild. See PositionUpdater for how to use it.
    • rolePositionUpdater

      @Nonnull @CheckReturnValue default PositionUpdater rolePositionUpdater()
      Returns:
      A new updater for roles in this guild. See PositionUpdater for how to use it.
    • modifyChannelPositions

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyChannelPositions(@Nonnull PositionUpdater updater)
      Modifies the positions of channels. See the docs on PositionUpdater for how to use it.
      Parameters:
      updater - The position updater.
      Returns:
      A Completable that completes when the update is completed.
    • modifyChannelPositions

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyChannelPositions(@Nonnull PositionUpdater updater, @Nullable String reason)
      Modifies the positions of channels. See the docs on PositionUpdater for how to use it.
      Parameters:
      updater - The position updater.
      reason - The reason for the update.
      Returns:
      A Completable that completes when the update is completed.
    • modifyRolePositions

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyRolePositions(@Nonnull PositionUpdater updater)
      Modifies the positions of roles. See the docs on PositionUpdater for how to use it.
      Parameters:
      updater - The position updater.
      Returns:
      A Completable that completes when the update is completed.
    • modifyRolePositions

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyRolePositions(@Nonnull PositionUpdater updater, @Nullable String reason)
      Modifies the positions of roles. See the docs on PositionUpdater for how to use it.
      Parameters:
      updater - The position updater.
      reason - The reason for the update.
      Returns:
      A Completable that completes when the update is completed.
    • changeNickName

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<String> changeNickName(@Nonnull String nickname)
      Changes the nick of the bots user on the guild Needs Permission.CHANGE_NICKNAME
      Parameters:
      nickname - The new nickname
      Returns:
      A Observable containing the new nickname
      Throws:
      IllegalArgumentException - If the nickname is longer than NICKNAME_MAX_LENGTH
    • addRoleToMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRoleToMember(@Nonnull Role role, @Nonnull Member member, @Nullable String reason)
      Adds a role to a member. Needs Permission.MANAGE_ROLES and permission to interact with the role PermissionUtil.canInteract(Member, Role)
      Parameters:
      role - The role to assign
      member - The member to assign the role to
      reason - The reason that will be displayed in audit log
      Returns:
      A Observable that completes when the role got added
    • addRoleToMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRoleToMember(@Nonnull Role role, @Nonnull Member member)
      Adds a role to a member. Needs Permission.MANAGE_ROLES and permission to interact with the role PermissionUtil.canInteract(Member, Role)
      Parameters:
      role - The role to assign
      member - The member to assign the role to
      Returns:
      A Observable that completes when the role got added
    • removeRoleFromMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRoleFromMember(@Nonnull Role role, @Nonnull Member member, @Nullable String reason)
      Removes a role from a member. Needs Permission.MANAGE_ROLES and permission to interact with the role PermissionUtil.canInteract(Member, Role)
      Parameters:
      role - The role to remove
      member - The member to remove the role from
      reason - The reason that will be displayed in audit log
      Returns:
      A Observable that completes when the role got removed
    • removeRoleFromMember

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRoleFromMember(@Nonnull Role role, @Nonnull Member member)
      Removes a role from a member. Needs Permission.MANAGE_ROLES and permission to interact with the role PermissionUtil.canInteract(Member, Role)
      Parameters:
      role - The role to remove
      member - The member to remove the role from
      Returns:
      A Observable that completes when the role got removed
    • createChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildChannel> createChannel(@Nonnull ChannelData data)
      Creates a new channel in this guild.
      Parameters:
      data - The data to create the channel with.
      Returns:
      A Single that completes with the created channel.
    • createChannel

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildChannel> createChannel(@Nonnull ChannelData data, @Nullable String reason)
      Creates a new channel in this guild.
      Parameters:
      data - The data to create the channel with.
      reason - The reason for creating the channel.
      Returns:
      A Single that completes with the created channel.
    • getEmbed

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildEmbed> getEmbed()
      Returns:
      A Single that completes with the embed for this guild.
    • modifyGuildEmbed

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildEmbed> modifyGuildEmbed(@Nonnull GuildChannel channel, boolean enabled)
      Parameters:
      channel - The channel to invite users to.
      enabled - Whether the embed is enabled.
      Returns:
      A Single that completes with the modified embed.
    • modifyGuildEmbed

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildEmbed> modifyGuildEmbed(@Nonnull GuildChannel channel, boolean enabled, @Nullable String reason)
      Parameters:
      channel - The channel to invite users to.
      enabled - Whether the embed is enabled.
      reason - The reason for the modification.
      Returns:
      A Single that completes with the modified embed.
    • vanityInvite

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<CreatedInvite> vanityInvite()
      Returns:
      The vanity invite for this guild, if any.
    • createRole

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Role> createRole(@Nonnull RoleData data)
      Parameters:
      data - The data to create the role with.
      Returns:
      A Single that completes with the created role.
    • createRole

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Role> createRole(@Nonnull RoleData data, @Nullable String reason)
      Parameters:
      data - The data to create the role with.
      reason - The reason for creating this role.
      Returns:
      A Single that completes with the created role.
    • searchMembers

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> searchMembers(@Nonnull String query)
      Searches guild members for a member matching the given query.
      Parameters:
      query - The search query to use
      Returns:
      A Maybe with the member that matches, if any.
    • searchMembers

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Member> searchMembers(@Nonnull String query, @Nonnegative int limit)
      Searches guild members for all members matching the given query.
      Parameters:
      query - The search query to use.
      limit - The maximum number of members to return. Must be 1 <= N <= 100.
      Returns:
      An Observable containing the matched members, if any.