Package com.mewna.catnip.entity.guild
Interface Guild
- All Superinterfaces:
Entity
,HasApplication
,HasIcon
,HasName
,HasNullableDescription
,HasOwner
,RequiresCatnip
,Snowflake
,Timestamped
- All Known Implementing Classes:
GuildImpl
public interface Guild
extends Snowflake, HasName, HasNullableDescription, HasIcon, HasApplication, HasOwner
Represents a Discord guild. A guild is colloquially referred to as a server,
both in the client UI and by users.
- Since:
- 9/6/18
- Author:
- natanbc
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The content filter level for a guild.static class
static enum
The 2FA level required for this guild.static enum
The notification level for a guild.static enum
The Nitro Boost level of a guild.static enum
The verification level for a guild.Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.reactivex.rxjava3.core.Completable
addRoleToMember
(Role role, Member member) Adds a role to a member.default io.reactivex.rxjava3.core.Completable
addRoleToMember
(Role role, Member member, String reason) Adds a role to a member.default String
long
int
int
int
default io.reactivex.rxjava3.core.Completable
ban
(long userId, int deleteMessageDays) Bans a user from a guild.default io.reactivex.rxjava3.core.Completable
Bans a user from a guild.default io.reactivex.rxjava3.core.Completable
Bans a user from a guild.default io.reactivex.rxjava3.core.Completable
Bans a user from a guild.banner()
default io.reactivex.rxjava3.core.Maybe<Category>
category
(long id) default io.reactivex.rxjava3.core.Maybe<Category>
default io.reactivex.rxjava3.core.Single<String>
changeNickName
(String nickname) Changes the nick of the bots user on the guild NeedsPermission.CHANGE_NICKNAME
default io.reactivex.rxjava3.core.Single<String>
changeNickName
(String nickname, String reason) Changes the nick of the bots user on the guild NeedsPermission.CHANGE_NICKNAME
default GuildChannel
channel
(long id) default io.reactivex.rxjava3.core.Maybe<GuildChannel>
default PositionUpdater
default NamedCacheView<GuildChannel>
channels()
default void
Closes the voice connection for this guild.default io.reactivex.rxjava3.core.Single<GuildChannel>
createChannel
(ChannelData data) Creates a new channel in this guild.default io.reactivex.rxjava3.core.Single<GuildChannel>
createChannel
(ChannelData data, String reason) Creates a new channel in this guild.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
createEmoji
(String name, byte[] image, Collection<String> roles) Create a new emoji on the guild.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
createEmoji
(String name, byte[] image, Collection<String> roles, String reason) Create a new emoji on the guild.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
createEmoji
(String name, URI imageData, Collection<String> roles) Create a new emoji on the guild.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
createEmoji
(String name, URI imageData, Collection<String> roles, String reason) Create a new emoji on the guild.default io.reactivex.rxjava3.core.Single<Role>
createRole
(RoleData data) default io.reactivex.rxjava3.core.Single<Role>
createRole
(RoleData data, String reason) default io.reactivex.rxjava3.core.Completable
delete()
Delete this guild.default io.reactivex.rxjava3.core.Completable
deleteEmoji
(String emojiId) Delete the given emoji from the guild.default io.reactivex.rxjava3.core.Completable
deleteEmoji
(String emojiId, String reason) Delete the given emoji from the guild.default Guild.GuildEditFields
edit()
Edit this guild.default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji>
emoji
(long id) default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji>
default Collection<Emoji.CustomEmoji>
emojiByName
(String name) default NamedCacheView<Emoji.CustomEmoji>
emojis()
features()
default io.reactivex.rxjava3.core.Observable<GuildChannel>
Fetch all channels for this guild from the API.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
fetchEmoji
(String emojiId) Fetch a single emoji from this guild.default io.reactivex.rxjava3.core.Observable<Emoji.CustomEmoji>
Fetch all emojis for this guild.default io.reactivex.rxjava3.core.Observable<CreatedInvite>
Fetch all invites for this guild from the API.default io.reactivex.rxjava3.core.Observable<Role>
Fetch all roles for this guild from the API.default io.reactivex.rxjava3.core.Observable<Webhook>
Fetch all webhooks for this guild.default io.reactivex.rxjava3.core.Single<GuildEmbed>
getEmbed()
joinedAt()
default String
default io.reactivex.rxjava3.core.Completable
kick
(long userId) Kicks a member from the Guild.default io.reactivex.rxjava3.core.Completable
Kicks a member from the Guild.default io.reactivex.rxjava3.core.Completable
Kicks a member from the Guild.default io.reactivex.rxjava3.core.Completable
Kicks a member from the Guild.default io.reactivex.rxjava3.core.Completable
Kicks a member from the Guild.default io.reactivex.rxjava3.core.Completable
Kicks a member from the Guild.boolean
large()
default io.reactivex.rxjava3.core.Completable
leave()
Leave this guild.int
int
default io.reactivex.rxjava3.core.Maybe<Member>
member
(long id) default io.reactivex.rxjava3.core.Maybe<Member>
default long
default NamedCacheView<Member>
members()
mfaLevel()
default io.reactivex.rxjava3.core.Completable
modifyChannelPositions
(PositionUpdater updater) Modifies the positions of channels.default io.reactivex.rxjava3.core.Completable
modifyChannelPositions
(PositionUpdater updater, String reason) Modifies the positions of channels.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
modifyEmoji
(String emojiId, String name, Collection<String> roles) Modify the given emoji.default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji>
modifyEmoji
(String emojiId, String name, Collection<String> roles, String reason) Modify the given emoji.default io.reactivex.rxjava3.core.Single<GuildEmbed>
modifyGuildEmbed
(GuildChannel channel, boolean enabled) default io.reactivex.rxjava3.core.Single<GuildEmbed>
modifyGuildEmbed
(GuildChannel channel, boolean enabled, String reason) default io.reactivex.rxjava3.core.Completable
modifyGuildMember
(Member member, MemberData data) Modifies the guild member with the specified updates.default io.reactivex.rxjava3.core.Completable
modifyGuildMember
(Member member, MemberData data, String reason) Modifies the guild member with the specified updates.default io.reactivex.rxjava3.core.Completable
modifyRolePositions
(PositionUpdater updater) Modifies the positions of roles.default io.reactivex.rxjava3.core.Completable
modifyRolePositions
(PositionUpdater updater, String reason) Modifies the positions of roles.boolean
owned()
default io.reactivex.rxjava3.core.Maybe<User>
owner()
default String
ownerId()
long
default io.reactivex.rxjava3.core.Maybe<Member>
int
region()
default io.reactivex.rxjava3.core.Completable
removeRoleFromMember
(Role role, Member member) Removes a role from a member.default io.reactivex.rxjava3.core.Completable
removeRoleFromMember
(Role role, Member member, String reason) Removes a role from a member.default io.reactivex.rxjava3.core.Maybe<Role>
role
(long id) default io.reactivex.rxjava3.core.Maybe<Role>
default PositionUpdater
default NamedCacheView<Role>
roles()
default io.reactivex.rxjava3.core.Maybe<Member>
searchMembers
(String query) Searches guild members for a member matching the given query.default io.reactivex.rxjava3.core.Observable<Member>
searchMembers
(String query, int limit) Searches guild members for all members matching the given query.default io.reactivex.rxjava3.core.Maybe<Member>
splash()
default String
splashUrl
(ImageOptions options) The CDN URL of the guild's splash image.default String
long
default io.reactivex.rxjava3.core.Maybe<TextChannel>
textChannel
(long id) default io.reactivex.rxjava3.core.Maybe<TextChannel>
textChannel
(String id) default boolean
default io.reactivex.rxjava3.core.Completable
unban
(long userId) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Completable
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Completable
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Completable
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Completable
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Completable
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
default io.reactivex.rxjava3.core.Single<CreatedInvite>
default io.reactivex.rxjava3.core.Maybe<VoiceChannel>
voiceChannel
(long id) default io.reactivex.rxjava3.core.Maybe<VoiceChannel>
voiceChannel
(String id) default CacheView<VoiceState>
default String
long
boolean
Methods inherited from interface com.mewna.catnip.entity.partials.HasApplication
applicationId, applicationIdAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.HasNullableDescription
description
Methods inherited from interface com.mewna.catnip.entity.RequiresCatnip
catnip
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Field Details
-
NICKNAME_MAX_LENGTH
static final int NICKNAME_MAX_LENGTH- See Also:
-
-
Method Details
-
splash
- Returns:
- The splash image for the guild. May be
null
.
-
splashUrl
The CDN URL of the guild's splash image.- Parameters:
options
- The options to configure the URL returned.- Returns:
- The CDN URL.
-
splashUrl
- Returns:
- The CDN URL of the guild's splash image.
-
selfMember
- Returns:
- The self member as an user of the guild.
-
owner
-
ownerMember
- Returns:
- The
Member
of the guild's owner.
-
owned
@CheckReturnValue boolean owned()- Returns:
- Whether the guild is owned by the current user.
-
ownerId
-
ownerIdAsLong
@CheckReturnValue long ownerIdAsLong()- Specified by:
ownerIdAsLong
in interfaceHasOwner
- Returns:
- The id of the user who owns the guild.
-
permissions
- Returns:
- Total permissions for the user in the guild. Does NOT include channel overrides.
-
region
- Returns:
- The region that the guild's voice servers are located in.
-
afkChannelId
- Returns:
- The id of the afk voice channel for the guild.
-
afkChannelIdAsLong
@CheckReturnValue long afkChannelIdAsLong()- Returns:
- The id of the afk voice channel for the guild.
-
afkTimeout
@CheckReturnValue int afkTimeout()- Returns:
- The amount of time a user must be afk for before they're moved to the afk channel.
-
verificationLevel
- Returns:
- The verification level set for the guild.
-
defaultMessageNotifications
- Returns:
- The notification level set for the guild.
-
explicitContentFilter
- Returns:
- The explicit content filter level set for the guild.
-
features
- Returns:
- The list of features enabled for the guild.
-
mfaLevel
- Returns:
- The MFA level set for guild administrators.
-
widgetEnabled
@CheckReturnValue boolean widgetEnabled()- Returns:
- Whether or not the guild's widget is enabled.
-
widgetChannelId
- Returns:
- The channel the guild's widget is set for, if enabled.
-
widgetChannelIdAsLong
@CheckReturnValue long widgetChannelIdAsLong()- Returns:
- The channel the guild's widget is set for, if enabled.
-
systemChannelId
- Returns:
- The id of the channel used for system messages (ex. the built-in member join messages).
-
systemChannelIdAsLong
@CheckReturnValue long systemChannelIdAsLong()- Returns:
- The id of the channel used for system messages (ex. the built-in member join messages).
-
joinedAt
- Returns:
- The date/time that the current user joined the guild at.
-
joinedAtTimestamp
-
large
@CheckReturnValue boolean large()- Returns:
- Whether or not this guild is considered "large."
-
maxPresences
@Nonnegative @CheckReturnValue int maxPresences()- Returns:
- The maximum number of presences the guild can have. Will be
0
if no value was present.
-
maxMembers
@Nonnegative @CheckReturnValue int maxMembers()- Returns:
- The maximum number of members the guild can have. Will be
0
if no value was present.
-
approximateMemberCount
@Nonnegative @CheckReturnValue int approximateMemberCount()- Returns:
- The approximate member count the guild currently has. Will be
0
if no value was present.
-
approximatePresenceCount
@Nonnegative @CheckReturnValue int approximatePresenceCount()- Returns:
- The approximate presence count the guild currently has. Will be
0
if no value was present.
-
vanityUrlCode
- Returns:
- The vanity invite code for this guild, ie.
discord.gg/vanity_code
.
-
banner
- Returns:
- The guild's banner hash.
-
preferredLocale
- Returns:
- The preferred locale for this guild. Defaults to
en-US
. Is only modifiable on guilds that haveGuildFeature.DISCOVERABLE
set.
-
memberCount
@Nonnegative @CheckReturnValue default long memberCount()- Returns:
- The number of users in this guild.
-
roles
- Returns:
- All roles in this guild.
-
emojis
- Returns:
- All custom emoji in this guild.
-
members
- Returns:
- All members in this guild.
-
channels
- Returns:
- All channels in this guild.
-
voiceStates
- Returns:
- All voice states for this guild.
-
member
- Parameters:
id
- The id of the member to get.- Returns:
- The member object for the user with the given id. May be
null
if the user is not a member of the guild.
-
member
- Parameters:
id
- The id of the member to get.- Returns:
- The member object for the user with the given id. May be
null
if the user is not a member of the guild.
-
role
- Parameters:
id
- The id of the role to get.- Returns:
- The role object with the given id, or
null
if no such role exists.
-
role
- Parameters:
id
- The id of the role to get.- Returns:
- The role object with the given id, or
null
if no such role exists.
-
channel
- Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present.
-
channel
- Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present.
-
textChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<TextChannel> textChannel(String id) - Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a text channel.
-
textChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<TextChannel> textChannel(long id) - Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a text channel.
-
voiceChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<VoiceChannel> voiceChannel(String id) - Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a voice channel.
-
voiceChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<VoiceChannel> voiceChannel(long id) - Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a voice channel.
-
category
- Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a category.
-
category
- Parameters:
id
- The id of the channel to get.- Returns:
- The channel, or
null
if it isn't present. - Throws:
IllegalArgumentException
- If the channel is not a category.
-
emoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji> emoji(String id) - Parameters:
id
- The id of the emoji to fetch.- Returns:
- The emoji, or
null
if it isn't present.
-
emoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Emoji.CustomEmoji> emoji(long id) - Parameters:
id
- The id of the emoji to fetch.- Returns:
- The emoji, or
null
if it isn't present.
-
emojiByName
- Parameters:
name
- The name of the emoji to fetch- Returns:
- A possibly-empty collection of all emojis with matching names.
-
fetchRoles
Fetch all roles for this guild from the API.- Returns:
- A Observable that completes when the roles are fetched.
-
fetchChannels
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<GuildChannel> fetchChannels()Fetch all channels for this guild from the API.- Returns:
- A Observable that completes when the channels are fetched.
-
fetchInvites
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<CreatedInvite> fetchInvites()Fetch all invites for this guild from the API.- Returns:
- A Observable that completes when the invites are fetched.
-
fetchWebhooks
Fetch all webhooks for this guild.- Returns:
- A Observable that completes when the webhooks are fetched.
-
fetchEmojis
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Emoji.CustomEmoji> fetchEmojis()Fetch all emojis for this guild.- Returns:
- A Observable that completes when the emojis are fetched.
-
fetchEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> fetchEmoji(@Nonnull String emojiId) Fetch a single emoji from this guild.- Parameters:
emojiId
- The id of the emoji to fetch.- Returns:
- A Observable that completes when the emoji is fetched.
-
createEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull byte[] image, @Nonnull Collection<String> roles, @Nullable String reason) Create a new emoji on the guild.- Parameters:
name
- The new emoji's name.image
- The image for the new emoji.roles
- The roles that can use the new emoji.reason
- The reason that will be displayed in audit log.- Returns:
- A Observable that completes when the emoji is created.
-
createEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull byte[] image, @Nonnull Collection<String> roles) Create a new emoji on the guild.- Parameters:
name
- The new emoji's name.image
- The image for the new emoji.roles
- The roles that can use the new emoji.- Returns:
- A Observable that completes when the emoji is created.
-
createEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull URI imageData, @Nonnull Collection<String> roles, @Nullable String reason) Create a new emoji on the guild.- Parameters:
name
- The new emoji's name.imageData
- The image for the new emoji.roles
- The roles that can use the new emoji.reason
- The reason that will be displayed in audit log.- Returns:
- A Observable that completes when the emoji is created.
-
createEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> createEmoji(@Nonnull String name, @Nonnull URI imageData, @Nonnull Collection<String> roles) Create a new emoji on the guild.- Parameters:
name
- The new emoji's name.imageData
- The image for the new emoji.roles
- The roles that can use the new emoji.- Returns:
- A Observable that completes when the emoji is created.
-
modifyEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> modifyEmoji(@Nonnull String emojiId, @Nonnull String name, @Nonnull Collection<String> roles, @Nullable String reason) Modify the given emoji.- Parameters:
emojiId
- The id of the emoji to modify.name
- The name of the emoji. To not change it, pass the old name.roles
- The roles that can use the emoji. To not change it, pass the old roles.reason
- The reason that will be displayed in audit log.- Returns:
- A Observable that completes when the emoji is modified.
-
modifyEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Emoji.CustomEmoji> modifyEmoji(@Nonnull String emojiId, @Nonnull String name, @Nonnull Collection<String> roles) Modify the given emoji.- Parameters:
emojiId
- The id of the emoji to modify.name
- The name of the emoji. To not change it, pass the old name.roles
- The roles that can use the emoji. To not change it, pass the old roles.- Returns:
- A Observable that completes when the emoji is modified.
-
deleteEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable deleteEmoji(@Nonnull String emojiId, @Nullable String reason) Delete the given emoji from the guild.- Parameters:
emojiId
- The id of the emoji to delete.reason
- The reason that will be displayed in audit log.- Returns:
- A Observable that completes when the emoji is deleted.
-
deleteEmoji
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable deleteEmoji(@Nonnull String emojiId) Delete the given emoji from the guild.- Parameters:
emojiId
- The id of the emoji to delete.- Returns:
- A Observable that completes when the emoji is deleted.
-
leave
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable leave()Leave this guild.- Returns:
- A Observable that completes when the guild is left.
-
delete
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable delete()Delete this guild.- Returns:
- A Observable that completes when the guild is deleted.
-
closeVoiceConnection
default void closeVoiceConnection()Closes the voice connection for this guild. This method is equivalent toguild.catnip().{@link com.mewna.catnip.Catnip#closeVoiceConnection(String) closeVoiceConnection}(guild.id())
- See Also:
-
edit
Edit this guild.- Returns:
- A guild editor that can complete the editing.
-
ban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(@Nonnull String userId, @Nullable String reason, @Nonnegative int deleteMessageDays) Bans a user from a guild. NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to ban.reason
- The reason of the ban.deleteMessageDays
- The history of messages, in days, that will be deleted- Returns:
- A Observable that completes when the member got banned
-
ban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(long userId, @Nullable String reason, @Nonnegative int deleteMessageDays) Bans a user from a guild. NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to ban.reason
- The reason of the ban.deleteMessageDays
- The history of messages, in days, that will be deleted- Returns:
- A Observable that completes when the member got banned
-
ban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(long userId, @Nonnegative int deleteMessageDays) Bans a user from a guild. NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to ban.deleteMessageDays
- The history of messages, in days, that will be deleted- Returns:
- A Observable that completes when the member got banned
-
ban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable ban(@Nonnull Member member, @Nullable String reason, @Nonnegative int deleteMessageDays) Bans a user from a guild. NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
member
- The member to ban.reason
- The reason of the ban.deleteMessageDays
- The history of messages, in days, that will be deleted- Returns:
- A Observable that completes when the member got banned
-
unban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull String userId, @Nullable String reason) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to unbanreason
- The reason for the unban- Returns:
- A Observable that completes when the ban got removed
-
unban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull String userId) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to unban- Returns:
- A Observable that completes when the ban got removed
-
unban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(long userId, @Nullable String reason) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to unbanreason
- The reason for the unban- Returns:
- A Observable that completes when the ban got removed
-
unban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(long userId) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to unban- Returns:
- A Observable that completes when the ban got removed
-
unban
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable unban(@Nonnull User user, @Nullable String reason) Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
user
- The the user to unbanreason
- The that will be displayed in audit log- Returns:
- A Observable that completes when the ban got removed
-
unban
Removes a users ban from the Guild NeedsPermission.BAN_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
user
- The the user to unban- Returns:
- A Observable that completes when the ban got removed
-
kick
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(@Nonnull String userId, @Nullable String reason) Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to kickreason
- The reason for the kick- Returns:
- A Observable that is finished when the user got kicked
-
kick
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(@Nonnull String userId) Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to kick- Returns:
- A Observable that is finished when the user got kicked
-
kick
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(long userId, @Nullable String reason) Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to kickreason
- The reason for the kick- Returns:
- A Observable that is finished when the user got kicked
-
kick
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(long userId) Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
userId
- The id of the user to kick- Returns:
- A Observable that is finished when the user got kicked
-
kick
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable kick(Member member, @Nullable String reason) Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
member
- The member to kickreason
- The reason for the kick- Returns:
- A Observable that is finished when the user got kicked
-
kick
Kicks a member from the Guild. NeedsPermission.KICK_MEMBERS
and permission to interact with the targetPermissionUtil.canInteract(Member, Member)
- Parameters:
member
- The member to kick- Returns:
- A Observable that is finished when the user got kicked
-
changeNickName
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<String> changeNickName(@Nonnull String nickname, @Nullable String reason) Changes the nick of the bots user on the guild NeedsPermission.CHANGE_NICKNAME
- Parameters:
nickname
- The new nicknamereason
- The reason of the nickname change- Returns:
- A Observable containing the new nickname
- Throws:
IllegalArgumentException
- If the nickname is longer thanNICKNAME_MAX_LENGTH
-
modifyGuildMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyGuildMember(@Nonnull Member member, @Nonnull MemberData data) Modifies the guild member with the specified updates. NeedsPermission.MANAGE_NICKNAMES
,Permission.MANAGE_ROLES
,Permission.MUTE_MEMBERS
,Permission.DEAFEN_MEMBERS
, andPermission.MOVE_MEMBERS
.- Parameters:
member
- The member to modify.data
- The parts of the member to update.- Returns:
- A
Completable
that completes when the update is completed.
-
modifyGuildMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyGuildMember(@Nonnull Member member, @Nonnull MemberData data, @Nullable String reason) Modifies the guild member with the specified updates. NeedsPermission.MANAGE_NICKNAMES
,Permission.MANAGE_ROLES
,Permission.MUTE_MEMBERS
,Permission.DEAFEN_MEMBERS
, andPermission.MOVE_MEMBERS
.- Parameters:
member
- The member to modify.data
- The parts of the member to update.reason
- The audit log reason for the update.- Returns:
- A
Completable
that completes when the update is completed.
-
channelPositionUpdater
- Returns:
- A new updater for channels in this guild. See
PositionUpdater
for how to use it.
-
rolePositionUpdater
- Returns:
- A new updater for roles in this guild. See
PositionUpdater
for how to use it.
-
modifyChannelPositions
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyChannelPositions(@Nonnull PositionUpdater updater) Modifies the positions of channels. See the docs onPositionUpdater
for how to use it.- Parameters:
updater
- The position updater.- Returns:
- A
Completable
that completes when the update is completed.
-
modifyChannelPositions
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyChannelPositions(@Nonnull PositionUpdater updater, @Nullable String reason) Modifies the positions of channels. See the docs onPositionUpdater
for how to use it.- Parameters:
updater
- The position updater.reason
- The reason for the update.- Returns:
- A
Completable
that completes when the update is completed.
-
modifyRolePositions
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyRolePositions(@Nonnull PositionUpdater updater) Modifies the positions of roles. See the docs onPositionUpdater
for how to use it.- Parameters:
updater
- The position updater.- Returns:
- A
Completable
that completes when the update is completed.
-
modifyRolePositions
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable modifyRolePositions(@Nonnull PositionUpdater updater, @Nullable String reason) Modifies the positions of roles. See the docs onPositionUpdater
for how to use it.- Parameters:
updater
- The position updater.reason
- The reason for the update.- Returns:
- A
Completable
that completes when the update is completed.
-
changeNickName
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<String> changeNickName(@Nonnull String nickname) Changes the nick of the bots user on the guild NeedsPermission.CHANGE_NICKNAME
- Parameters:
nickname
- The new nickname- Returns:
- A Observable containing the new nickname
- Throws:
IllegalArgumentException
- If the nickname is longer thanNICKNAME_MAX_LENGTH
-
addRoleToMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRoleToMember(@Nonnull Role role, @Nonnull Member member, @Nullable String reason) Adds a role to a member. NeedsPermission.MANAGE_ROLES
and permission to interact with the rolePermissionUtil.canInteract(Member, Role)
- Parameters:
role
- The role to assignmember
- The member to assign the role toreason
- The reason that will be displayed in audit log- Returns:
- A Observable that completes when the role got added
-
addRoleToMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRoleToMember(@Nonnull Role role, @Nonnull Member member) Adds a role to a member. NeedsPermission.MANAGE_ROLES
and permission to interact with the rolePermissionUtil.canInteract(Member, Role)
- Parameters:
role
- The role to assignmember
- The member to assign the role to- Returns:
- A Observable that completes when the role got added
-
removeRoleFromMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRoleFromMember(@Nonnull Role role, @Nonnull Member member, @Nullable String reason) Removes a role from a member. NeedsPermission.MANAGE_ROLES
and permission to interact with the rolePermissionUtil.canInteract(Member, Role)
- Parameters:
role
- The role to removemember
- The member to remove the role fromreason
- The reason that will be displayed in audit log- Returns:
- A Observable that completes when the role got removed
-
removeRoleFromMember
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRoleFromMember(@Nonnull Role role, @Nonnull Member member) Removes a role from a member. NeedsPermission.MANAGE_ROLES
and permission to interact with the rolePermissionUtil.canInteract(Member, Role)
- Parameters:
role
- The role to removemember
- The member to remove the role from- Returns:
- A Observable that completes when the role got removed
-
createChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildChannel> createChannel(@Nonnull ChannelData data) Creates a new channel in this guild.- Parameters:
data
- The data to create the channel with.- Returns:
- A
Single
that completes with the created channel.
-
createChannel
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildChannel> createChannel(@Nonnull ChannelData data, @Nullable String reason) Creates a new channel in this guild.- Parameters:
data
- The data to create the channel with.reason
- The reason for creating the channel.- Returns:
- A
Single
that completes with the created channel.
-
getEmbed
- Returns:
- A
Single
that completes with the embed for this guild.
-
modifyGuildEmbed
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildEmbed> modifyGuildEmbed(@Nonnull GuildChannel channel, boolean enabled) - Parameters:
channel
- The channel to invite users to.enabled
- Whether the embed is enabled.- Returns:
- A
Single
that completes with the modified embed.
-
modifyGuildEmbed
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<GuildEmbed> modifyGuildEmbed(@Nonnull GuildChannel channel, boolean enabled, @Nullable String reason) - Parameters:
channel
- The channel to invite users to.enabled
- Whether the embed is enabled.reason
- The reason for the modification.- Returns:
- A
Single
that completes with the modified embed.
-
vanityInvite
- Returns:
- The vanity invite for this guild, if any.
-
createRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Role> createRole(@Nonnull RoleData data) - Parameters:
data
- The data to create the role with.- Returns:
- A
Single
that completes with the created role.
-
createRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<Role> createRole(@Nonnull RoleData data, @Nullable String reason) - Parameters:
data
- The data to create the role with.reason
- The reason for creating this role.- Returns:
- A
Single
that completes with the created role.
-
searchMembers
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Member> searchMembers(@Nonnull String query) Searches guild members for a member matching the given query.- Parameters:
query
- The search query to use- Returns:
- A
Maybe
with the member that matches, if any.
-
searchMembers
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Observable<Member> searchMembers(@Nonnull String query, @Nonnegative int limit) Searches guild members for all members matching the given query.- Parameters:
query
- The search query to use.limit
- The maximum number of members to return. Must be 1 <= N <= 100.- Returns:
- An
Observable
containing the matched members, if any.
-