GuildBehavior

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

Requests to get all AutoModerationRules currently configured for this guild.

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

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

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

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
abstract 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
abstract val kord: Kord

The kord instance that created this object.

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

Requests to get all present members in this guild.

Link copied to clipboard

Requests to get all present presences of this guild.

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

Requests to get the present voice regions for this guild.

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

Requests to get all present roles in the guild.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard
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.

Functions

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

Requests to get this behavior as a Guild.

Link copied to clipboard
open suspend 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 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
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 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
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
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
open suspend fun getSticker(stickerId: Snowflake): GuildSticker
Link copied to clipboard
open suspend fun getStickerOrNull(stickerId: Snowflake): GuildSticker?
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
open suspend fun getWidgetOrNull(): GuildWidget?
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
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 suspend fun unban(userId: Snowflake, reason: String? = null)

Requests to unban the given userId.

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

Returns a new GuildBehavior with the given strategy.