Guild

class Guild(val data: GuildData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : GuildBehavior(source)

An instance of a Discord Guild.

Constructors

Link copied to clipboard
constructor(data: GuildData, kord: Kord, supplier: EntitySupplier = kord.defaultSupplier)

Properties

Link copied to clipboard

Returns all active public and private threads in this guild Threads are ordered by their id, in descending order.

Link copied to clipboard
Link copied to clipboard

The id of the afk voice channel, if present.

Link copied to clipboard

The afk timeout.

Link copied to clipboard

The id of the guild creator if it is bot-created.

Link copied to clipboard

The approximate number of members in this guild. Present if this guild was requested through rest with the flag with_counts.

Link copied to clipboard

The approximate number of online members in this guild. Present if this guild was requested through rest with the flag with_counts.

Link copied to clipboard

Requests to get all AutoModerationRules currently configured for this guild.

Link copied to clipboard
Link copied to clipboard

The banner hash, if present.

Link copied to clipboard
open val bans: Flow<Ban>

Requests to get all present bans for this guild.

Link copied to clipboard

Requests to get all threads in this guild that are present in cache.

Link copied to clipboard
Link copied to clipboard

The ids of all channels.

Link copied to clipboard

Requests to get all present channels in this guild in an unspecified order, call toList().sorted() on the returned Flow to get a consistent order.

Link copied to clipboard

The explicit content filter level.

Link copied to clipboard
Link copied to clipboard

The default message notification level.

Link copied to clipboard

The description of this guild, if present.

Link copied to clipboard
Link copied to clipboard

The hash of the discovery splash, if present.

Link copied to clipboard

The ids of custom emojis in this guild.

Link copied to clipboard

Requests to get all custom emojis in this guild in an unspecified order.

Link copied to clipboard

The behavior of the @everyone role.

Link copied to clipboard

The enabled guild features.

Link copied to clipboard
open val gateway: Gateway?

Returns the gateway this guild is part of as per the Discord sharding rules. Returns null if no gateway for the shard is present in kord.

Link copied to clipboard
val icon: Asset?
Link copied to clipboard

The icon hash, if present.

Link copied to clipboard
open override val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard

Requests to get the integrations of this guild.

Link copied to clipboard

Requests to get the invites for this guild.

Link copied to clipboard

True if the guild is considered large, if present.

Link copied to clipboard

Whether this bot is the owner of the server

Link copied to clipboard

Whether this guild has enabled its widget.

Link copied to clipboard

The time at which this guild was joined, if present.

Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

Link copied to clipboard

The maximum number of members for this guild.

Link copied to clipboard

The maximum number of presences for this guild. 25000 By default.

Link copied to clipboard

The maximum amount of users in a stage video channel, if present.

Link copied to clipboard

The maximum amount of users in a video channel, if present.

Link copied to clipboard

The number of members in the guild, if present.

Link copied to clipboard
open val members: Flow<Member>

Requests to get all present members in this guild.

Link copied to clipboard

The required multi-factor authentication level of this guild.

Link copied to clipboard

The name of this guild.

Link copied to clipboard

The NSFW Level of this Guild

Link copied to clipboard

The behavior of the owner.

Link copied to clipboard

The id of the owner.

Link copied to clipboard

Total permissions of the bot in the Guild (excludes channel overrides).

Link copied to clipboard
Link copied to clipboard

The number of boosts this guild has, if present.

Link copied to clipboard

The server boost level.

Link copied to clipboard

Requests to get all present presences of this guild.

Link copied to clipboard

The behavior of the channel where guild notices such as welcome messages and boost events are posted.

Link copied to clipboard

the id of the channel where guild notices such as welcome messages and boost events are posted.

Link copied to clipboard

The voice region id for the guild.

Link copied to clipboard
open val regions: Flow<Region>

Requests to get the present voice regions for this guild.

Link copied to clipboard

The behaviors of the roles.

Link copied to clipboard

The ids of the roles.

Link copied to clipboard
open val roles: Flow<Role>

Requests to get all present roles in the guild.

Link copied to clipboard

The channel behavior in which a discoverable server's rules should be found.

Link copied to clipboard

The id of the channel in which a discoverable server's rules should be found

Link copied to clipboard

The behavior of the channel where admins and moderators of Community guilds receive safety alerts from Discord.

Link copied to clipboard

The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The splash hash, if present.

Link copied to clipboard
Link copied to clipboard
open override val stickers: Flow<GuildSticker>
Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard

The behavior of the channel to which system messages are sent.

Link copied to clipboard

The id of the channel to which system messages are sent.

Link copied to clipboard
Link copied to clipboard

The vanity code of this server used in the vanityUrl, if present.

Link copied to clipboard

The vanity invite URL of this server, if present.

Link copied to clipboard

The verification level required for the guild.

Link copied to clipboard

Requests to get the present voice states of this guild.

Link copied to clipboard
open val webhooks: Flow<Webhook>

Requests to get all present webhooks for this guild.

Link copied to clipboard

The welcome screen of a Community guild, shown to new members, returned in an Invite's guild object

Link copied to clipboard

The behavior of the channel widgets will redirect users to, if present.

Link copied to clipboard

The ID of the channel the widget will redirect users to, if present.

Functions

Link copied to clipboard
open suspend override fun asGuild(): Guild

Requests to get this behavior as a Guild.

Link copied to clipboard
open suspend override fun asGuildOrNull(): Guild

Requests to get this behavior as a Guild, returns null if the guild isn't present.

Link copied to clipboard
inline suspend fun GuildBehavior.ban(userId: Snowflake, builder: BanCreateBuilder.() -> Unit)

Requests to ban the given userId in this guild.

Link copied to clipboard
open operator override fun compareTo(other: Entity): Int

Compares entities on id.

Link copied to clipboard
inline suspend fun GuildBehavior.createCategory(name: String, builder: CategoryCreateBuilder.() -> Unit = {}): Category

Requests to create a new category.

Link copied to clipboard
inline suspend fun GuildBehavior.createChatInputCommand(name: String, description: String, builder: ChatInputCreateBuilder.() -> Unit = {}): GuildChatInputCommand
Link copied to clipboard
inline suspend fun GuildBehavior.createEmoji(name: String, image: Image, builder: EmojiCreateBuilder.() -> Unit = {}): GuildEmoji
Link copied to clipboard
inline suspend fun GuildBehavior.createForumChannel(name: String, builder: ForumChannelCreateBuilder.() -> Unit = {}): ForumChannel
Link copied to clipboard

Requests to create a new KeywordAutoModerationRule in this guild and returns it.

Link copied to clipboard

Requests to create a new KeywordPresetAutoModerationRule in this guild and returns it.

Link copied to clipboard
inline suspend fun GuildBehavior.createMediaChannel(name: String, builder: MediaChannelCreateBuilder.() -> Unit = {}): MediaChannel
Link copied to clipboard

Requests to create a new MemberProfileAutoModerationRule in this guild and returns it.

Link copied to clipboard

Requests to create a new MentionSpamAutoModerationRule in this guild and returns it.

Link copied to clipboard
Link copied to clipboard
inline suspend fun GuildBehavior.createNewsChannel(name: String, builder: NewsChannelCreateBuilder.() -> Unit = {}): NewsChannel

Requests to create a new news channel.

Link copied to clipboard
inline suspend fun GuildBehavior.createRole(builder: RoleCreateBuilder.() -> Unit = {}): Role

Requests to add a new role to this guild.

Link copied to clipboard
Link copied to clipboard

Requests to create a new SpamAutoModerationRule in this guild and returns it.

Link copied to clipboard
inline suspend fun GuildBehavior.createStageChannel(name: String, builder: StageChannelCreateBuilder.() -> Unit = {}): StageChannel

Requests to create a new stage channel.

Link copied to clipboard
open suspend fun createSticker(name: String, description: String, tags: String, file: NamedFile): GuildSticker
Link copied to clipboard
inline suspend fun GuildBehavior.createTextChannel(name: String, builder: TextChannelCreateBuilder.() -> Unit = {}): TextChannel

Requests to create a new text channel.

Link copied to clipboard
Link copied to clipboard
inline suspend fun GuildBehavior.createVoiceChannel(name: String, builder: VoiceChannelCreateBuilder.() -> Unit = {}): VoiceChannel

Requests to create a new voice channel.

Link copied to clipboard
open suspend fun delete()

Requests to delete this guild.

Link copied to clipboard
inline suspend fun GuildBehavior.edit(builder: GuildModifyBuilder.() -> Unit): Guild

Requests to edit this guild.

Link copied to clipboard
open suspend fun editMFALevel(level: MFALevel, reason: String? = null): MFALevel

Requests to edit this guild's MFA level and returns the updated level.

Link copied to clipboard

Requests to edit the GuildOnboarding object of the guild and returns the edited onboarding object.

Link copied to clipboard
open suspend fun editSelfNickname(newNickname: String? = null, reason: String? = null): String

Requests to change the nickname of the bot in this guild, passing null will remove it.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open suspend fun fetchGuild(): Guild

Retrieve the Guild associated with this behaviour from the provided EntitySupplier

Link copied to clipboard
open suspend fun fetchGuildOrNull(): Guild?

Retrieve the Guild associated with this behaviour from the provided EntitySupplier returns null if the Guild isn't present.

Link copied to clipboard
suspend fun getAfkChannel(): VoiceChannel?

Requests to get the VoiceChannel represented by the afkChannelId, returns null if the afkChannelId isn't present or the channel itself isn't present.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getApplicationCommands(withLocalizations: Boolean? = null): Flow<GuildApplicationCommand>
Link copied to clipboard

The Audit log entries from this guild, configured by the builder.

Link copied to clipboard

Requests an AutoModerationRule by its id.

Link copied to clipboard

Requests an AutoModerationRule by its id. Returns null if it wasn't found.

Link copied to clipboard
open suspend fun getBan(userId: Snowflake): Ban

Requests to get the Ban of the User represented by the userId.

Link copied to clipboard
open suspend fun getBanOrNull(userId: Snowflake): Ban?

Requests to get the Ban of the User represented by the userId, returns null if the Ban isn't present.

Link copied to clipboard
open suspend fun getChannel(channelId: Snowflake): GuildChannel

Requests to get the TopGuildChannel represented by the channelId.

Link copied to clipboard
inline suspend fun <T : GuildChannel> GuildBehavior.getChannelOf(channelId: Snowflake): T

Requests to get the GuildChannel represented by the channelId as type T.

Link copied to clipboard
inline suspend fun <T : GuildChannel> GuildBehavior.getChannelOfOrNull(channelId: Snowflake): T?

Requests to get the GuildChannel represented by the channelId as type T, returns null if the GuildChannel isn't present.

Link copied to clipboard
open suspend fun getChannelOrNull(channelId: Snowflake): GuildChannel?

Requests to get the GuildChannel represented by the channelId, returns null if the GuildChannel isn't present.

Link copied to clipboard

Requests to get the TopGuildChannel represented by the widgetChannelId, returns null if the TopGuildChannel isn't present or widgetChannelId is null.

Link copied to clipboard
suspend fun getEmoji(emojiId: Snowflake): GuildEmoji

Requests to get the GuildEmoji represented by the emojiId in this guild.

Link copied to clipboard
suspend fun getEmojiOrNull(emojiId: Snowflake): GuildEmoji?

Requests to get the GuildEmoji represented by the emojiId in this guild, returns null if the GuildEmoji isn't present.

Link copied to clipboard
suspend fun getEveryoneRole(): Role

Requests to get the @everyone Role.

Link copied to clipboard
suspend fun getEveryoneRoleOrNull(): Role?

Requests to get the @everyone Role, returns null if the Role isn't present.

Link copied to clipboard

Requests a GuildScheduledEvent by its id.

Link copied to clipboard

Requests a GuildScheduledEvent by its id returns null if none could be found.

Link copied to clipboard
open suspend fun getInvite(code: String, withCounts: Boolean = true, withExpiration: Boolean = true, scheduledEventId: Snowflake? = null): Invite

Requests to get the Invite represented by the code.

Link copied to clipboard
open suspend fun getInviteOrNull(code: String, withCounts: Boolean = true, withExpiration: Boolean = true, scheduledEventId: Snowflake? = null): Invite?

Requests to get the Invite represented by the code, returns null if the Invite isn't present.

Link copied to clipboard
open suspend fun getMember(userId: Snowflake): Member

Requests to get the Member represented by the userId.

Link copied to clipboard
open suspend fun getMemberOrNull(userId: Snowflake): Member?

Requests to get the Member represented by the userId, returns null if the Member isn't present.

Link copied to clipboard
open fun getMembers(query: String, limit: Int = 1000): Flow<Member>

Requests to get up to limit members whose Member.username or Member.nickname match the query. The limit accepts a maximum value of 1000 and a minimum of 1.

Link copied to clipboard
open suspend fun getOnboarding(): GuildOnboarding

Requests the onboarding object for this guild.

Link copied to clipboard

Requests the onboarding object for this guild. Returns null if it wasn't found.

Link copied to clipboard
suspend fun getOwner(): Member

Requests to get the owner of this guild as a Member.

Link copied to clipboard
suspend fun getOwnerOrNull(): Member?

Requests to get the owner of this guild as a Member, returns null if the Member isn't present.

Link copied to clipboard
open suspend fun getPreview(): GuildPreview

Returns the preview of this guild. The bot does not need to present in this guild for this to complete successfully.

Link copied to clipboard
open suspend fun getPreviewOrNull(): GuildPreview?

Returns the preview of this guild. The bot does not need to present in this guild for this to complete successfully. Returns null if the preview doesn't exist.

Link copied to clipboard
open suspend fun getPruneCount(days: Int = 7): Int

Requests to get the amount of users that would be pruned in this guild.

Link copied to clipboard

Requests to get The channel where guild notices such as welcome messages and boost events are posted.

Link copied to clipboard
open suspend fun getRole(roleId: Snowflake): Role

Requests to get the Role represented by the roleId.

Link copied to clipboard
open suspend fun getRoleOrNull(roleId: Snowflake): Role?

Requests to get the Role represented by the roleId, returns null if the Role isn't present.

Link copied to clipboard

Requests to get the channel in which a discoverable server's rules should be found represented, returns null if the TopGuildMessageChannel isn't present, or rulesChannelId is null.

Link copied to clipboard
open suspend fun getSticker(stickerId: Snowflake): GuildSticker
Link copied to clipboard
open suspend fun getStickerOrNull(stickerId: Snowflake): GuildSticker?
Link copied to clipboard

Requests to get the channel where system messages (member joins, server boosts, etc.) are sent, returns null if the TextChannel isn't present or the systemChannelId is null.

Link copied to clipboard
open suspend fun getTemplate(code: String): Template
Link copied to clipboard
open suspend fun getTemplateOrNull(code: String): Template?
Link copied to clipboard
open suspend fun getVanityUrl(): String?

Requests to get the vanity url of this guild, if present.

Link copied to clipboard
open suspend fun getWelcomeScreen(): WelcomeScreen
Link copied to clipboard
Link copied to clipboard
open suspend fun getWidget(): GuildWidget
Link copied to clipboard

Requests to get the channel the widget will redirect users to, returns null if the TextChannel isn't present or the widgetChannelId is null.

Link copied to clipboard
open suspend fun getWidgetOrNull(): GuildWidget?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open suspend fun kick(userId: Snowflake, reason: String? = null)

Requests to kick the given userId.

Link copied to clipboard
open suspend fun leave()

Requests to leave this guild.

Link copied to clipboard
fun Guild.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveGuild
inline fun Guild.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveGuild.() -> Unit): LiveGuild
Link copied to clipboard
open suspend fun prune(days: Int = 7, reason: String? = null): Int

Requests to prune users in this guild.

Link copied to clipboard

Executes the request on this gateway, returning a flow of MembersChunkEvent responses.

Link copied to clipboard

Executes a RequestGuildMembers command configured by the builder for guild on this gateway, returning a flow of MembersChunkEvent responses.

Link copied to clipboard

Requests to swap positions of channels in this guild.

Link copied to clipboard

Requests to swap positions of roles in this guild.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open suspend fun unban(userId: Snowflake, reason: String? = null)

Requests to unban the given userId.

Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Guild

Returns a new Guild with the given strategy.