ChannelClient

class ChannelClient(val channelId: String, client: RestClient) : RestClient(source)

A REST client for a specific channel and it's content

Parameters

channelId

The id of the channel

client

The REST client implementation

Constructors

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

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addGroupDMRecipient(userId: String, groupDMAddRecipient: GroupDMAddRecipient)

Add a user to this group DM channel.

Link copied to clipboard
suspend fun addMessageReaction(messageId: String, emoji: Emoji)
suspend fun addMessageReaction(messageId: String, emojiText: String)

Add a reaction to a message.

Link copied to clipboard
suspend fun ChannelClient.addMessageReaction(messageId: String, emojiId: String, emojiName: String)

Adds a reaction to the specified message.

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

Add a user to the current thread.

Link copied to clipboard

Add a user to the current thread.

Link copied to clipboard
suspend fun bulkDeleteMessages(bulkMessageDelete: BulkMessageDelete): BulkMessageDelete

Bulk delete messages in this channel.

Link copied to clipboard
suspend fun createInvite(createInvite: CreateInvite): Invite

Create an invite for this channel.

Link copied to clipboard
suspend fun createMessage(message: CreateMessage): Message

Create a message in this channel.

suspend fun createMessage(message: CreateMessage, attachment: FileData): Message

Create a message in this channel with an attachment.

Link copied to clipboard
suspend fun createThread(createThread: CreateThreadWithType): GuildThread

Create a thread not connected to an existing message.

Link copied to clipboard
suspend fun createThreadFromMessage(messageId: String, createThread: CreateThread): GuildThread

Create a thread from an existing message.

Link copied to clipboard

Create a thread from an existing message.

Link copied to clipboard
suspend fun createWebhook(webhook: CreateWebhook): Webhook

Create a webhook for this channel.

Link copied to clipboard
suspend fun crosspostMessage(messageId: String): Message

Crosspost a message in a GuildNewsChannel to following channels.

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 deleteAllMessageReactions(messageId: String)

Delete all reactions from a message.

suspend fun deleteAllMessageReactions(messageId: String, emoji: Emoji)
suspend fun deleteAllMessageReactions(messageId: String, textEmoji: String)

Delete all reactions from a message for a specific emoji.

Link copied to clipboard
suspend fun deleteChannel()

Delete this channel or thread, or closes it if it is a DM.

Link copied to clipboard
suspend fun deleteMessage(messageId: String)

Delete a message in this channel.

Link copied to clipboard
suspend fun deletePermissions(overwriteId: String)

Delete a permissions set for this channel.

Link copied to clipboard
suspend fun editMessage(messageId: String, messageEdit: MessageEdit): Message

Edit a message in this channel.

Link copied to clipboard
suspend fun editPermissions(overwrite: Overwrite)

Edit the permissions for this channel.

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

Get a list of active threads and associated members for the current channel.

Link copied to clipboard
suspend fun getChannel(): Channel

Get this channel.

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

Get the invites for this channel.

Link copied to clipboard

Get a list of joined private threads.

Link copied to clipboard
suspend fun getMessage(messageId: String): Message

Get a specific message from this channel.

Link copied to clipboard
suspend fun getMessageReactions(messageId: String, emoji: Emoji): List<User>

Get all reactions from a message for a given custom emoji.

suspend fun getMessageReactions(messageId: String, textEmoji: String): List<User>

Get all reactions from a message for a given emoji.

Link copied to clipboard
suspend fun getMessages(limit: Int = 50): List<Message>

Get messages from this channel.

Link copied to clipboard
suspend fun getMessagesAfter(limit: Int = 50, messageId: String): List<Message>

Get messages from this channel, after a given message.

Link copied to clipboard
suspend fun getMessagesAround(limit: Int = 50, messageId: String): List<Message>

Get messages from this channel, around a given message.

Link copied to clipboard
suspend fun getMessagesBefore(limit: Int = 50, messageId: String): List<Message>

Get messages from this channel, before a given message.

Link copied to clipboard

Get the pinned messages from this channel.

Link copied to clipboard

Get a list of private archived threads and associated members for the current channel.

Link copied to clipboard

Get a list of public archived threads and associated members for the current channel.

Link copied to clipboard

Get a list of members for the current thread.

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

Get the webhooks in this channel.

Link copied to clipboard
suspend fun joinThread()

Join the current thread.

Link copied to clipboard
suspend fun leaveThread()

Leave the current thread.

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
suspend fun pinMessage(messageId: String)

Pin a message in this channel.

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
open suspend override fun PUT(majorPath: String, minorPath: String, rateKey: String, omitNulls: Boolean, block: HttpRequestBuilder.() -> Unit): HttpResponse
Link copied to clipboard
suspend fun removeGroupDMRecipient(userId: String)

Remove a user from this group DM.

Link copied to clipboard
suspend fun removeMessageReaction(messageId: String, emoji: Emoji, userId: String = "@me")
suspend fun removeMessageReaction(messageId: String, emojiText: String, userId: String = "@me")

Remove a reaction from a message.

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

Remove a user from the current thread.

Link copied to clipboard

Remove a user from the current thread.

Link copied to clipboard
suspend fun ChannelClient.sendEmbed(message: String = "", components: List<ActionRow>? = null, block: Embed.() -> Unit): Message

Calls ChannelClient.createMessage for embedded messages without needing to create a CreateMessage object first. Also accepts a lambda that can be used to configure an Embed object.

Link copied to clipboard
suspend fun ChannelClient.sendEmbeddedImage(message: String = "", image: FileData, block: Embed.() -> Unit): Message

Calls ChannelClient.createMessage for embedded messages and images without needing to create a CreateMessage object first. Also accepts a lambda that can be used to configure an Embed object.

Link copied to clipboard
suspend fun ChannelClient.sendEmbeddedImageReply(message: Message, reply: String = "", image: FileData, block: Embed.() -> Unit): Message

Calls ChannelClient.createMessage to reply to a specific text message with an embedded message and image without needing to create a CreateMessage object first. Also accepts a lambda that can be used to configure an Embed object.

Link copied to clipboard
suspend fun ChannelClient.sendEmbeddedReply(message: Message, reply: String = "", components: List<ActionRow>? = null, block: Embed.() -> Unit): Message

Calls ChannelClient.createMessage to reply to a specific text message with an embedded message without needing to create a CreateMessage object first. Also accepts a lambda that can be used to configure an Embed object.

Link copied to clipboard
suspend fun ChannelClient.sendFile(data: FileData, comment: String = ""): Message

Calls ChannelClient.createMessage for to attach a file without needing to create a CreateMessage object first.

suspend fun ChannelClient.sendFile(file: File, comment: String = ""): Message
suspend fun ChannelClient.sendFile(path: Path, comment: String = ""): Message

Calls ChannelClient.createMessage for text messages without needing to create a CreateMessage object first.

Link copied to clipboard
suspend fun ChannelClient.sendMessage(message: String = "", vararg embeds: Embed, components: List<ActionRow>? = null): Message

Calls ChannelClient.createMessage for text messages without needing to create a CreateMessage object first.

Link copied to clipboard
suspend fun ChannelClient.sendReply(message: Message, reply: String = "", embed: Embed? = null, components: List<ActionRow>? = null): Message

Calls ChannelClient.createMessage to reply to a specific text message without needing to create a CreateMessage object first.

Link copied to clipboard

Indicate that the current user is typing in this channel.

Link copied to clipboard
suspend fun unpinMessage(messageId: String)

Unpin a message in this channel.

Link copied to clipboard
suspend fun updateBitrate(bitrate: Int?): Channel

Update the channel's bitrate.

Link copied to clipboard
suspend fun updateDefaultAutoArchiveDuration(defaultAutoArchiveDuration: Int?): Channel

Update the channel's default duration for newly created threads to automatically archive after recent activity.

Link copied to clipboard
suspend fun updateName(name: String): Channel

Update this channel's name.

Link copied to clipboard
suspend fun updateNSFW(isNSFW: Boolean): Channel

Update if this channel is NSFW.

Link copied to clipboard
suspend fun updateParentChannel(parentId: String?): Channel

Update the channel's parent.

Link copied to clipboard
suspend fun updatePermissions(permissionsOverwrites: List<Overwrite>): Channel

Update the channel's permissions.

Link copied to clipboard
suspend fun updatePosition(position: Int?): Channel

Update this channel's position.

Link copied to clipboard
suspend fun updateRtcRegion(regionId: String?): Channel

Update the channel's voice region.

Link copied to clipboard
suspend fun updateTopic(topic: String?): Channel

Update this channel's topic.

Link copied to clipboard
suspend fun updateType(type: ChannelType): Channel

Update this channel's type.

Link copied to clipboard
suspend fun updateUserLimit(userLimit: Int?): Channel

Update the channel's user limit.

Link copied to clipboard
suspend fun updateUserRateLimit(rateLimit: Int?): Channel

Update the channel's per-user rate limit.

Link copied to clipboard
suspend fun updateVideoQualityMode(videoQualityMode: VideoQualityMode?): Channel

Update the channel's video quality mode.