GuildClient

class GuildClient(val guildId: String, client: RestClient) : RestClient(source)

A REST client for a specific guild and its content

Parameters

guildId

The id of the guild

client

The REST client implementation

Constructors

Link copied to clipboard
constructor(guildId: String, client: RestClient)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addMember(userId: String, addGuildMember: AddGuildMember)

Add a member to this guild.

Link copied to clipboard
suspend fun addMemberRole(userId: String, roleId: String)

Add a role to a user.

Link copied to clipboard

Change a guild member's nickname.

Link copied to clipboard
suspend fun GuildClient.changeNickname(nickname: String)

Changes the user's nickname in this client's guild.

suspend fun GuildClient.changeNickname(userId: String, nickname: String)

Changes a user's nickname in this client's guild.

Link copied to clipboard
suspend fun createBan(userId: String, createGuildBan: CreateGuildBan)
suspend fun createBan(userId: String, deleteMessageDays: Int, reason: String)

Ban a user.

Link copied to clipboard
suspend fun createChannel(channel: CreateChannel): Channel

Create a channel.

Link copied to clipboard
suspend fun createEmoji(createEmoji: CreateEmoji): Emoji

Create a custom emoji.

Link copied to clipboard
suspend fun createIntegration(guildIntegration: CreateGuildIntegration)

Create a guild integration.

Link copied to clipboard
suspend fun createRole(guildRole: CreateGuildRole): Role

Create a role.

Link copied to clipboard
suspend fun createSticker(sticker: CreateSticker): Sticker

Create a new sticker.

Link copied to clipboard
suspend fun createTemplate(createTemplate: CreateTemplate): Template

Create a template based on the current state of the guild

Link copied to clipboard
open suspend override fun DELETE(majorPath: String, minorPath: String, rateKey: String, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
suspend fun deleteEmoji(emojiId: String)

Delete an emoji.

Link copied to clipboard
suspend fun deleteGuild()

Delete this guild. Use with caution, cannot be undone.

Link copied to clipboard
suspend fun deleteIntegration(guildIntegrationId: String)

Delete a guild integration.

Link copied to clipboard
suspend fun deleteRole(roleId: String)

Delete a role.

Link copied to clipboard
suspend fun deleteSticker(stickerId: String)

Delete a sticker

Link copied to clipboard
suspend fun deleteTemplate(templateCode: String)

Deletes a template

Link copied to clipboard

Disconnects a guild member from the voice channel they are currently connected to.

Link copied to clipboard
open suspend override fun GET(majorPath: String, minorPath: String, rateKey: String, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
suspend fun getAuditLog(userId: String? = null, actionType: AuditLogActionType? = null, before: String? = null, limit: Int = 50): AuditLog

Get the audit log.

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

Get a user's ban.

Link copied to clipboard
suspend fun getBans(): List<Ban>

Get user bans.

Link copied to clipboard
suspend fun getChannels(): List<Channel>

Get this guild's channels.

Link copied to clipboard
suspend fun getEmoji(): List<Emoji>

Get this guild's emoji.

suspend fun getEmoji(emojiId: String): Emoji

Get a custom emoji.

Link copied to clipboard
suspend fun getGuild(withCounts: Boolean = false): Guild

Get this guild.

Link copied to clipboard

Get the list of integrations for the guild.

Link copied to clipboard
suspend fun getInvites(): List<Invite>

Get the guild invites.

Link copied to clipboard
suspend fun getMember(userId: String): GuildMember

Get a member of this guild.

Link copied to clipboard
suspend fun getMembers(limit: Int = 1, afterMember: String = "0"): List<GuildMember>

Get a list of guild members.

Link copied to clipboard
suspend fun getPreview(): GuildPreview

Get this guild preview.

Link copied to clipboard
suspend fun getPrunePotential(days: Int = 1, roles: List<String>? = null): Pruned

Get the message prune potential.

Link copied to clipboard
suspend fun getRoles(): List<Role>

Get all roles for this guild.

Link copied to clipboard
suspend fun getSticker(stickerId: String): Sticker

Get a specific sticker from this guild by sticker ID.

Link copied to clipboard
suspend fun getStickers(): List<Sticker>

Get a list of all sticker packs for this guild.

Link copied to clipboard
suspend fun getTemplates(): List<Template>

Get the templates for this guild

Link copied to clipboard
suspend fun getVanityUrl(): Invite

Get the guild's vanity url.

Link copied to clipboard

Get the guild's voice regions.

Link copied to clipboard
suspend fun getWebhooks(): List<Webhook>

Get the guild's webhooks.

Link copied to clipboard
suspend fun getWidget(): GuildWidget

Get the guild widget.

Link copied to clipboard
suspend fun leave()

Leave the server.

Link copied to clipboard
suspend fun modifyChannelPositions(positions: List<GuildPosition>)

Modify the order of channels.

Link copied to clipboard
suspend fun modifyRolePositions(positions: List<GuildPosition>)

Change role ordering.

Link copied to clipboard
open suspend override fun PATCH(majorPath: String, minorPath: String, rateKey: String, omitNulls: Boolean, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
open suspend override fun POST(majorPath: String, minorPath: String, rateKey: String, omitNulls: Boolean, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
suspend fun prune(days: Int = 1, includeRoles: List<String>? = null): Pruned

Prune messages with result. Not recommended for large guilds.

Link copied to clipboard
suspend fun pruneWithResult(days: Int = 1, includeRoles: List<String>? = null)

Prune messages.

Link copied to clipboard
open suspend override fun PUT(majorPath: String, minorPath: String, rateKey: String, omitNulls: Boolean, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
suspend fun removeBan(userId: String)

Unban a user.

Link copied to clipboard
suspend fun removeMember(userId: String)

Kick a user from the server.

Link copied to clipboard
suspend fun removeMemberRole(userId: String, roleId: String)

Remove a role from a user.

Link copied to clipboard
suspend fun syncIntegration(guildIntegrationId: String)

Sync an integration.

Link copied to clipboard
suspend fun syncTemplate(templateCode: String): Template

Synchronize a template with the current state of the guild

Link copied to clipboard
suspend fun updateEmoji(emojiId: String, emoji: PatchEmoji): Emoji

Update an emoji

Link copied to clipboard
suspend fun updateGuild(guild: PatchGuild): Guild

Update this guild.

Link copied to clipboard
suspend fun updateIntegration(guildIntegrationId: String, guildIntegration: PatchGuildIntegration)

Update a guild integration.

Link copied to clipboard
suspend fun updateMember(userId: String, guildMember: PatchGuildMember)

Update a guild member.

Link copied to clipboard
suspend fun updateRole(roleId: String, role: PatchRole): Role

Update a role.

Link copied to clipboard
suspend fun updateSticker(stickerId: String, sticker: PatchSticker): Sticker

Update an existing sticker.

Link copied to clipboard
suspend fun updateTemplate(templateCode: String, updateTemplate: UpdateTemplate): Template

Updates a template

Link copied to clipboard
suspend fun updateWidget(guildWidget: GuildWidget): GuildWidget

Update the guild widget.