commonMain.builder.message.EmbedBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-rest Show documentation
Show all versions of kord-rest Show documentation
Idiomatic Kotlin Wrapper for The Discord API
package dev.kord.rest.builder.message
import dev.kord.common.Color
import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalBoolean
import dev.kord.common.entity.optional.delegate.delegate
import dev.kord.common.entity.optional.map
import dev.kord.common.entity.optional.mapList
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.*
import kotlinx.datetime.Instant
/**
* A builder for discord embeds.
*
* Inline Markdown links are supported in in all description-like fields.
*/
@KordDsl
public class EmbedBuilder : RequestBuilder {
public companion object {
/**
* Utility default value for fields.
* While blank values are not allowed, this value can be used to trick Discord into rendering a Field as empty.
*/
public const val ZERO_WIDTH_SPACE: String = "\u200E"
}
private var _title: Optional = Optional.Missing()
/**
* The title of the embed. Limited to the length of [Limits.title].
*/
public var title: String? by ::_title.delegate()
private var _description: Optional = Optional.Missing()
/**
* The description of the embed. Limited to the length of [Limits.description].
*/
public var description: String? by ::_description.delegate()
private var _url: Optional = Optional.Missing()
/**
* The url of the embed's [title].
*/
public var url: String? by ::_url.delegate()
private var _timestamp: Optional = Optional.Missing()
/**
* The timestamp displayed at the bottom of the embed.
*/
public var timestamp: Instant? by ::_timestamp.delegate()
private var _color: Optional = Optional.Missing()
/**
* The color of the embed.
*/
public var color: Color? by ::_color.delegate()
private var _image: Optional = Optional.Missing()
/**
* The image url of the embed.
*/
public var image: String? by ::_image.delegate()
private var _footer: Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy