java.lang.Object
java.lang.Record
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.core.YGuild

public record YGuild(net.dv8tion.jda.api.entities.Guild guild) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    YGuild(net.dv8tion.jda.api.entities.Guild guild)
    Creates an instance of a YGuild record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.dv8tion.jda.api.requests.restaction.MemberAction
    addMember(String accessToken, long userId)
     
    net.dv8tion.jda.api.requests.restaction.MemberAction
    addMember(String accessToken, YUser user)
     
    net.dv8tion.jda.api.requests.restaction.MemberAction
    addMember(String accessToken, String userId)
     
    net.dv8tion.jda.api.requests.restaction.MemberAction
    addMember(String accessToken, net.dv8tion.jda.api.entities.User user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    addRoleToMember(long userId, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    addRoleToMember(YMember member, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    addRoleToMember(String userId, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    addRoleToMember(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.Role role)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(@NotNull String userId, int delDays)
    Bans the user specified by the userId and deletes messages sent by the user based on the amount of delDays.
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(@NotNull net.dv8tion.jda.api.entities.Member member, int delDays)
    Bans the Member and deletes messages sent by the user based on the amount of delDays.
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(@NotNull net.dv8tion.jda.api.entities.User user, int delDays)
    Bans the Member and deletes messages sent by the user based on the amount of delDays.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YMember member)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YMember member, int days, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YMember member, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YUser user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YUser user, int days, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(YUser user, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(String userId, int delDays, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.Member member)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.Member member, int days, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.Member member, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.User user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.User user, int days, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(net.dv8tion.jda.api.entities.User user, String reason)
     
    net.dv8tion.jda.api.utils.concurrent.Task<Void>
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    changeUserNickname(YMember member, String nickname)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    changeUserNickname(net.dv8tion.jda.api.entities.Member member, String nickname)
     
    boolean
     
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.Category>
     
    <T extends net.dv8tion.jda.api.entities.ICopyableChannel>
    @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<T>
    Creates a copy of the specified GuildChannel in this Guild.
    @NotNull net.dv8tion.jda.api.requests.restaction.RoleAction
    createCopyOfRole(@NotNull net.dv8tion.jda.api.entities.Role role)
    Creates a new Role in this Guild with the same settings as the given Role.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<net.dv8tion.jda.api.entities.Emote>
    createEmote(String name, net.dv8tion.jda.api.entities.Icon icon, net.dv8tion.jda.api.entities.Role... roles)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.NewsChannel>
    createNewsChannel(@NotNull String name)
    Creates a new NewsChannel in this Guild.
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.NewsChannel>
    createNewsChannel(String name, net.dv8tion.jda.api.entities.Category parent)
     
    net.dv8tion.jda.api.requests.restaction.RoleAction
     
    @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.StageChannel>
    createStageChannel(@NotNull String name)
    Creates a new StageChannel in this Guild.
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.StageChannel>
    createStageChannel(String name, net.dv8tion.jda.api.entities.Category parent)
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.templates.Template>
    createTemplate(String name, String description)
     
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.TextChannel>
     
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.TextChannel>
    createTextChannel(String name, net.dv8tion.jda.api.entities.Category parent)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.VoiceChannel>
    createVoiceChannel(@NotNull String name)
    Creates a new VoiceChannel in this Guild.
    net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.VoiceChannel>
    createVoiceChannel(String name, net.dv8tion.jda.api.entities.Category parent)
     
    net.dv8tion.jda.api.requests.RestAction<Void>
     
    net.dv8tion.jda.api.requests.RestAction<Void>
    delete(String mfaCode)
     
    net.dv8tion.jda.api.requests.RestAction<Void>
    deleteCommandById(long commandId)
     
    net.dv8tion.jda.api.requests.RestAction<Void>
     
    net.dv8tion.jda.api.requests.restaction.CommandEditAction
    editCommandById(long commandId)
     
    net.dv8tion.jda.api.requests.restaction.CommandEditAction
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    findMembers(@NotNull Predicate<? super net.dv8tion.jda.api.entities.Member> filter)
    Retrieves and collects members of this guild into a list.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    findMembersWithRoles(@NotNull Collection<net.dv8tion.jda.api.entities.Role> roles)
    Retrieves and collects members of this guild into a list.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    findMembersWithRoles(@NotNull net.dv8tion.jda.api.entities.Role... roles)
    Retrieves and collects members of this guild into a list.
    net.dv8tion.jda.api.entities.VoiceChannel
     
    net.dv8tion.jda.api.entities.Guild.Timeout
     
    net.dv8tion.jda.api.managers.AudioManager
     
     
    @Nullable String
    The guild banner url.
    int
     
    List<net.dv8tion.jda.api.entities.Member>
     
    @Nullable net.dv8tion.jda.api.entities.Role
    Looks up the role which is the booster role of this guild.
    net.dv8tion.jda.api.entities.Guild.BoostTier
     
     
    @Nullable net.dv8tion.jda.api.entities.Role
    Looks up the role which is the integration role for the currently connected bot (self-user).
    @NotNull List<net.dv8tion.jda.api.entities.Category>
    Gets all Categories in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.Category>
    getCategoriesByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all Categories in this Guild that have the same name as the one provided.
    @Nullable net.dv8tion.jda.api.entities.Category
    getCategoryById(long id)
    Gets the Category from this guild that matches the provided id.
    @Nullable net.dv8tion.jda.api.entities.Category
    getCategoryById(@NotNull String id)
    Gets the Category from this guild that matches the provided id.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.Category>
     
    <T extends net.dv8tion.jda.api.entities.Channel>
    T
    getChannelById(@NotNull Class<T> type, long id)
    Get a channel of the specified type by id.
    <T extends net.dv8tion.jda.api.entities.Channel>
    T
    getChannelById(@NotNull Class<T> type, @NotNull String id)
    Get a channel of the specified type by id.
    @NotNull List<net.dv8tion.jda.api.entities.GuildChannel>
    Populated list of channels for this guild.
    List<net.dv8tion.jda.api.entities.GuildChannel>
    getChannels(boolean includeHidden)
     
    net.dv8tion.jda.api.entities.TextChannel
     
    net.dv8tion.jda.api.entities.BaseGuildMessageChannel
     
    net.dv8tion.jda.api.entities.Guild.NotificationLevel
     
     
    @Nullable net.dv8tion.jda.api.entities.Emote
    getEmoteById(long id)
    Gets an Emote from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.Emote
    getEmoteById(@NotNull String id)
    Gets an Emote from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SnowflakeCacheView<net.dv8tion.jda.api.entities.Emote>
     
    @NotNull List<net.dv8tion.jda.api.entities.Emote>
    Gets all custom Emotes belonging to this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.Emote>
    getEmotesByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all Emotes in this Guild that have the same name as the one provided.
    net.dv8tion.jda.api.entities.Guild.ExplicitContentLevel
     
     
    net.dv8tion.jda.api.entities.GuildChannel
     
    net.dv8tion.jda.api.entities.GuildChannel
     
    net.dv8tion.jda.api.entities.GuildChannel
    getGuildChannelById(net.dv8tion.jda.api.entities.ChannelType type, long id)
     
    net.dv8tion.jda.api.entities.GuildChannel
    getGuildChannelById(net.dv8tion.jda.api.entities.ChannelType type, String id)
    Get GuildChannel for the provided ID.
     
     
     
     
     
    net.dv8tion.jda.api.JDA
     
     
    net.dv8tion.jda.api.managers.GuildManager
     
    int
     
    int
     
    long
     
    int
     
    int
     
     
    getMember(net.dv8tion.jda.api.entities.User user)
     
    @NotNull YMember
    getMemberById(long id)
     
    @NotNull YMember
    getMemberById(@NotNull String id)
     
    @NotNull YMember
    getMemberByTag(@NotNull String tag)
     
    @NotNull YMember
    getMemberByTag(@NotNull String tag, @NotNull String discriminator)
     
    net.dv8tion.jda.api.utils.cache.MemberCacheView
     
    int
     
     
    getMembersByEffectiveName(@NotNull String name, boolean ignoreCase)
     
    getMembersByName(@NotNull String name, boolean ignoreCase)
     
    getMembersByNickname(String nickname, boolean ignoreCase)
     
    @NotNull List<net.dv8tion.jda.api.entities.Member>
    getMembersWithRoles(@NotNull Collection<net.dv8tion.jda.api.entities.Role> roles)
    Gets a list of Members that have all provided Roles.
    getMembersWithRoles(net.dv8tion.jda.api.entities.Role... roles)
     
     
    @Nullable net.dv8tion.jda.api.entities.NewsChannel
    Gets a NewsChannel from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.NewsChannel
    Gets a NewsChannel from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.NewsChannel>
     
    @NotNull List<net.dv8tion.jda.api.entities.NewsChannel>
    Gets all NewsChannels in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.NewsChannel>
    getNewsChannelsByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all NewsChannels in this Guild that have the same name as the one provided.
    net.dv8tion.jda.api.entities.Guild.NSFWLevel
     
     
     
    long
     
     
    net.dv8tion.jda.api.entities.Role
     
    net.dv8tion.jda.api.entities.Guild.MFALevel
     
    @Nullable net.dv8tion.jda.api.entities.Role
    getRoleByBot(long userId)
    Looks up a role which is the integration role for a bot.
    @Nullable net.dv8tion.jda.api.entities.Role
    getRoleByBot(@NotNull String userId)
    Looks up a role which is the integration role for a bot.
    @Nullable net.dv8tion.jda.api.entities.Role
    getRoleByBot(@NotNull net.dv8tion.jda.api.entities.User user)
    Looks up a role which is the integration role for a bot.
    @Nullable net.dv8tion.jda.api.entities.Role
    getRoleById(long id)
    Gets a Role from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.Role
    getRoleById(@NotNull String id)
    Gets a Role from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.Role>
     
    @NotNull List<net.dv8tion.jda.api.entities.Role>
    Gets all Roles in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.Role>
    getRolesByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all Roles in this Guild that have the same name as the one provided.
    net.dv8tion.jda.api.entities.TextChannel
     
    net.dv8tion.jda.api.entities.Member
     
     
    @Nullable net.dv8tion.jda.api.entities.StageChannel
    Gets a StageChannel from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.StageChannel
    Gets a StageChannel from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.StageChannel>
     
    @NotNull List<net.dv8tion.jda.api.entities.StageChannel>
    Gets all StageChannel in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.StageChannel>
    getStageChannelsByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all StageChannel in this Guild that have the same name as the one provided.
    net.dv8tion.jda.api.entities.TextChannel
     
    net.dv8tion.jda.api.entities.TextChannel
     
    net.dv8tion.jda.api.entities.TextChannel
     
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.TextChannel>
     
    @NotNull List<net.dv8tion.jda.api.entities.TextChannel>
    Gets all TextChannels in this Guild.
    List<net.dv8tion.jda.api.entities.TextChannel>
    getTextChannelsByName(String name, boolean ignoreCase)
     
    @Nullable net.dv8tion.jda.api.entities.ThreadChannel
    Gets a ThreadChannel from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.ThreadChannel
    Gets a ThreadChannel from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.ThreadChannel>
     
    @NotNull List<net.dv8tion.jda.api.entities.ThreadChannel>
    Gets all ThreadChannel in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.ThreadChannel>
    getThreadChannelsByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all ThreadChannel in this Guild that have the same name as the one provided.
    The time this entity was created.
     
     
    net.dv8tion.jda.api.entities.Guild.VerificationLevel
     
    @Nullable net.dv8tion.jda.api.entities.VoiceChannel
    Gets a VoiceChannel from this guild that has the same id as the one provided.
    @Nullable net.dv8tion.jda.api.entities.VoiceChannel
    Gets a VoiceChannel from this guild that has the same id as the one provided.
    net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.VoiceChannel>
     
    @NotNull List<net.dv8tion.jda.api.entities.VoiceChannel>
    Gets all VoiceChannels in this Guild.
    @NotNull List<net.dv8tion.jda.api.entities.VoiceChannel>
    getVoiceChannelsByName(@NotNull String name, boolean ignoreCase)
    Gets a list of all VoiceChannels in this Guild that have the same name as the one provided.
    List<net.dv8tion.jda.api.entities.GuildVoiceState>
     
    net.dv8tion.jda.api.entities.Guild
    Returns the value of the guild record component.
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
     
    boolean
     
    boolean
    isMember(net.dv8tion.jda.api.entities.User user)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(@NotNull String userId)
    Kicks the Member specified by the userId from the Guild.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(YMember member)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(YMember member, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(String userId, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(net.dv8tion.jda.api.entities.Member user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(net.dv8tion.jda.api.entities.Member member, String reason)
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<Void>
    kickVoiceMember(@NotNull net.dv8tion.jda.api.entities.Member member)
    Used to kick a Member from a AudioChannel.
    net.dv8tion.jda.api.requests.RestAction<Void>
     
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    Retrieves and collects members of this guild into a list.
    net.dv8tion.jda.api.utils.concurrent.Task<Void>
    loadMembers(Consumer<net.dv8tion.jda.api.entities.Member> callback)
     
    net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    modifyMemberRoles(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.entities.Role... roles)
    Modifies the complete Role set of the specified Member
    The provided roles will replace all current Roles of the specified Member.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    modifyMemberRoles(net.dv8tion.jda.api.entities.Member member, Collection<net.dv8tion.jda.api.entities.Role> roles)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    modifyMemberRoles(net.dv8tion.jda.api.entities.Member member, Collection<net.dv8tion.jda.api.entities.Role> rolesToAdd, Collection<net.dv8tion.jda.api.entities.Role> rolesToRemove)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    modifyNickname(net.dv8tion.jda.api.entities.Member member, String nickname)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.order.RoleOrderAction
    Modifies the positional order of Guild.getRoles() using a specific RestAction extension to allow moving Roles up/down or to a specific position.
    net.dv8tion.jda.api.requests.restaction.order.RoleOrderAction
    modifyRolePositions(boolean useAscendingOrder)
     
    net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction
     
    net.dv8tion.jda.api.requests.restaction.order.CategoryOrderAction
    modifyTextChannelPositions(net.dv8tion.jda.api.entities.Category category)
     
    net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction
     
    net.dv8tion.jda.api.requests.restaction.order.CategoryOrderAction
    modifyVoiceChannelPositions(net.dv8tion.jda.api.entities.Category category)
     
    net.dv8tion.jda.api.requests.RestAction<Void>
    moveVoiceMember(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.AudioChannel audioChannel)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    mute(YMember member, Boolean mute, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    mute(net.dv8tion.jda.api.entities.Member member, Boolean mute, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer>
    prune(int days, boolean wait, net.dv8tion.jda.api.entities.Role... roles)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer>
    prune(int days, @NotNull net.dv8tion.jda.api.entities.Role... roles)
    This method will prune (kick) all members who were offline for at least days days.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer>
    prune(Integer days, net.dv8tion.jda.api.entities.Role... roles)
     
    void
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeRoleFromMember(long userId, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeRoleFromMember(YMember member, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeRoleFromMember(String userId, net.dv8tion.jda.api.entities.Role role)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeRoleFromMember(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.Role role)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeTimeout(@NotNull net.dv8tion.jda.api.entities.Member member)
    Removes a time-out from the specified Member in this Guild.
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    removeTimeoutById(long userId)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    net.dv8tion.jda.api.utils.concurrent.Task<Void>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.ThreadChannel>>
     
    net.dv8tion.jda.api.requests.restaction.pagination.AuditLogPaginationAction
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban>
    retrieveBan(@NotNull YUser bannedUser)
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban>
    retrieveBan(@NotNull net.dv8tion.jda.api.entities.User bannedUser)
    Retrieves a Ban of the provided User
    If you wish to ban or unban a user, use either ban(User, int) or unban(User).
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban>
    retrieveBanById(long userId)
    Retrieves a Ban of the provided ID
    If you wish to ban or unban a user, use either ban(id, int) or unban(id).
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Guild.Ban>>
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command>
    retrieveCommandById(long commandId)
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command>
     
    net.dv8tion.jda.api.requests.RestAction<Map<String,List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.Command>>
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote>
    retrieveEmote(@NotNull net.dv8tion.jda.api.entities.Emote emote)
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote>
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.ListedEmote>>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Invite>>
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveMember(@NotNull YUser user)
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveMember(@NotNull net.dv8tion.jda.api.entities.User user)
    Load the member for the specified user.
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveMember(@NotNull net.dv8tion.jda.api.entities.User user, boolean update)
    Load the member for the specified user.
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    Load the member for the specified user.
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveMemberById(long id, boolean update)
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    Load the member for the specified user.
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveMemberById(@NotNull String id, boolean update)
    Load the member for the specified user.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembers(boolean includePresence, @NotNull Collection<net.dv8tion.jda.api.entities.User> users)
    Retrieves a list of members.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembers(@NotNull Collection<net.dv8tion.jda.api.entities.User> users)
    Retrieves a list of members.
    net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByIds(boolean includePresence, long... ids)
     
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByIds(boolean includePresence, @NotNull String... ids)
    Retrieves a list of members by their user id.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByIds(boolean includePresence, @NotNull Collection<Long> ids)
    Retrieves a list of members by their user id.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByIds(long... ids)
    Retrieves a list of members by their user id.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByIds(@NotNull String... ids)
    Retrieves a list of members by their user id.
    @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    Retrieves a list of members by their user id.
    net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>>
    retrieveMembersByPrefix(String prefix, int limit)
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.MetaData>
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    Shortcut for guild.retrieveMemberById(guild.getOwnerIdLong()).
    @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member>
    retrieveOwner(boolean update)
    Shortcut for guild.retrieveMemberById(guild.getOwnerIdLong()).
    net.dv8tion.jda.api.requests.RestAction<Integer>
     
    @NotNull net.dv8tion.jda.api.requests.RestAction<EnumSet<net.dv8tion.jda.api.Region>>
    Retrieves the available regions for this Guild
    Shortcut for retrieveRegions(true)
    This will include deprecated voice regions by default.
    net.dv8tion.jda.api.requests.RestAction<EnumSet<net.dv8tion.jda.api.Region>>
    retrieveRegions(boolean includeDeprecated)
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.templates.Template>>
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.VanityInvite>
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Webhook>>
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(YMember member, long amount, TimeUnit unit)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(YMember member, Duration duration)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(YMember member, TemporalAccessor temporal)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(net.dv8tion.jda.api.entities.Member member, long amount, TimeUnit unit)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(net.dv8tion.jda.api.entities.Member member, Duration duration)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(net.dv8tion.jda.api.entities.Member member, TemporalAccessor temporal)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutForById(long userId, long amount, TimeUnit unit)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutForById(long userId, Duration duration)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutForById(String userId, long amount, TimeUnit unit)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutForById(String userId, Duration duration)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutUntil(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull TemporalAccessor temporal)
    Puts the specified Member in time out in this Guild until the specified date.
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutUntilById(long userId, TemporalAccessor temporal)
     
    @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    final String
    Returns a string representation of this record class.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    transferOwnership(net.dv8tion.jda.api.entities.Member newOwner)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(YUser user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(YUser user, String reason)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(Long userId)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(String userId)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(net.dv8tion.jda.api.entities.User user)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    unBan(net.dv8tion.jda.api.entities.User user, String reason)
     
    boolean
    unloadMember(long userId)
     
    net.dv8tion.jda.api.requests.RestAction<Map<String,List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>>
    updateCommandPrivileges(Map<String,? extends Collection<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> privileges)
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
    updateCommandPrivilegesById(long id, Collection<? extends net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege> privileges)
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
    updateCommandPrivilegesById(long id, net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege... privileges)
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
    updateCommandPrivilegesById(String id, Collection<? extends net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege> privileges)
     
    net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>
    updateCommandPrivilegesById(String id, net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege... privileges)
     
    net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction
     
    net.dv8tion.jda.api.requests.restaction.CommandCreateAction
    upsertCommand(String name, String description)
     
    net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command>
    upsertCommand(net.dv8tion.jda.api.interactions.commands.build.CommandData command)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • YGuild

      public YGuild(net.dv8tion.jda.api.entities.Guild guild)
      Creates an instance of a YGuild record class.
      Parameters:
      guild - the value for the guild record component
  • Method Details

    • getPermissionChecker

      @Contract(value=" -> new", pure=true) @Nonnull public PermissionChecker getPermissionChecker()
    • getGuildId

      @Nonnull public String getGuildId()
    • getGuildIdLong

      @Nonnull public Long getGuildIdLong()
    • getGuildName

      @Nonnull public String getGuildName()
    • retrieveCommands

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.Command>> retrieveCommands()
      See Also:
      • Guild.retrieveCommands()
    • retrieveCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command> retrieveCommandById(@Nonnull String commandId)
      See Also:
      • Guild.retrieveCommandById(String)
    • retrieveCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command> retrieveCommandById(long commandId)
      See Also:
      • Guild.retrieveCommandById(long)
    • upsertCommand

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.interactions.commands.Command> upsertCommand(@Nonnull net.dv8tion.jda.api.interactions.commands.build.CommandData command)
    • upsertCommand

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.CommandCreateAction upsertCommand(@Nonnull String name, @Nonnull String description)
    • updateCommands

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction updateCommands()
    • editCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.CommandEditAction editCommandById(@Nonnull String commandId)
    • editCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.CommandEditAction editCommandById(long commandId)
    • deleteCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> deleteCommandById(@Nonnull String commandId)
    • deleteCommandById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> deleteCommandById(long commandId)
    • retrieveCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> retrieveCommandPrivilegesById(@Nonnull String commandId)
    • retrieveCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> retrieveCommandPrivilegesById(long commandId)
    • retrieveCommandPrivileges

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<Map<String,List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>> retrieveCommandPrivileges()
    • updateCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> updateCommandPrivilegesById(@Nonnull String id, @Nonnull Collection<? extends net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege> privileges)
    • updateCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> updateCommandPrivilegesById(long id, @Nonnull Collection<? extends net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege> privileges)
    • updateCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> updateCommandPrivilegesById(@Nonnull String id, @Nonnull net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege... privileges)
    • updateCommandPrivilegesById

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> updateCommandPrivilegesById(long id, @Nonnull net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege... privileges)
    • updateCommandPrivileges

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<Map<String,List<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>>> updateCommandPrivileges(@Nonnull Map<String,? extends Collection<net.dv8tion.jda.api.interactions.commands.privileges.CommandPrivilege>> privileges)
    • retrieveRegions

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<EnumSet<net.dv8tion.jda.api.Region>> retrieveRegions()
      Retrieves the available regions for this Guild
      Shortcut for retrieveRegions(true)
      This will include deprecated voice regions by default.
      Returns:
      RestAction - Type EnumSet
    • retrieveRegions

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<EnumSet<net.dv8tion.jda.api.Region>> retrieveRegions(boolean includeDeprecated)
    • addMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.MemberAction addMember(@Nonnull String accessToken, @Nonnull String userId)
    • addMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.MemberAction addMember(@Nonnull String accessToken, @Nonnull net.dv8tion.jda.api.entities.User user)
    • addMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.MemberAction addMember(@Nonnull String accessToken, @Nonnull YUser user)
    • addMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.MemberAction addMember(@Nonnull String accessToken, long userId)
    • isLoaded

      public boolean isLoaded()
    • pruneMemberCache

      public void pruneMemberCache()
    • unloadMember

      public boolean unloadMember(long userId)
    • getMemberCount

      public int getMemberCount()
    • getName

      @Nonnull public String getName()
    • getIconId

      @Nullable public String getIconId()
    • getIconUrl

      @Nullable public String getIconUrl()
    • getFeatures

      @Nonnull public Set<String> getFeatures()
    • getBot

      @Contract(" -> new") @Nonnull public YMember getBot()
    • getMember

      @Contract("_ -> new") @Nonnull public YMember getMember(@Nonnull YUser user)
    • getSplashUrl

      @Nullable public String getSplashUrl()
    • getVanityCode

      @Nullable public String getVanityCode()
    • getAfkTimeout

      @Nonnull public net.dv8tion.jda.api.entities.Guild.Timeout getAfkTimeout()
    • isMember

      public boolean isMember(@Nonnull net.dv8tion.jda.api.entities.User user)
    • getSelfMember

      @Nonnull public net.dv8tion.jda.api.entities.Member getSelfMember()
    • getNSFWLevel

      @Nonnull public net.dv8tion.jda.api.entities.Guild.NSFWLevel getNSFWLevel()
    • getMember

      @Nonnull public YMember getMember(@Nonnull net.dv8tion.jda.api.entities.User user)
    • getMemberCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.MemberCacheView getMemberCache()
    • getMemberById

      @Contract("_ -> new") @NotNull public @NotNull YMember getMemberById(long id)
    • getMemberById

      @Contract("_ -> new") @NotNull public @NotNull YMember getMemberById(@NotNull @NotNull String id)
    • getMemberByTag

      @Contract("_ -> new") @NotNull public @NotNull YMember getMemberByTag(@NotNull @NotNull String tag)
    • getMemberByTag

      @Contract("_, _ -> new") @NotNull public @NotNull YMember getMemberByTag(@NotNull @NotNull String tag, @NotNull @NotNull String discriminator)
    • getMembersByEffectiveName

      public List<YMember> getMembersByEffectiveName(@NotNull @NotNull String name, boolean ignoreCase)
    • getMembersByName

      public List<YMember> getMembersByName(@NotNull @NotNull String name, boolean ignoreCase)
    • getMembersByNickname

      public List<YMember> getMembersByNickname(String nickname, boolean ignoreCase)
    • getMembersWithRoles

      public List<YMember> getMembersWithRoles(net.dv8tion.jda.api.entities.Role... roles)
    • getMembersWithRoles

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Member> getMembersWithRoles(@NotNull @NotNull Collection<net.dv8tion.jda.api.entities.Role> roles)
      Gets a list of Members that have all provided Roles.
      If there are no Members with all provided roles, then this returns an empty list.

      This will only check cached members!
      See MemberCachePolicy

      Parameters:
      roles - The Roles that a Member must have to be included in the returned list.
      Returns:
      Possibly-empty immutable list of Members with all provided Roles.
      Throws:
      IllegalArgumentException - If a provided Role is from a different guild or null.
      See Also:
    • getMembers

      public List<YMember> getMembers()
    • getVanityUrl

      @Nullable public String getVanityUrl()
    • retrieveVanityInvite

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.VanityInvite> retrieveVanityInvite()
    • getDescription

      @Nullable public String getDescription()
    • getLocale

      @Nonnull public Locale getLocale()
    • getBannerId

      @Nullable public String getBannerId()
    • getBannerUrl

      @Nullable public @Nullable String getBannerUrl()
      The guild banner url.
      This is shown in guilds below the guild name.

      The banner can be modified using GuildManager.setBanner(Icon).

      Returns:
      The guild banner url or null
      Since:
      4.0.0
    • getBoostTier

      @Nonnull public net.dv8tion.jda.api.entities.Guild.BoostTier getBoostTier()
    • getBoostCount

      public int getBoostCount()
    • changeUserNickname

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> changeUserNickname(@Nonnull net.dv8tion.jda.api.entities.Member member, String nickname)
    • changeUserNickname

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> changeUserNickname(@Nonnull YMember member, String nickname)
    • unBan

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull net.dv8tion.jda.api.entities.User user, String reason)
    • unBan

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull net.dv8tion.jda.api.entities.User user)
    • unBan

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull String userId)
    • unBan

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull Long userId)
    • unBan

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull YUser user, String reason)
    • unBan

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> unBan(@Nonnull YUser user)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YMember member)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YMember member, String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YMember member, int days, String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.Member member)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.Member member, String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.Member member, int days, String reason)
    • ban

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, int delDays)
      Bans the Member and deletes messages sent by the user based on the amount of delDays.
      If you wish to ban a member without deleting any messages, provide delDays with a value of 0.

      You can unban a user with Guild.unban(User).

      Note: Guild.getMembers() will still contain the Member until Discord sends the GuildMemberRemoveEvent.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be banned due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      member - The Member to ban.
      delDays - The history of messages, in days, that will be deleted.
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot ban the other user due to permission hierarchy position.
      See Member.canInteract(Member)
      IllegalArgumentException -
      • If the provided amount of days (delDays) is less than 0.
      • If the provided amount of days (delDays) is bigger than 7.
      • If the provided member is null
    • ban

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@NotNull @NotNull net.dv8tion.jda.api.entities.User user, int delDays)
      Bans the Member and deletes messages sent by the user based on the amount of delDays.
      If you wish to ban a member without deleting any messages, provide delDays with a value of 0.

      You can unban a user with Guild.unban(User).

      Note: Guild.getMembers() will still contain the Member until Discord sends the GuildMemberRemoveEvent.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be banned due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      user - The User to ban.
      delDays - The history of messages, in days, that will be deleted.
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot ban the other user due to permission hierarchy position.
      See Member.canInteract(Member)
      IllegalArgumentException -
      • If the provided amount of days (delDays) is less than 0.
      • If the provided amount of days (delDays) is bigger than 7.
      • If the provided user is null
    • ban

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@NotNull @NotNull String userId, int delDays)
      Bans the user specified by the userId and deletes messages sent by the user based on the amount of delDays.
      If you wish to ban a user without deleting any messages, provide delDays with a value of 0.

      You can unban a user with Guild.unban(User).

      Note: Guild.getMembers() will still contain the User's Member object (if the User was in the Guild) until Discord sends the GuildMemberRemoveEvent.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be banned due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      userId - The id of the User to ban.
      delDays - The history of messages, in days, that will be deleted.
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot ban the other user due to permission hierarchy position.
      See Member.canInteract(Member)
      IllegalArgumentException -
      • If the provided amount of days (delDays) is less than 0.
      • If the provided amount of days (delDays) is bigger than 7.
      • If the provided userId is null
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.User user)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.User user, String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull net.dv8tion.jda.api.entities.User user, int days, String reason)
    • ban

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull String userId, int delDays, @Nullable String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YUser user)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YUser user, String reason)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(@Nonnull YUser user, int days, String reason)
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@Nonnull YMember member)
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@Nonnull YMember member, String reason)
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@Nonnull net.dv8tion.jda.api.entities.Member user)
    • kick

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@NotNull @NotNull String userId)
      Kicks the Member specified by the userId from the Guild.

      Note: Guild.getMembers() will still contain the User until Discord sends the GuildMemberRemoveEvent.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be kicked due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      userId - The id of the User to kick from the Guild.
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.KICK_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot kick the other member due to permission hierarchy position.
      See Member.canInteract(Member)
      IllegalArgumentException - If the userId provided does not correspond to a Member in this Guild or the provided userId is blank/null.
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@Nonnull net.dv8tion.jda.api.entities.Member member, String reason)
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(@Nonnull String userId, String reason)
    • mute

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> mute(@Nonnull net.dv8tion.jda.api.entities.Member member, Boolean mute, String reason)
    • mute

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> mute(@Nonnull YMember member, Boolean mute, String reason)
    • addRoleToMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> addRoleToMember(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • addRoleToMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> addRoleToMember(@Nonnull YMember member, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • addRoleToMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> addRoleToMember(long userId, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • addRoleToMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> addRoleToMember(@Nonnull String userId, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • removeRoleFromMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeRoleFromMember(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • removeRoleFromMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeRoleFromMember(@Nonnull YMember member, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • removeRoleFromMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeRoleFromMember(@Nonnull String userId, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • modifyMemberRoles

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> modifyMemberRoles(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nullable Collection<net.dv8tion.jda.api.entities.Role> rolesToAdd, @Nullable Collection<net.dv8tion.jda.api.entities.Role> rolesToRemove)
    • modifyMemberRoles

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> modifyMemberRoles(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.entities.Role... roles)
      Modifies the complete Role set of the specified Member
      The provided roles will replace all current Roles of the specified Member.

      Warning

      This may not be used together with any other role add/remove/modify methods for the same Member within one event listener cycle! The changes made by this require cache updates which are triggered by lifecycle events which are received later. This may only be called again once the specific Member has been updated by a GenericGuildMemberEvent targeting the same Member.

      The new roles must not contain the Public Role of the Guild

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The Members Roles could not be modified due to a permission discrepancy
      • UNKNOWN_MEMBER
        The target Member was removed from the Guild before finishing the task

      Example

       
       public static void removeRoles(Member member) {
           Guild guild = member.getGuild();
           // pass no role, this means we set the roles of the member to an empty array.
           guild.modifyMemberRoles(member).queue();
       }
       
       
      Parameters:
      member - A Member of which to override the Roles of
      roles - New collection of Roles for the specified Member
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the currently logged in account does not have Permission.MANAGE_ROLES
      net.dv8tion.jda.api.exceptions.HierarchyException - If the provided roles are higher in the Guild's hierarchy and thus cannot be modified by the currently logged in account
      IllegalArgumentException -
      • If any of the provided arguments is null
      • If any of the provided arguments is not from this Guild
      • If any of the specified Roles is managed
      • If any of the specified Roles is the Public Role of this Guild
      See Also:
    • modifyMemberRoles

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> modifyMemberRoles(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull Collection<net.dv8tion.jda.api.entities.Role> roles)
    • transferOwnership

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> transferOwnership(@Nonnull net.dv8tion.jda.api.entities.Member newOwner)
    • transferOwnership

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> transferOwnership(@Nonnull YMember newOwner)
    • removeRoleFromMember

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeRoleFromMember(long userId, @Nonnull net.dv8tion.jda.api.entities.Role role)
    • prune

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer> prune(@Nonnull Integer days, @Nonnull net.dv8tion.jda.api.entities.Role... roles)
    • prune

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer> prune(int days, boolean wait, @Nonnull net.dv8tion.jda.api.entities.Role... roles)
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull YMember member, long amount, @Nonnull TimeUnit unit)
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull YMember member, @Nonnull Duration duration)
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull YMember member, @Nonnull TemporalAccessor temporal)
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull net.dv8tion.jda.api.entities.Member member, long amount, @Nonnull TimeUnit unit)
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull Duration duration)
    • timeoutUntil

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutUntil(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull TemporalAccessor temporal)
      Puts the specified Member in time out in this Guild until the specified date.
      While a Member is in time out, all permissions except VIEW_CHANNEL and MESSAGE_HISTORY are removed from them.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be put into time out due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      member - The member to put in time out
      temporal - The time the specified Member will be released from time out or null to remove the time-out
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot put a timeout on the other Member due to permission hierarchy position.
      See Member.canInteract(Member)
      IllegalArgumentException - If any of the following are true
      • The provided member is null
      • The provided temporal is in the past
      • The provided temporal is more than 28 days in the future
    • timeoutFor

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull TemporalAccessor temporal)
    • timeoutForById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutForById(long userId, long amount, @Nonnull TimeUnit unit)
    • timeoutForById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutForById(@Nonnull String userId, long amount, @Nonnull TimeUnit unit)
    • timeoutForById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutForById(long userId, @Nonnull Duration duration)
    • timeoutForById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutForById(@Nonnull String userId, @Nonnull Duration duration)
    • timeoutUntilById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutUntilById(long userId, @Nonnull TemporalAccessor temporal)
    • timeoutUntilById

      @CheckReturnValue @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutUntilById(@Nonnull String userId, @Nonnull TemporalAccessor temporal)
    • removeTimeout

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeout(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member)
      Removes a time-out from the specified Member in this Guild.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The time out cannot be removed due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      member - The Member to remove a time-out from
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
      net.dv8tion.jda.api.exceptions.HierarchyException - If the logged in account cannot remove the timeout from the other Member due to permission hierarchy position.
      See Member.canInteract(Member)
    • removeTimeout

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeout(@Nonnull YMember member)
    • removeTimeoutById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeoutById(long userId)
    • removeTimeoutById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeoutById(@Nonnull String userId)
    • getChannelById

      @Nullable public <T extends net.dv8tion.jda.api.entities.Channel> T getChannelById(@NotNull @NotNull Class<T> type, @NotNull @NotNull String id)
      Get a channel of the specified type by id.

      This will automatically check for all channel types and cast to the specified class. If a channel with the specified id does not exist, or exists but is not an instance of the provided class, this returns null.

      Parameters:
      type - Class of a channel type
      id - The snowflake id of the channel
      Returns:
      The casted channel, if it exists and is assignable to the provided class, or null
      Throws:
      IllegalArgumentException - If null is provided, or the id is not a valid snowflake
    • getChannelById

      @Nullable public <T extends net.dv8tion.jda.api.entities.Channel> T getChannelById(@NotNull @NotNull Class<T> type, long id)
      Get a channel of the specified type by id.

      This will automatically check for all channel types and cast to the specified class. If a channel with the specified id does not exist, or exists but is not an instance of the provided class, this returns null.

      Parameters:
      type - Class of a channel type
      id - The snowflake id of the channel
      Returns:
      The casted channel, if it exists and is assignable to the provided class, or null
      Throws:
      IllegalArgumentException - If null is provided
    • getGuildChannelById

      @Nullable public net.dv8tion.jda.api.entities.GuildChannel getGuildChannelById(@Nonnull String id)
    • getGuildChannelById

      @Nullable public net.dv8tion.jda.api.entities.GuildChannel getGuildChannelById(long id)
    • getGuildChannelById

      @Nullable public net.dv8tion.jda.api.entities.GuildChannel getGuildChannelById(@Nonnull net.dv8tion.jda.api.entities.ChannelType type, @Nonnull String id)
      Get GuildChannel for the provided ID.

      This getter exists on any instance of IGuildChannelContainer and only checks the caches with the relevant scoping. For Guild, JDA, or ShardManager, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
      If this is called on JDA or ShardManager, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building your JDA instance, you can use JDA.awaitReady().
      This is meant for systems that use a dynamic ChannelType and can profit from a simple function to get the channel instance.

      To get more specific channel types you can use one of the following:

      Parameters:
      type - The ChannelType
      id - The ID of the channel
      Returns:
      The GuildChannel or null
    • getGuildChannelById

      @Nullable public net.dv8tion.jda.api.entities.GuildChannel getGuildChannelById(@Nonnull net.dv8tion.jda.api.entities.ChannelType type, long id)
    • getStageChannelCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.StageChannel> getStageChannelCache()
    • getStageChannelsByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.StageChannel> getStageChannelsByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all StageChannel in this Guild that have the same name as the one provided.
      If there are no StageChannels with the provided name, then this returns an empty list.
      Parameters:
      name - The name used to filter the returned StageChannels.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all StageChannel names that match the provided name.
    • getStageChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.StageChannel getStageChannelById(@NotNull @NotNull String id)
      Gets a StageChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getStageChannelById(String), but it only checks this specific Guild for a StageChannel.
      If there is no StageChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the StageChannel.
      Returns:
      Possibly-null StageChannel with matching id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
    • getStageChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.StageChannel getStageChannelById(long id)
      Gets a StageChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getStageChannelById(long), but it only checks this specific Guild for a StageChannel.
      If there is no StageChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the StageChannel.
      Returns:
      Possibly-null StageChannel with matching id.
    • getStageChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.StageChannel> getStageChannels()
      Gets all StageChannel in this Guild.
      The channels returned will be sorted according to their position.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getStageChannelCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of StageChannels.
    • getThreadChannelCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.ThreadChannel> getThreadChannelCache()
    • getThreadChannelsByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.ThreadChannel> getThreadChannelsByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all ThreadChannel in this Guild that have the same name as the one provided.
      If there are no ThreadChannels with the provided name, then this returns an empty list.
      Parameters:
      name - The name used to filter the returned ThreadChannels.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all ThreadChannel names that match the provided name.
    • getThreadChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.ThreadChannel getThreadChannelById(@NotNull @NotNull String id)
      Gets a ThreadChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getThreadChannelById(String), but it only checks this specific Guild for a ThreadChannel.
      If there is no ThreadChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the ThreadChannel.
      Returns:
      Possibly-null ThreadChannel with matching id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
    • getThreadChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.ThreadChannel getThreadChannelById(long id)
      Gets a ThreadChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getThreadChannelById(long), but it only checks this specific Guild for a ThreadChannel.
      If there is no ThreadChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the ThreadChannel.
      Returns:
      Possibly-null ThreadChannel with matching id.
    • getThreadChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.ThreadChannel> getThreadChannels()
      Gets all ThreadChannel in this Guild.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getThreadChannelCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of ThreadChannels.
    • getCategoryById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Category getCategoryById(@NotNull @NotNull String id)
      Gets the Category from this guild that matches the provided id. This method is similar to IGuildChannelContainer.getCategoryById(String), but it only checks in this specific Guild.
      If there is no matching Category this returns null.
      Parameters:
      id - The snowflake ID of the wanted Category
      Returns:
      Possibly-null Category for the provided ID.
      Throws:
      IllegalArgumentException - If the provided ID is not a valid long
    • getCategoryById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Category getCategoryById(long id)
      Gets the Category from this guild that matches the provided id. This method is similar to IGuildChannelContainer.getCategoryById(String), but it only checks in this specific Guild.
      If there is no matching Category this returns null.
      Parameters:
      id - The snowflake ID of the wanted Category
      Returns:
      Possibly-null Category for the provided ID.
    • getCategories

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Category> getCategories()
      Gets all Categories in this Guild.
      The returned categories will be sorted according to their position.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getCategoryCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable list of all Categories in this Guild.
    • getCategoriesByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Category> getCategoriesByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all Categories in this Guild that have the same name as the one provided.
      If there are no matching categories this will return an empty list.
      Parameters:
      name - The name to check
      ignoreCase - Whether to ignore case on name checking
      Returns:
      Immutable list of all categories matching the provided name
      Throws:
      IllegalArgumentException - If the provided name is null
    • getCategoryCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.Category> getCategoryCache()
    • getTextChannelCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.TextChannel> getTextChannelCache()
    • getNewsChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.NewsChannel getNewsChannelById(@NotNull @NotNull String id)
      Gets a NewsChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getNewsChannelById(String), but it only checks this specific Guild for a NewsChannel.
      If there is no NewsChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the NewsChannel.
      Returns:
      Possibly-null NewsChannel with matching id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
    • getNewsChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.NewsChannel getNewsChannelById(long id)
      Gets a NewsChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getNewsChannelById(long), but it only checks this specific Guild for a NewsChannel.
      If there is no NewsChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the NewsChannel.
      Returns:
      Possibly-null NewsChannel with matching id.
    • getNewsChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.NewsChannel> getNewsChannels()
      Gets all NewsChannels in this Guild.
      The channels returned will be sorted according to their position.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getNewsChannelCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of all NewsChannels in this Guild.
    • getNewsChannelsByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.NewsChannel> getNewsChannelsByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all NewsChannels in this Guild that have the same name as the one provided.
      If there are no NewsChannels with the provided name, then this returns an empty list.
      Parameters:
      name - The name used to filter the returned NewsChannels.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all NewsChannels names that match the provided name.
    • getNewsChannelCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.NewsChannel> getNewsChannelCache()
    • getVoiceChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.VoiceChannel getVoiceChannelById(@NotNull @NotNull String id)
      Gets a VoiceChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getVoiceChannelById(String), but it only checks this specific Guild for a VoiceChannel.
      If there is no VoiceChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the VoiceChannel.
      Returns:
      Possibly-null VoiceChannel with matching id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
    • getVoiceChannelById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.VoiceChannel getVoiceChannelById(long id)
      Gets a VoiceChannel from this guild that has the same id as the one provided. This method is similar to IGuildChannelContainer.getVoiceChannelById(long), but it only checks this specific Guild for a VoiceChannel.
      If there is no VoiceChannel with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the VoiceChannel.
      Returns:
      Possibly-null VoiceChannel with matching id.
    • getVoiceChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.VoiceChannel> getVoiceChannels()
      Gets all VoiceChannels in this Guild.
      The channels returned will be sorted according to their position.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getVoiceChannelCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of VoiceChannels.
    • getVoiceChannelsByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.VoiceChannel> getVoiceChannelsByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all VoiceChannels in this Guild that have the same name as the one provided.
      If there are no VoiceChannels with the provided name, then this returns an empty list.
      Parameters:
      name - The name used to filter the returned VoiceChannels.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all VoiceChannel names that match the provided name.
    • getVoiceChannelCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.VoiceChannel> getVoiceChannelCache()
    • getChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.GuildChannel> getChannels()
      Populated list of channels for this guild. This includes all types of channels, such as category/voice/text.
      This includes hidden channels by default.

      The returned list is ordered in the same fashion as it would be by the official discord client.

      1. TextChannel and StoreChannel without parent
      2. VoiceChannel without parent
      3. StageChannel without parent
      4. Categories
        1. TextChannel and StoreChannel with category as parent
        2. VoiceChannel with category as parent
        3. StageChannel with category as parent
      Returns:
      Immutable list of channels for this guild
      See Also:
    • getChannels

      @Nonnull public List<net.dv8tion.jda.api.entities.GuildChannel> getChannels(boolean includeHidden)
    • getRoleById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getRoleById(@NotNull @NotNull String id)
      Gets a Role from this guild that has the same id as the one provided.
      If there is no Role with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the Role.
      Returns:
      Possibly-null Role with matching id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
    • getRoleById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getRoleById(long id)
      Gets a Role from this guild that has the same id as the one provided.
      If there is no Role with an id that matches the provided one, then this returns null.
      Parameters:
      id - The id of the Role.
      Returns:
      Possibly-null Role with matching id.
    • getRoles

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Role> getRoles()
      Gets all Roles in this Guild.
      The roles returned will be sorted according to their position. The highest role being at index 0 and the lowest at the last index.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getRoleCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of Roles.
    • getRolesByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Role> getRolesByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all Roles in this Guild that have the same name as the one provided.
      If there are no Roles with the provided name, then this returns an empty list.
      Parameters:
      name - The name used to filter the returned Roles.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all Role names that match the provided name.
    • getRoleByBot

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getRoleByBot(long userId)
      Looks up a role which is the integration role for a bot.
      These roles are created when the bot requested a list of permission in the authorization URL.

      To check whether a role is a bot role you can use role.getTags().isBot() and you can use Role.RoleTags.getBotIdLong() to check which bot it applies to.

      This requires CacheFlag.ROLE_TAGS to be enabled. See JDABuilder.enableCache(...).

      Parameters:
      userId - The user id of the bot
      Returns:
      The bot role, or null if no role matches
    • getRoleByBot

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getRoleByBot(@NotNull @NotNull String userId)
      Looks up a role which is the integration role for a bot.
      These roles are created when the bot requested a list of permission in the authorization URL.

      To check whether a role is a bot role you can use role.getTags().isBot() and you can use Role.RoleTags.getBotIdLong() to check which bot it applies to.

      This requires CacheFlag.ROLE_TAGS to be enabled. See JDABuilder.enableCache(...).

      Parameters:
      userId - The user id of the bot
      Returns:
      The bot role, or null if no role matches
      Throws:
      IllegalArgumentException - If the userId is null or not a valid snowflake
    • getRoleByBot

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getRoleByBot(@NotNull @NotNull net.dv8tion.jda.api.entities.User user)
      Looks up a role which is the integration role for a bot.
      These roles are created when the bot requested a list of permission in the authorization URL.

      To check whether a role is a bot role you can use role.getTags().isBot() and you can use Role.RoleTags.getBotIdLong() to check which bot it applies to.

      This requires CacheFlag.ROLE_TAGS to be enabled. See JDABuilder.enableCache(...).

      Parameters:
      user - The bot user
      Returns:
      The bot role, or null if no role matches
      Throws:
      IllegalArgumentException - If null is provided
    • getBotRole

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getBotRole()
      Looks up the role which is the integration role for the currently connected bot (self-user).
      These roles are created when the bot requested a list of permission in the authorization URL.

      To check whether a role is a bot role you can use role.getTags().isBot() and you can use Role.RoleTags.getBotIdLong() to check which bot it applies to.

      This requires CacheFlag.ROLE_TAGS to be enabled. See JDABuilder.enableCache(...).

      Returns:
      The bot role, or null if no role matches
    • getBoostRole

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Role getBoostRole()
      Looks up the role which is the booster role of this guild.
      These roles are created when the first user boosts this guild.

      To check whether a role is a booster role you can use role.getTags().isBoost().

      This requires CacheFlag.ROLE_TAGS to be enabled. See JDABuilder.enableCache(...).

      Returns:
      The boost role, or null if no role matches
    • getRoleCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SortedSnowflakeCacheView<net.dv8tion.jda.api.entities.Role> getRoleCache()
    • getEmoteById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Emote getEmoteById(@NotNull @NotNull String id)
      Gets an Emote from this guild that has the same id as the one provided.
      If there is no Emote with an id that matches the provided one, then this returns null.

      Unicode emojis are not included as Emote!

      This requires the CacheFlag.EMOTE to be enabled!

      Parameters:
      id - the emote id
      Returns:
      An Emote matching the specified Id.
      Throws:
      NumberFormatException - If the provided id cannot be parsed by Long.parseLong(String)
      See Also:
    • getEmoteById

      @Nullable public @Nullable net.dv8tion.jda.api.entities.Emote getEmoteById(long id)
      Gets an Emote from this guild that has the same id as the one provided.
      If there is no Emote with an id that matches the provided one, then this returns null.

      Unicode emojis are not included as Emote!

      This requires the CacheFlag.EMOTE to be enabled!

      Parameters:
      id - the emote id
      Returns:
      An Emote matching the specified Id.
      See Also:
    • getEmotes

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Emote> getEmotes()
      Gets all custom Emotes belonging to this Guild.
      Emotes are not ordered in any specific way in the returned list.

      Unicode emojis are not included as Emote!

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getEmoteCache() and use its more efficient versions of handling these values.

      This requires the CacheFlag.EMOTE to be enabled!

      Returns:
      An immutable List of Emotes.
      See Also:
    • getEmotesByName

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.Emote> getEmotesByName(@NotNull @NotNull String name, boolean ignoreCase)
      Gets a list of all Emotes in this Guild that have the same name as the one provided.
      If there are no Emotes with the provided name, then this returns an empty list.

      Unicode emojis are not included as Emote!

      This requires the CacheFlag.EMOTE to be enabled!

      Parameters:
      name - The name used to filter the returned Emotes. Without colons.
      ignoreCase - Determines if the comparison ignores case when comparing. True - case-insensitive.
      Returns:
      Possibly-empty immutable list of all Emotes that match the provided name.
    • getEmoteCache

      @Nonnull public net.dv8tion.jda.api.utils.cache.SnowflakeCacheView<net.dv8tion.jda.api.entities.Emote> getEmoteCache()
    • retrieveEmotes

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.ListedEmote>> retrieveEmotes()
    • retrieveEmoteById

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote> retrieveEmoteById(@Nonnull String id)
    • retrieveEmoteById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote> retrieveEmoteById(long id)
    • retrieveEmote

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.ListedEmote> retrieveEmote(@NotNull @NotNull net.dv8tion.jda.api.entities.Emote emote)
    • retrieveBanList

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Guild.Ban>> retrieveBanList()
    • retrieveBanById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban> retrieveBanById(long userId)
      Retrieves a Ban of the provided ID
      If you wish to ban or unban a user, use either ban(id, int) or unban(id).

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The ban list cannot be fetched due to a permission discrepancy
      • UNKNOWN_BAN
        Either the ban was removed before finishing the task or it did not exist in the first place
      Parameters:
      userId - the id of the banned user
      Returns:
      RestAction - Type: Ban
      An unmodifiable ban object for the user banned from this guild
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
    • retrieveBanById

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban> retrieveBanById(@Nonnull String userId)
    • retrieveBan

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban> retrieveBan(@NotNull @NotNull net.dv8tion.jda.api.entities.User bannedUser)
      Retrieves a Ban of the provided User
      If you wish to ban or unban a user, use either ban(User, int) or unban(User).

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The ban list cannot be fetched due to a permission discrepancy
      • UNKNOWN_BAN
        Either the ban was removed before finishing the task or it did not exist in the first place
      Parameters:
      bannedUser - the banned user
      Returns:
      RestAction - Type: Ban
      An unmodifiable ban object for the user banned from this guild
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
    • retrieveBan

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.Ban> retrieveBan(@NotNull @NotNull YUser bannedUser)
      Parameters:
      bannedUser - the banned user
      Returns:
      RestAction - Type: Ban
      An unmodifiable ban object for the user banned from this guild
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.BAN_MEMBERS permission.
    • retrievePrunableMemberCount

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<Integer> retrievePrunableMemberCount(int days)
    • getPublicRole

      @Nonnull public net.dv8tion.jda.api.entities.Role getPublicRole()
    • getDefaultChannel

      @Nullable public net.dv8tion.jda.api.entities.BaseGuildMessageChannel getDefaultChannel()
    • getManager

      @Nonnull public net.dv8tion.jda.api.managers.GuildManager getManager()
    • isBoostProgressBarEnabled

      public boolean isBoostProgressBarEnabled()
    • retrieveAuditLogs

      @Nonnull public net.dv8tion.jda.api.requests.restaction.pagination.AuditLogPaginationAction retrieveAuditLogs()
    • leave

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> leave()
    • delete

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> delete()
    • delete

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> delete(@Nullable String mfaCode)
    • getAudioManager

      @Nonnull public net.dv8tion.jda.api.managers.AudioManager getAudioManager()
    • requestToSpeak

      @Nonnull public net.dv8tion.jda.api.utils.concurrent.Task<Void> requestToSpeak()
    • cancelRequestToSpeak

      @Nonnull public net.dv8tion.jda.api.utils.concurrent.Task<Void> cancelRequestToSpeak()
    • getJDA

      @Nonnull public net.dv8tion.jda.api.JDA getJDA()
    • retrieveInvites

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Invite>> retrieveInvites()
    • retrieveTemplates

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.templates.Template>> retrieveTemplates()
    • createTemplate

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.templates.Template> createTemplate(@Nonnull String name, @Nullable String description)
    • retrieveWebhooks

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.Webhook>> retrieveWebhooks()
    • getVoiceStates

      @Nonnull public List<net.dv8tion.jda.api.entities.GuildVoiceState> getVoiceStates()
    • getVerificationLevel

      @Nonnull public net.dv8tion.jda.api.entities.Guild.VerificationLevel getVerificationLevel()
    • getDefaultNotificationLevel

      @Nonnull public net.dv8tion.jda.api.entities.Guild.NotificationLevel getDefaultNotificationLevel()
    • getRequiredMFALevel

      @Nonnull public net.dv8tion.jda.api.entities.Guild.MFALevel getRequiredMFALevel()
    • getExplicitContentLevel

      @Nonnull public net.dv8tion.jda.api.entities.Guild.ExplicitContentLevel getExplicitContentLevel()
    • loadMembers

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> loadMembers()
      Retrieves and collects members of this guild into a list.
      This will use the configured MemberCachePolicy to decide which members to retain in cache.

      You can use findMembers(Predicate) to filter specific members.

      This requires the privileged GatewayIntent.GUILD_MEMBERS to be enabled!

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Returns:
      Task - Type: List of Member
      Throws:
      IllegalStateException - If the GatewayIntent.GUILD_MEMBERS is not enabled
    • findMembers

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> findMembers(@NotNull @NotNull Predicate<? super net.dv8tion.jda.api.entities.Member> filter)
      Retrieves and collects members of this guild into a list.
      This will use the configured MemberCachePolicy to decide which members to retain in cache.

      This requires the privileged GatewayIntent.GUILD_MEMBERS to be enabled!

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      filter - Filter to decide which members to include
      Returns:
      Task - Type: List of Member
      Throws:
      IllegalArgumentException - If the provided filter is null
      IllegalStateException - If the GatewayIntent.GUILD_MEMBERS is not enabled
    • findMembersWithRoles

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> findMembersWithRoles(@NotNull @NotNull Collection<net.dv8tion.jda.api.entities.Role> roles)
      Retrieves and collects members of this guild into a list.
      This will use the configured MemberCachePolicy to decide which members to retain in cache.

      This requires the privileged GatewayIntent.GUILD_MEMBERS to be enabled!

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      roles - Collection of all roles the members must have
      Returns:
      Task - Type: List of Member
      Throws:
      IllegalArgumentException - If null is provided
      IllegalStateException - If the GatewayIntent.GUILD_MEMBERS is not enabled
      Since:
      4.2.1
    • findMembersWithRoles

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> findMembersWithRoles(@NotNull @NotNull net.dv8tion.jda.api.entities.Role... roles)
      Retrieves and collects members of this guild into a list.
      This will use the configured MemberCachePolicy to decide which members to retain in cache.

      This requires the privileged GatewayIntent.GUILD_MEMBERS to be enabled!

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      roles - All roles the members must have
      Returns:
      Task - Type: List of Member
      Throws:
      IllegalArgumentException - If null is provided
      IllegalStateException - If the GatewayIntent.GUILD_MEMBERS is not enabled
      Since:
      4.2.1
    • loadMembers

      @Nonnull public net.dv8tion.jda.api.utils.concurrent.Task<Void> loadMembers(@Nonnull Consumer<net.dv8tion.jda.api.entities.Member> callback)
    • retrieveMember

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMember(@NotNull @NotNull net.dv8tion.jda.api.entities.User user)
      Load the member for the specified user.
      If the member is already loaded it will be retrieved from getMemberById(long) and immediately provided if the member information is consistent. The cache consistency directly relies on the enabled GatewayIntents as GatewayIntent.GUILD_MEMBERS is required to keep the cache updated with the latest information. You can pass update = false to always return immediately if the member is cached regardless of cache consistency.

      When the intent GUILD_MEMBERS is disabled this will always make a request even if the member is cached. You can use retrieveMember(User, boolean) to disable this behavior.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      user - The user to load the member from
      Returns:
      RestAction - Type: Member
      Throws:
      IllegalArgumentException - If provided with null
      See Also:
    • retrieveMember

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMember(@NotNull @NotNull YUser user)
    • retrieveMemberById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMemberById(@NotNull @NotNull String id)
      Load the member for the specified user.
      If the member is already loaded it will be retrieved from getMemberById(long) and immediately provided if the member information is consistent. The cache consistency directly relies on the enabled GatewayIntents as GatewayIntent.GUILD_MEMBERS is required to keep the cache updated with the latest information. You can pass update = false to always return immediately if the member is cached regardless of cache consistency.

      When the intent GUILD_MEMBERS is disabled this will always make a request even if the member is cached. You can use retrieveMemberById(String, boolean) to disable this behavior.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      id - The user id to load the member from
      Returns:
      RestAction - Type: Member
      Throws:
      IllegalArgumentException - If the provided id is empty or null
      NumberFormatException - If the provided id is not a snowflake
      See Also:
    • retrieveMemberById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMemberById(long id)
      Load the member for the specified user.
      If the member is already loaded it will be retrieved from getMemberById(long) and immediately provided if the member information is consistent. The cache consistency directly relies on the enabled GatewayIntents as GatewayIntent.GUILD_MEMBERS is required to keep the cache updated with the latest information. You can pass update = false to always return immediately if the member is cached regardless of cache consistency.

      When GatewayIntent.GUILD_MEMBERS is disabled this will always make a request even if the member is cached. You can use retrieveMemberById(long, boolean) to disable this behavior.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      id - The user id to load the member from
      Returns:
      RestAction - Type: Member
      See Also:
    • retrieveOwner

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveOwner()
      Shortcut for guild.retrieveMemberById(guild.getOwnerIdLong()).
      This will retrieve the current owner of the guild. It is possible that the owner of a guild is no longer a registered discord user in which case this will fail.

      When GatewayIntent.GUILD_MEMBERS is disabled this will always make a request even if the member is cached. You can use retrieveOwner(boolean) to disable this behavior.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Returns:
      RestAction - Type: Member
      See Also:
    • retrieveMember

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMember(@NotNull @NotNull net.dv8tion.jda.api.entities.User user, boolean update)
      Load the member for the specified user.
      If the member is already loaded it will be retrieved from getMemberById(long) and immediately provided if the member information is consistent. The cache consistency directly relies on the enabled GatewayIntents as GatewayIntent.GUILD_MEMBERS is required to keep the cache updated with the latest information. You can pass update = false to always return immediately if the member is cached regardless of cache consistency.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      user - The user to load the member from
      update - Whether JDA should perform a request even if the member is already cached to update properties such as the name
      Returns:
      RestAction - Type: Member
      Throws:
      IllegalArgumentException - If provided with null
      See Also:
    • retrieveMemberById

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMemberById(@NotNull @NotNull String id, boolean update)
      Load the member for the specified user.
      If the member is already loaded it will be retrieved from getMemberById(long) and immediately provided if the member information is consistent. The cache consistency directly relies on the enabled GatewayIntents as GatewayIntent.GUILD_MEMBERS is required to keep the cache updated with the latest information. You can pass update = false to always return immediately if the member is cached regardless of cache consistency.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      id - The user id to load the member from
      update - Whether JDA should perform a request even if the member is already cached to update properties such as the name
      Returns:
      RestAction - Type: Member
      Throws:
      IllegalArgumentException - If the provided id is empty or null
      NumberFormatException - If the provided id is not a snowflake
      See Also:
    • retrieveMemberById

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveMemberById(long id, boolean update)
    • retrieveOwner

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Member> retrieveOwner(boolean update)
      Shortcut for guild.retrieveMemberById(guild.getOwnerIdLong()).
      This will retrieve the current owner of the guild. It is possible that the owner of a guild is no longer a registered discord user in which case this will fail.

      Possible ErrorResponseExceptions include:

      • ErrorResponse.UNKNOWN_MEMBER
        The specified user is not a member of this guild
      • ErrorResponse.UNKNOWN_USER
        The specified user does not exist
      Parameters:
      update - Whether JDA should perform a request even if the member is already cached to update properties such as the name
      Returns:
      RestAction - Type: Member
      See Also:
    • retrieveMembers

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembers(@NotNull @NotNull Collection<net.dv8tion.jda.api.entities.User> users)
      Retrieves a list of members.
      If the user does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the users resolve to a member, in which case an empty list will be the result.

      If the GUILD_PRESENCES intent is enabled, this will load the OnlineStatus and Activities of the members. You can use retrieveMembers(boolean, Collection) to disable presences.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      users - The users of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembersByIds

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(@NotNull @NotNull Collection<Long> ids)
      Retrieves a list of members by their user id.
      If the id does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the IDs resolve to a member, in which case an empty list will be the result.

      If the GUILD_PRESENCES intent is enabled, this will load the OnlineStatus and Activities of the members. You can use retrieveMembersByIds(boolean, Collection) to disable presences.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      ids - The ids of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembersByIds

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(@NotNull @NotNull String... ids)
      Retrieves a list of members by their user id.
      If the id does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the IDs resolve to a member, in which case an empty list will be the result.

      If the GUILD_PRESENCES intent is enabled, this will load the OnlineStatus and Activities of the members. You can use retrieveMembersByIds(boolean, String...) to disable presences.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      ids - The ids of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembersByIds

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(long... ids)
      Retrieves a list of members by their user id.
      If the id does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the IDs resolve to a member, in which case an empty list will be the result.

      If the GUILD_PRESENCES intent is enabled, this will load the OnlineStatus and Activities of the members. You can use retrieveMembersByIds(boolean, long...) to disable presences.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      ids - The ids of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembers

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembers(boolean includePresence, @NotNull @NotNull Collection<net.dv8tion.jda.api.entities.User> users)
      Retrieves a list of members.
      If the user does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the users resolve to a member, in which case an empty list will be the result.

      You can only load presences with the GUILD_PRESENCES intent enabled.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      includePresence - Whether to load presences of the members (online status/activity)
      users - The users of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If includePresence is true and the GUILD_PRESENCES intent is disabled
      • If the input contains null
      • If the input is more than 100 users
    • retrieveMembersByIds

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(boolean includePresence, @NotNull @NotNull Collection<Long> ids)
      Retrieves a list of members by their user id.
      If the id does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the IDs resolve to a member, in which case an empty list will be the result.

      You can only load presences with the GUILD_PRESENCES intent enabled.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      includePresence - Whether to load presences of the members (online status/activity)
      ids - The ids of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If includePresence is true and the GUILD_PRESENCES intent is disabled
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembersByIds

      @NotNull public @NotNull net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(boolean includePresence, @NotNull @NotNull String... ids)
      Retrieves a list of members by their user id.
      If the id does not resolve to a member of this guild, then it will not appear in the resulting list. It is possible that none of the IDs resolve to a member, in which case an empty list will be the result.

      You can only load presences with the GUILD_PRESENCES intent enabled.

      The requests automatically timeout after 10 seconds. When the timeout occurs a TimeoutException will be used to complete exceptionally.

      You MUST NOT use blocking operations such as Task.get()! The response handling happens on the event thread by default.

      Parameters:
      includePresence - Whether to load presences of the members (online status/activity)
      ids - The ids of the members (max 100)
      Returns:
      Task handle for the request
      Throws:
      IllegalArgumentException -
      • If includePresence is true and the GUILD_PRESENCES intent is disabled
      • If the input contains null
      • If the input is more than 100 IDs
    • retrieveMembersByIds

      @Nonnull public net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByIds(boolean includePresence, long... ids)
    • retrieveMembersByPrefix

      @Nonnull public net.dv8tion.jda.api.utils.concurrent.Task<List<net.dv8tion.jda.api.entities.Member>> retrieveMembersByPrefix(@Nonnull String prefix, int limit)
    • retrieveActiveThreads

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<List<net.dv8tion.jda.api.entities.ThreadChannel>> retrieveActiveThreads()
    • moveVoiceMember

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<Void> moveVoiceMember(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nullable net.dv8tion.jda.api.entities.AudioChannel audioChannel)
    • kickVoiceMember

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<Void> kickVoiceMember(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member)
      Used to kick a Member from a AudioChannel.
      As a note, you cannot kick a Member that isn't already in a AudioChannel. Also, they must be in a AudioChannel in the same Guild.

      Equivalent to moveVoiceMember(member, null).

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be moved due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      • UNKNOWN_CHANNEL
        The specified channel was deleted before finishing the task
      Parameters:
      member - The Member that you are moving.
      Returns:
      RestAction
      Throws:
      IllegalStateException - If the Member isn't currently in a AudioChannel in this Guild, or CacheFlag.VOICE_STATE is disabled.
      IllegalArgumentException -
      • If any of the provided arguments is null
      • If the provided Member isn't part of this Guild
      • If the provided AudioChannel isn't part of this Guild
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If this account doesn't have Permission.VOICE_MOVE_OTHERS in the AudioChannel that the Member is currently in.
    • modifyNickname

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> modifyNickname(@Nonnull net.dv8tion.jda.api.entities.Member member, @Nullable String nickname)
    • prune

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Integer> prune(int days, @NotNull @NotNull net.dv8tion.jda.api.entities.Role... roles)
      This method will prune (kick) all members who were offline for at least days days.
      The RestAction returned from this method will return the amount of Members that were pruned.
      You can use Guild.retrievePrunableMemberCount(int) to determine how many Members would be pruned if you were to call this method.

      This might time out when pruning many members. You can use prune(days, false) to ignore the prune count and avoid a timeout.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The prune cannot finished due to a permission discrepancy
      Parameters:
      days - Minimum number of days since a member has been offline to get affected.
      roles - Optional roles to include in prune filter
      Returns:
      AuditableRestAction - Type: Integer
      The amount of Members that were pruned from the Guild.
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the account doesn't have KICK_MEMBER Permission.
      IllegalArgumentException -
      • If the provided days are not in the range from 1 to 30 (inclusive)
      • If null is provided
      • If any of the provided roles is not from this guild
    • modifyRolePositions

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.order.RoleOrderAction modifyRolePositions(boolean useAscendingOrder)
    • getBoosters

      @Nonnull public List<net.dv8tion.jda.api.entities.Member> getBoosters()
      See Also:
      • Guild.getBoosters()
    • getMaxBitrate

      public int getMaxBitrate()
      See Also:
      • Guild.getMaxBitrate()
    • getMaxFileSize

      public long getMaxFileSize()
      See Also:
      • Guild.getMaxFileSize()
    • getMaxEmotes

      public int getMaxEmotes()
      See Also:
      • Guild.getMaxEmotes()
    • getMaxMembers

      public int getMaxMembers()
    • getMaxPresences

      public int getMaxPresences()
    • retrieveMetaData

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.Guild.MetaData> retrieveMetaData()
    • getAfkChannel

      @Nullable public net.dv8tion.jda.api.entities.VoiceChannel getAfkChannel()
    • getSystemChannel

      @Nullable public net.dv8tion.jda.api.entities.TextChannel getSystemChannel()
    • getRulesChannel

      @Nullable public net.dv8tion.jda.api.entities.TextChannel getRulesChannel()
    • getCommunityUpdatesChannel

      @Nullable public net.dv8tion.jda.api.entities.TextChannel getCommunityUpdatesChannel()
    • isMember

      public boolean isMember(@Nonnull YUser user)
    • createTextChannel

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.TextChannel> createTextChannel(@Nonnull String name)
    • createTextChannel

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.TextChannel> createTextChannel(@Nonnull String name, @Nonnull net.dv8tion.jda.api.entities.Category parent)
    • createNewsChannel

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.NewsChannel> createNewsChannel(@NotNull @NotNull String name)
      Creates a new NewsChannel in this Guild. For this to be successful, the logged in account has to have the MANAGE_CHANNEL Permission

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The channel could not be created due to a permission discrepancy
      • MAX_CHANNELS
        The maximum number of channels were exceeded
      Parameters:
      name - The name of the NewsChannel to create
      Returns:
      A specific ChannelAction
      This action allows setting fields for the new NewsChannel before creating it
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MANAGE_CHANNEL permission
      IllegalArgumentException - If the provided name is null or empty or greater than 100 characters in length
    • createNewsChannel

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.NewsChannel> createNewsChannel(@Nonnull String name, @Nullable net.dv8tion.jda.api.entities.Category parent)
    • createVoiceChannel

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.VoiceChannel> createVoiceChannel(@NotNull @NotNull String name)
      Creates a new VoiceChannel in this Guild. For this to be successful, the logged in account has to have the MANAGE_CHANNEL Permission.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The channel could not be created due to a permission discrepancy
      • MAX_CHANNELS
        The maximum number of channels were exceeded
      Parameters:
      name - The name of the VoiceChannel to create
      Returns:
      A specific ChannelAction
      This action allows setting fields for the new VoiceChannel before creating it
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MANAGE_CHANNEL permission
      IllegalArgumentException - If the provided name is null or empty or greater than 100 characters in length
    • createVoiceChannel

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.VoiceChannel> createVoiceChannel(@Nonnull String name, @Nullable net.dv8tion.jda.api.entities.Category parent)
    • createStageChannel

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.StageChannel> createStageChannel(@NotNull @NotNull String name)
      Creates a new StageChannel in this Guild. For this to be successful, the logged in account has to have the MANAGE_CHANNEL Permission.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The channel could not be created due to a permission discrepancy
      • MAX_CHANNELS
        The maximum number of channels were exceeded
      Parameters:
      name - The name of the StageChannel to create
      Returns:
      A specific ChannelAction
      This action allows setting fields for the new StageChannel before creating it
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MANAGE_CHANNEL permission
      IllegalArgumentException - If the provided name is null or empty or greater than 100 characters in length
    • createStageChannel

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.StageChannel> createStageChannel(@Nonnull String name, @Nullable net.dv8tion.jda.api.entities.Category parent)
    • createCategory

      @Nonnull public net.dv8tion.jda.api.requests.restaction.ChannelAction<net.dv8tion.jda.api.entities.Category> createCategory(@Nonnull String name)
    • createCopyOfChannel

      @NotNull public <T extends net.dv8tion.jda.api.entities.ICopyableChannel> @NotNull net.dv8tion.jda.api.requests.restaction.ChannelAction<T> createCopyOfChannel(@NotNull T channel)
      Creates a copy of the specified GuildChannel in this Guild.
      The provided channel need not be in the same Guild for this to work!

      This copies the following elements:

      1. Name
      2. Parent Category (if present)
      3. Voice Elements (Bitrate, Userlimit)
      4. Text Elements (Topic, NSFW)
      5. All permission overrides for Members/Roles

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The channel could not be created due to a permission discrepancy
      • MAX_CHANNELS
        The maximum number of channels were exceeded
      Parameters:
      channel - The GuildChannel to use for the copy template
      Returns:
      A specific ChannelAction
      This action allows setting fields for the new GuildChannel before creating it!
      Throws:
      IllegalArgumentException - If the provided channel is null
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the currently logged in account does not have the MANAGE_CHANNEL Permission
      Since:
      3.1
      See Also:
    • createRole

      @Nonnull public net.dv8tion.jda.api.requests.restaction.RoleAction createRole()
    • createCopyOfRole

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.RoleAction createCopyOfRole(@NotNull @NotNull net.dv8tion.jda.api.entities.Role role)
      Creates a new Role in this Guild with the same settings as the given Role.
      The position of the specified Role does not matter in this case!

      It will be placed at the bottom (just over the Public Role) to avoid permission hierarchy conflicts.
      For this to be successful, the logged in account has to have the MANAGE_ROLES Permission and all Permissions the given Role has.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The role could not be created due to a permission discrepancy
      • MAX_ROLES_PER_GUILD
        There are too many roles in this Guild
      Parameters:
      role - The Role that should be copied
      Returns:
      RoleAction
      RoleAction with already copied values from the specified Role
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MANAGE_ROLES Permission and every Permission the provided Role has
      IllegalArgumentException - If the specified role is null
    • createEmote

      @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<net.dv8tion.jda.api.entities.Emote> createEmote(@Nonnull String name, @Nonnull net.dv8tion.jda.api.entities.Icon icon, @Nonnull net.dv8tion.jda.api.entities.Role... roles)
    • modifyCategoryPositions

      @Nonnull public net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction modifyCategoryPositions()
    • modifyTextChannelPositions

      @Nonnull public net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction modifyTextChannelPositions()
    • modifyVoiceChannelPositions

      @Nonnull public net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction modifyVoiceChannelPositions()
    • modifyTextChannelPositions

      @Nonnull public net.dv8tion.jda.api.requests.restaction.order.CategoryOrderAction modifyTextChannelPositions(@Nonnull net.dv8tion.jda.api.entities.Category category)
    • modifyVoiceChannelPositions

      @Nonnull public net.dv8tion.jda.api.requests.restaction.order.CategoryOrderAction modifyVoiceChannelPositions(@Nonnull net.dv8tion.jda.api.entities.Category category)
    • modifyRolePositions

      @NotNull public @NotNull net.dv8tion.jda.api.requests.restaction.order.RoleOrderAction modifyRolePositions()
      Modifies the positional order of Guild.getRoles() using a specific RestAction extension to allow moving Roles up/down or to a specific position.

      This uses ascending ordering which means the lowest role is first!
      This means the highest role appears at index n - 1 and the lower role at index 0.
      Providing true to modifyRolePositions(boolean) will result in the ordering being in ascending order, with the lower role at index n - 1 and the highest at index 0.
      As a note: Member.getRoles() and Guild.getRoles() are both in descending order.

      Possible ErrorResponses include:

      • UNKNOWN_ROLE
        One of the roles was deleted before the completion of the task
      • MISSING_ACCESS
        The currently logged in account was removed from the Guild
      Returns:
      RoleOrderAction
    • getTextChannelById

      @Nullable public net.dv8tion.jda.api.entities.TextChannel getTextChannelById(@NotNull @NotNull String id)
    • getTextChannelById

      @Nullable public net.dv8tion.jda.api.entities.TextChannel getTextChannelById(long id)
    • getTextChannels

      @NotNull public @NotNull List<net.dv8tion.jda.api.entities.TextChannel> getTextChannels()
      Gets all TextChannels in this Guild.
      The channels returned will be sorted according to their position.

      This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use getTextChannelCache() and use its more efficient versions of handling these values.

      Returns:
      An immutable List of all TextChannels in this Guild.
    • getTextChannelsByName

      @Nonnull public List<net.dv8tion.jda.api.entities.TextChannel> getTextChannelsByName(@Nonnull String name, boolean ignoreCase)
    • getOwner

      @Contract(" -> new") @Nonnull public YMember getOwner()
      See Also:
      • Guild.getOwner()
    • getOwnerId

      @Nonnull public String getOwnerId()
    • getOwnerIdLong

      public long getOwnerIdLong()
    • checkReasonLength

      public boolean checkReasonLength(@Nonnull String reason, @Nonnull YSlashCommandInteractionEvent event)
    • getTimeCreated

      @NotNull public @NotNull OffsetDateTime getTimeCreated()
      The time this entity was created. Calculated through the Snowflake in getGuildIdLong().
      Returns:
      OffsetDateTime - Time this entity was created at.
      See Also:
      • TimeUtil.getTimeCreated(long)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • guild

      public net.dv8tion.jda.api.entities.Guild guild()
      Returns the value of the guild record component.
      Returns:
      the value of the guild record component