Package-level declarations

Contains all models and helper functions for Discord REST API

Types

Link copied to clipboard
data class AuditLogChange<out T : Any>(val key: AuditLogChangeKey, val newValue: T? = null, val oldValue: T? = null)
Link copied to clipboard
data class AuditLogEntry(val targetId: String? = null, val changes: List<AuditLogChange<Any>>? = null, val userId: Snowflake? = null, val id: Snowflake, val actionType: AuditLogEvent, val reason: String? = null)
Link copied to clipboard

Box is generic container for type T, which can be marked as absent (empty). Behaves similarly to Java's Optional, but allows nullable types as well.

Link copied to clipboard
Link copied to clipboard
data class FileData(val data: () -> Input, val filename: String, val contentType: ContentType = ContentType.Application.OctetStream)
Link copied to clipboard
sealed class FormatTag
Link copied to clipboard

Marks symbol being automatically generated by codegen

Link copied to clipboard
Link copied to clipboard
fun interface MessageFilter

General-purpose interface for filtering messages.

Link copied to clipboard
interface MessageList

List-like interface to transparently access cached and retrieve not-yet-received messages from Discord.

Link copied to clipboard
enum OSName : Enum<OSName>

Enumeration of OS supported by Kiscord

Link copied to clipboard

Efficiently stores a permission set

Link copied to clipboard
interface ResponseResult
Link copied to clipboard
class RestChannelMessageList(val client: Kiscord, val channelId: Snowflake, filter: MessageFilter = MessageFilter.All) : MessageList
Link copied to clipboard

Discord utilizes Twitter's snowflake format for uniquely identifiable descriptors (IDs). These IDs are guaranteed to be unique across all of Discord, except in some unique scenarios in which child objects share their parent's ID.

Link copied to clipboard
class SnowflakeRange(val start: Snowflake, val endInclusive: Snowflake) : ClosedRange<Snowflake>
Link copied to clipboard
sealed class Token
Link copied to clipboard
data class UnavailableGuild(val id: Snowflake, val unavailable: Boolean) : GuildSpec

Functions

Link copied to clipboard
Link copied to clipboard
fun Message.asReference(failIfNotExists: Boolean = true): MessageReference

Create reference from the given message.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun Snowflake.component1(): ULong
Link copied to clipboard
operator fun Snowflake.component2(): Byte
Link copied to clipboard
operator fun Snowflake.component3(): Byte
Link copied to clipboard
operator fun Snowflake.component4(): Short
Link copied to clipboard
infix inline fun <T : Any> Box<T?>.computeIfNull(another: () -> T): T
Link copied to clipboard
Link copied to clipboard
inline suspend fun ChannelApi.createReaction(channelId: Snowflake, messageId: Snowflake, emoji: String): Boolean

Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success.

Link copied to clipboard

Deletes all the reactions for a given emoji on a message. This endpoint requires the MANAGE_MESSAGES permission to be present on the current user.

Link copied to clipboard

Deletes the followup message.

Link copied to clipboard

Deletes the initial Interaction response.

Link copied to clipboard
inline suspend fun ChannelApi.deleteOwnReaction(channelId: Snowflake, messageId: Snowflake, emoji: String): Boolean

Delete a reaction the current user has made for the message

Link copied to clipboard
inline suspend fun ChannelApi.deleteUserReaction(channelId: Snowflake, messageId: Snowflake, emoji: String, userId: Snowflake): Boolean

Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user.

Link copied to clipboard
Link copied to clipboard

Edit the message

Link copied to clipboard
inline suspend fun Interaction.editFollowUp(messageId: Snowflake, block: EditMessage.Builder.() -> Unit): Message

Edits the followup message.

Link copied to clipboard

Edits the initial Interaction response with message

Edits the initial Interaction response. with message builder

Link copied to clipboard
fun Embed.Builder.field(name: String, value: String, inline: Boolean = false)
Link copied to clipboard
fun FileData(data: ByteArray, filename: String, contentType: ContentType = ContentType.Application.OctetStream): FileData
Link copied to clipboard
Link copied to clipboard

Creates followup message.

Link copied to clipboard
fun MessageFilter.Builder.fromDate(date: Instant, inclusive: Boolean = true)
Link copied to clipboard
fun MessageFilter.Builder.fromId(id: Snowflake, inclusive: Boolean = true)
Link copied to clipboard
infix inline fun <T> Box<T>.getOr(another: T): T
infix inline fun <T> Box<T>.getOr(another: () -> T): T
Link copied to clipboard
suspend fun ChannelApi.getReactions(channelId: Snowflake, messageId: Snowflake, emoji: String): List<User>

Get a list of users that reacted with this emoji.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
infix inline fun <T, R> Box<T>.map(block: (T) -> R): Box<R>
Link copied to clipboard

Retrieves MessageList for a specified channel.

Link copied to clipboard
operator fun PermissionSet.minus(permission: Permission): PermissionSet

Returns a set containing all permissions of the original set except the given permission.

operator fun PermissionSet.minus(permissions: PermissionSet): PermissionSet
operator fun PermissionSet.minus(permissions: Iterable<Permission>): PermissionSet

Returns a set containing all permissions of the original set except the permissions contained in the given permissions collection.

operator fun PermissionSet.minus(permissions: Array<out Permission>): PermissionSet

Returns a set containing all permissions of the original set except the permissions contained in the given permissions array.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
infix inline fun <T> Box<T>.or(another: T): Box<T>
infix inline fun <T> Box<T>.or(another: Box<T>): Box<T>
infix inline fun <T> Box<T>.or(another: () -> T): Box<T>
Link copied to clipboard

Returns an empty permission set.

fun permissionSetOf(vararg permissions: Permission): PermissionSet

Returns a new set of the given permissions.

Link copied to clipboard
Link copied to clipboard
operator fun PermissionSet.plus(permission: Permission): PermissionSet

Returns a set containing all permissions of the original set and then the given permission if it isn't already in this set.

operator fun PermissionSet.plus(permissions: PermissionSet): PermissionSet
operator fun PermissionSet.plus(permissions: Iterable<Permission>): PermissionSet

Returns a set containing all permissions of the original set and then the given permissions collection, which aren't already in this set.

operator fun PermissionSet.plus(permissions: Array<out Permission>): PermissionSet

Returns a set containing all permissions of the original set and then the given permissions array, which aren't already in this set.

Link copied to clipboard
Link copied to clipboard
inline suspend fun Message.reply(failIfNotExists: Boolean = true, block: CreateMessage.Builder.() -> Unit): Message

Reply to the message in the originating channel with message builder

Link copied to clipboard
suspend fun Message.replyWithTypingIndicator(failIfNotExists: Boolean = true, block: suspend CreateMessage.Builder.() -> Unit): Message

Reply to the message in the originating channel with message builder and typing indicator

Link copied to clipboard

Respond to the interaction with response

Respond to the interaction with response builder

Respond to the message in the originating channel with message builder

Respond to the interaction with response with specified type and optional response data builder

Link copied to clipboard

Respond to the message in the originating channel with message builder and typing indicator

Link copied to clipboard
fun Activity.Builder.streaming(name: String, url: Url? = null)
fun Activity.Builder.streaming(name: String, url: String? = null)
Link copied to clipboard
fun User.tag(nickname: Boolean = false): FormatTag
fun Instant.tag(style: FormatTag.Timestamp.Style? = null): FormatTag
Link copied to clipboard
fun MessageFilter.Builder.toDate(date: Instant, inclusive: Boolean = true)
Link copied to clipboard
fun MessageFilter.Builder.toId(id: Snowflake, inclusive: Boolean = true)
Link copied to clipboard

Returns PermissionSet that contains all permissions of the original array.

Returns PermissionSet that contains all permissions of the original collection.

Link copied to clipboard
suspend fun <R> ChannelApi.triggerTypingIndicator(channelId: Snowflake, block: suspend () -> R): R

Post a typing indicator for the specified channel all time while block executed.

Link copied to clipboard
fun Embed.validate(allowEmptyFields: Boolean = true)

Validate Embed by using embed limits.

Link copied to clipboard

Properties

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

Number of milliseconds since discord epoch (first second of 2015)

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

For every ID that is generated on that process this value increments

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val <T> Box<T>.orNull: T?
Link copied to clipboard

Internal process ID who generates that snowflake

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val Snowflake.time: Instant

Time of generation given snowflake

Link copied to clipboard

Number of milliseconds since unix epoch (first second of 1970)

Link copied to clipboard

Internal worker ID who generates that snowflake