From 61a3c94f498a509b6dce8e061d4402d9690cc83d Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 21 Mar 2024 21:46:47 +0100 Subject: [PATCH 01/26] Add Poll entities --- .../dev/kord/common/entity/PollLayoutType.kt | 82 ++++++++++++++++ .../kotlin/entity/DiscordMessage.kt | 93 ++++++++++++++++++- 2 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt new file mode 100644 index 00000000000..be3cc657002 --- /dev/null +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt @@ -0,0 +1,82 @@ +// THIS FILE IS AUTO-GENERATED, DO NOT EDIT! +@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral", + "SpellCheckingInspection", "GrazieInspection")) + +package dev.kord.common.entity + +import kotlin.LazyThreadSafetyMode.PUBLICATION +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * See [PollLayoutType]s in the + * [Discord Developer Documentation](https://discord.com/developers/docs/resources/poll#layout-type). + */ +@Serializable(with = PollLayoutType.Serializer::class) +public sealed class PollLayoutType( + /** + * The raw value used by Discord. + */ + public val `value`: Int, +) { + final override fun equals(other: Any?): Boolean = this === other || + (other is PollLayoutType && this.value == other.value) + + final override fun hashCode(): Int = value.hashCode() + + final override fun toString(): String = + if (this is Unknown) "PollLayoutType.Unknown(value=$value)" + else "PollLayoutType.${this::class.simpleName}" + + /** + * An unknown [PollLayoutType]. + * + * This is used as a fallback for [PollLayoutType]s that haven't been added to Kord yet. + */ + public class Unknown internal constructor( + `value`: Int, + ) : PollLayoutType(value) + + /** + * The, uhm, default layout type. + */ + public object DEFAULT : PollLayoutType(1) + + internal object Serializer : KSerializer { + override val descriptor: SerialDescriptor = + PrimitiveSerialDescriptor("dev.kord.common.entity.PollLayoutType", + PrimitiveKind.INT) + + override fun serialize(encoder: Encoder, `value`: PollLayoutType) { + encoder.encodeInt(value.value) + } + + override fun deserialize(decoder: Decoder): PollLayoutType = from(decoder.decodeInt()) + } + + public companion object { + /** + * A [List] of all known [PollLayoutType]s. + */ + public val entries: List by lazy(mode = PUBLICATION) { + listOf( + DEFAULT, + ) + } + + + /** + * Returns an instance of [PollLayoutType] with [PollLayoutType.value] equal to the + * specified [value]. + */ + public fun from(`value`: Int): PollLayoutType = when (value) { + 1 -> DEFAULT + else -> Unknown(value) + } + } +} diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index 6cd1a5bc853..1eb994cc75b 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -121,6 +121,14 @@ ], ) +@file:Generate( + INT_KORD_ENUM, name = "PollLayoutType", + docUrl = "https://discord.com/developers/docs/resources/poll#layout-type", + entries = [ + Entry("DEFAULT", intValue = 1, kDoc = "The, uhm, default layout type.") + ] +) + package dev.kord.common.entity import dev.kord.common.entity.optional.Optional @@ -184,6 +192,7 @@ import kotlinx.serialization.Serializable * @param roleSubscriptionData [RoleSubscription] object data of the role subscription purchase or renewal that prompted this message. * @param applicationId if the message is a response to an [Interaction][DiscordInteraction], this is the id of the interaction's application * @param components a list of [components][DiscordComponent] which have been added to this message + * @param poll the poll in this message if any */ @Serializable @@ -236,7 +245,8 @@ public data class DiscordMessage( val components: Optional> = Optional.Missing(), val interaction: Optional = Optional.Missing(), val thread: Optional = Optional.Missing(), - val position: OptionalInt = OptionalInt.Missing + val position: OptionalInt = OptionalInt.Missing, + val poll: Optional = Optional.Missing() ) /** @@ -691,3 +701,84 @@ public data class RoleSubscription( @SerialName("is_renewal") val isRenewal: Boolean ) + +/** + * Representation of a poll. + * + * @property question the question + * @property answers a list of [answers][Answer] + * @property expiry the [Instant] of the polls end + * @property allowMultiselect Whether a user can select multiple answers + * @property layoutType the [layout type][PollLayoutType] of the poll + */ +@Serializable +public data class DiscordPoll( + val question: Media, + val answers: List, + val expiry: Instant, + @SerialName("allow_multiselect") + val allowMultiselect: Boolean, + @SerialName("layout_type") + val layoutType: PollLayoutType, + val results: Results +) { + /** + * Shared object between answers and questions. + * + * @property text the text + * @property emoji the emoji + */ + @Serializable + public data class Media( + val text: Optional = Optional.Missing(), + val emoji: Optional = Optional.Missing() + ) + + /** + * Representation of a possible answer to a poll + * + * @property answerId the ID of the answer + * @property pollMedia the data of the answer + */ + @Serializable + public data class Answer( + @SerialName("answer_id") + val answerId: Int, + @SerialName("poll_media") + val pollMedia: Media + ) + + @Serializable + public data class Results( + @SerialName("is_finalized") + val isFinalized: Boolean, + @SerialName("answer_counts") + val answerCounts: List + ) { + /** + * In a nutshell, this contains the number of votes for each answer. + * + * Due to the intricacies of counting at scale, while a poll is in progress the results may not + * be perfectly accurate. + * They usually are accurate, and shouldn't deviate significantly -- it's just difficult to make guarantees. + * + * To compensate for this, after a poll is finished there is a background job which performs a final, + * accurate tally of votes. + * This tally has concluded once [dev.kord.common.entity.Poll.Results.isFinalized] is `true`. + * + * If [dev.kord.common.entity.Poll.Results.answerCounts] does not contain an entry for a particular answer, + * then there are no votes for that answer. + * + * @property id the [Answer.answerId] + * @property count the number of votes for this answer + * @property meVoted whether the current user voted for this answer + */ + @Serializable + public data class AnswerCount( + val id: Int, + val count: Int, + @SerialName("me_voted") + val meVoted: Boolean + ) + } +} From 18ddf0b8437572846d2ddb949a1dabb18ef05afa Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 21 Mar 2024 21:47:33 +0100 Subject: [PATCH 02/26] Add poll to create request --- common/src/commonMain/kotlin/entity/Interactions.kt | 3 ++- rest/src/commonMain/kotlin/json/request/MessageRequests.kt | 3 ++- rest/src/commonMain/kotlin/json/request/WebhookRequests.kt | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/commonMain/kotlin/entity/Interactions.kt b/common/src/commonMain/kotlin/entity/Interactions.kt index 906562bdc80..96e1355672c 100644 --- a/common/src/commonMain/kotlin/entity/Interactions.kt +++ b/common/src/commonMain/kotlin/entity/Interactions.kt @@ -308,7 +308,8 @@ public data class InteractionCallbackData( @SerialName("component_type") val componentType: Optional = Optional.Missing(), val values: Optional> = Optional.Missing(), - val components: Optional> = Optional.Missing() + val components: Optional> = Optional.Missing(), + val poll: Optional = Optional.Missing() ) @Serializable(with = Option.Serializer::class) diff --git a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt index f451d6da3b3..1f25168ae13 100644 --- a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt @@ -23,7 +23,8 @@ public data class MessageCreateRequest( @SerialName("sticker_ids") val stickerIds: Optional> = Optional.Missing(), val attachments: Optional> = Optional.Missing(), - val flags: Optional = Optional.Missing() + val flags: Optional = Optional.Missing(), + val poll: Optional = Optional.Missing() ) public data class MultipartMessageCreateRequest( diff --git a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt index ffb33654529..4eebe8c9014 100644 --- a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt @@ -2,6 +2,7 @@ package dev.kord.rest.json.request import dev.kord.common.entity.AllowedMentions import dev.kord.common.entity.DiscordComponent +import dev.kord.common.entity.DiscordPoll import dev.kord.common.entity.MessageFlags import dev.kord.common.entity.Snowflake import dev.kord.common.entity.optional.Optional @@ -39,6 +40,7 @@ public data class WebhookExecuteRequest( val threadName: Optional = Optional.Missing(), @SerialName("applied_tags") val appliedTags: Optional> = Optional.Missing(), + val poll: Optional = Optional.Missing() ) public data class MultiPartWebhookExecuteRequest( From 3ee35ec8aff2fc725b148b59d52b57b4043b4015 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 21 Mar 2024 22:35:01 +0100 Subject: [PATCH 03/26] Add builders --- .../kotlin/entity/DiscordMessage.kt | 2 +- .../kotlin/builder/message/PollBuilder.kt | 122 ++++++++++++++++++ .../create/ForumMessageCreateBuilder.kt | 1 + .../InteractionResponseCreateBuilder.kt | 1 + .../message/create/MessageCreateBuilder.kt | 99 ++++++++++++++ .../create/UserMessageCreateBuilder.kt | 1 + .../create/WebhookMessageCreateBuilder.kt | 1 + .../json/request/InteractionsRequests.kt | 2 + .../kotlin/json/request/MessageRequests.kt | 17 ++- .../kotlin/json/request/WebhookRequests.kt | 4 +- .../kotlin/dev/kord/core/PingBot.kt | 15 +++ 11 files changed, 260 insertions(+), 5 deletions(-) create mode 100644 rest/src/commonMain/kotlin/builder/message/PollBuilder.kt diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index 1eb994cc75b..e4080d05224 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -246,7 +246,7 @@ public data class DiscordMessage( val interaction: Optional = Optional.Missing(), val thread: Optional = Optional.Missing(), val position: OptionalInt = OptionalInt.Missing, - val poll: Optional = Optional.Missing() + val poll: Optional = Optional.Missing() ) /** diff --git a/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt new file mode 100644 index 00000000000..49658159b51 --- /dev/null +++ b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt @@ -0,0 +1,122 @@ +package dev.kord.rest.builder.message + +import dev.kord.common.annotation.KordDsl +import dev.kord.rest.json.request.CreatablePoll +import dev.kord.common.entity.DiscordPartialEmoji +import dev.kord.common.entity.DiscordPoll +import dev.kord.common.entity.PollLayoutType +import dev.kord.common.entity.Snowflake +import dev.kord.common.entity.optional.Optional +import dev.kord.common.entity.optional.coerceToMissing +import dev.kord.common.entity.optional.delegate.delegate +import dev.kord.rest.builder.RequestBuilder +import kotlinx.datetime.Clock +import kotlinx.datetime.Instant +import kotlin.time.Duration + +/** + * A builder for a [CreatablePoll]. + * + * @property question the question + * @property answers a list of possible answers + * @property expiry the [Instant] of poll expiry + * @property allowMultiselect whether users should be allowed to select multiple answers + * @property layoutType the [PollLayoutType] + */ +@KordDsl +public class PollBuilder : RequestBuilder { + public var question: DiscordPoll.Media? = null + public val answers: MutableList = mutableListOf() + + public var expiry: Instant? = null + + internal var _allowMultiselect: Optional = Optional.Missing() + public var allowMultiselect: Boolean? by ::_allowMultiselect.delegate() + + public var layoutType: PollLayoutType = PollLayoutType.DEFAULT + + /** + * Sets the polls [Duration] to [duration]. + */ + public fun expiresIn(duration: Duration) { + expiry = Clock.System.now() + duration + } + + /** + * Adds a question with [title]. + */ + // to resolve resolution ambiguity + public fun question(title: String): Unit = question(title, emoji = null) + + /** + * Adds a question with [title] and [emojiUnicode]. + */ + public fun question(title: String, emojiUnicode: String? = null) { + question = DiscordPoll.Media( + Optional(title), + Optional(emojiUnicode?.let { DiscordPartialEmoji(name = it) }).coerceToMissing() + ) + } + + /** + * Adds a question with [title] and [emoji]. + */ + public fun question(title: String, emoji: Snowflake? = null) { + question = DiscordPoll.Media( + Optional(title), + Optional(emoji?.let { DiscordPartialEmoji(id = it) }).coerceToMissing() + ) + } + + /** + * Adds an answer with [title]. + * + * @param id the answer id + */ + public fun answer(title: String, id: Int = answers.size): Unit = + answer(title, emoji = null, id) + + /** + * Adds an answer with [title] and [emojiUnicode]. + * + * @param id the answer id + */ + public fun answer(title: String, emojiUnicode: String? = null, id: Int = answers.size) { + require(answers.size < 10) { "Cannot add more than 10 answers" } + answers.add( + DiscordPoll.Answer( + answerId = id, + pollMedia = DiscordPoll.Media( + Optional(title), + Optional(emojiUnicode?.let { DiscordPartialEmoji(name = it) }).coerceToMissing() + ) + ) + ) + } + + /** + * Adds an answer with [title] and [emoji]. + * + * @param id the answer id + */ + public fun answer(title: String, emoji: Snowflake? = null, id: Int = answers.size) { + require(answers.size < 10) { "Cannot add more than 10 answers" } + answers.add( + DiscordPoll.Answer( + answerId = id, + pollMedia = DiscordPoll.Media( + Optional(title), + Optional(emoji?.let { DiscordPartialEmoji(id = it) }).coerceToMissing() + ) + ) + ) + } + + override fun toRequest(): CreatablePoll = CreatablePoll( + question ?: error("Please set a question"), + answers, + expiry ?: error("Please set an expiry"), + _allowMultiselect, + layoutType + ) +} \ No newline at end of file diff --git a/rest/src/commonMain/kotlin/builder/message/create/ForumMessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/ForumMessageCreateBuilder.kt index fc2ac568bb9..a3dfea221f9 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/ForumMessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/ForumMessageCreateBuilder.kt @@ -33,6 +33,7 @@ public class ForumMessageCreateBuilder : stickerIds = _stickerIds.mapCopy(), attachments = _attachments.mapList { it.toRequest() }, flags = buildMessageFlags(flags, suppressEmbeds, suppressNotifications), + poll = _poll ), files = files.toList(), ) diff --git a/rest/src/commonMain/kotlin/builder/message/create/InteractionResponseCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/InteractionResponseCreateBuilder.kt index 73894826536..80ceb2c35fa 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/InteractionResponseCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/InteractionResponseCreateBuilder.kt @@ -30,6 +30,7 @@ public class InteractionResponseCreateBuilder(public val ephemeral: Boolean = fa flags = buildMessageFlags(flags, suppressEmbeds, suppressNotifications, ephemeral), components = _components.mapList { it.build() }, attachments = _attachments.mapList { it.toRequest() }, + poll = _poll ).optional(), ), files = files.toList(), diff --git a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt index 5e4cd3087dc..d0f204ae1ea 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt @@ -1,16 +1,24 @@ package dev.kord.rest.builder.message.create import dev.kord.common.annotation.KordDsl +import dev.kord.common.entity.MessageFlag import dev.kord.common.entity.MessageFlags 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.rest.NamedFile +import dev.kord.rest.builder.component.ActionRowBuilder import dev.kord.rest.builder.component.MessageComponentBuilder import dev.kord.rest.builder.message.AllowedMentionsBuilder import dev.kord.rest.builder.message.AttachmentBuilder import dev.kord.rest.builder.message.EmbedBuilder import dev.kord.rest.builder.message.MessageBuilder +import kotlin.contracts.InvocationKind +import kotlin.contracts.contract +import dev.kord.rest.builder.message.actionRow as actionRowExtensionOnNewSupertype +import dev.kord.rest.builder.message.allowedMentions as allowedMentionsExtensionOnNewSupertype +import dev.kord.rest.builder.message.embed as embedExtensionOnNewSupertype +import dev.kord.rest.builder.message.messageFlags as messageFlagsExtensionOnNewSupertype /** * The base builder for creating a new message. @@ -18,6 +26,11 @@ import dev.kord.rest.builder.message.MessageBuilder @KordDsl public sealed interface MessageCreateBuilder : MessageBuilder { + /** + * The poll of this message. + */ + public var poll: CreatablePoll? + /** Whether this message should be played as a text-to-speech message. */ public var tts: Boolean? @@ -63,4 +76,90 @@ public sealed class AbstractMessageCreateBuilder : MessageCreateBuilder { final override var flags: MessageFlags? = null final override var suppressEmbeds: Boolean? = null final override var suppressNotifications: Boolean? = null + + internal var _poll: Optional = Optional.Missing() + final override var poll: CreatablePoll? by ::_poll.delegate() +} + + +/** + * Adds an embed to the message, configured by the [block]. A message can have up to 10 embeds. + */ +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.LowPriorityInOverloadResolution +@Deprecated( + "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.embed'.", + ReplaceWith("this.embed(block)", imports = ["dev.kord.rest.builder.message.embed"]), + DeprecationLevel.HIDDEN, +) +public inline fun MessageCreateBuilder.embed(block: EmbedBuilder.() -> Unit) { + contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } + embedExtensionOnNewSupertype(block) +} + +/** + * Configures the mentions that should trigger a mention (aka ping). Not calling this function will result in the default behavior + * (ping everything), calling this function but not configuring it before the request is build will result in all + * pings being ignored. + */ +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.LowPriorityInOverloadResolution +@Deprecated( + "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.allowedMentions'.", + ReplaceWith("this.allowedMentions(block)", imports = ["dev.kord.rest.builder.message.allowedMentions"]), + DeprecationLevel.HIDDEN, +) +public inline fun MessageCreateBuilder.allowedMentions(block: AllowedMentionsBuilder.() -> Unit = {}) { + contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } + allowedMentionsExtensionOnNewSupertype(block) +} + +/** + * Adds an Action Row to the message, configured by the [builder]. A message can have up to 5 action rows. + */ +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.LowPriorityInOverloadResolution +@Deprecated( + "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.actionRow'.", + ReplaceWith("this.actionRow(builder)", imports = ["dev.kord.rest.builder.message.actionRow"]), + DeprecationLevel.HIDDEN, +) +public inline fun MessageCreateBuilder.actionRow(builder: ActionRowBuilder.() -> Unit) { + contract { + callsInPlace(builder, InvocationKind.EXACTLY_ONCE) + } + actionRowExtensionOnNewSupertype(builder) +} + +/** + * Sets the [MessageFlags] for the created message. + * + * **Only supports [MessageFlag.SuppressEmbeds] and [MessageFlag.SuppressNotifications]** + */ +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.LowPriorityInOverloadResolution +@Deprecated( + "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.messageFlags'.", + ReplaceWith("this.messageFlags(builder)", imports = ["dev.kord.rest.builder.message.messageFlags"]), + DeprecationLevel.HIDDEN, +) +public inline fun MessageCreateBuilder.messageFlags(builder: MessageFlags.Builder.() -> Unit) { + contract { + callsInPlace(builder, InvocationKind.EXACTLY_ONCE) + } + messageFlagsExtensionOnNewSupertype(builder) +} + +/** + * Set's the [poll][dev.kord.common.entity.DiscordMessage.poll] of this message. + * + * **Please note that if poll is set, you currently cannot set [MessageBuilder.content], + * [MessageBuilder.attachments], [MessageBuilder.embeds] or [MessageBuilder.components] + */ +public inline fun MessageCreateBuilder.poll(builder: PollBuilder.() -> Unit) { + contract { + callsInPlace(builder, InvocationKind.EXACTLY_ONCE) + } + + poll = PollBuilder().apply(builder).toRequest() } diff --git a/rest/src/commonMain/kotlin/builder/message/create/UserMessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/UserMessageCreateBuilder.kt index bd13c9ebf97..7afad8e5baa 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/UserMessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/UserMessageCreateBuilder.kt @@ -68,6 +68,7 @@ public class UserMessageCreateBuilder : AbstractMessageCreateBuilder(), RequestB stickerIds = _stickerIds.mapCopy(), attachments = _attachments.mapList { it.toRequest() }, flags = buildMessageFlags(flags, suppressEmbeds, suppressNotifications), + poll = _poll ), files = files.toList(), ) diff --git a/rest/src/commonMain/kotlin/builder/message/create/WebhookMessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/WebhookMessageCreateBuilder.kt index bdab731b9b8..4105e658de1 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/WebhookMessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/WebhookMessageCreateBuilder.kt @@ -59,6 +59,7 @@ public class WebhookMessageCreateBuilder : flags = buildMessageFlags(flags, suppressEmbeds, suppressNotifications), threadName = _threadName, appliedTags = _appliedTags.mapCopy(), + poll = _poll ), files = files.toList(), ) diff --git a/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt b/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt index f48beda6d53..5c00f7f767a 100644 --- a/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt @@ -96,6 +96,7 @@ public data class InteractionApplicationCommandCallbackData( val flags: Optional = Optional.Missing(), val components: Optional> = Optional.Missing(), val attachments: Optional> = Optional.Missing(), + val poll: Optional = Optional.Missing() ) public data class MultipartFollowupMessageCreateRequest( @@ -113,6 +114,7 @@ public data class FollowupMessageCreateRequest( val components: Optional> = Optional.Missing(), val attachments: Optional> = Optional.Missing(), val flags: Optional = Optional.Missing(), + val poll: Optional = Optional.Missing() ) @Serializable diff --git a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt index 1f25168ae13..a4521642529 100644 --- a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt @@ -24,7 +24,7 @@ public data class MessageCreateRequest( val stickerIds: Optional> = Optional.Missing(), val attachments: Optional> = Optional.Missing(), val flags: Optional = Optional.Missing(), - val poll: Optional = Optional.Missing() + val poll: Optional = Optional.Missing() ) public data class MultipartMessageCreateRequest( @@ -112,10 +112,23 @@ public data class ForumThreadMessageRequest( @SerialName("sticker_ids") val stickerIds: Optional> = Optional.Missing(), val attachments: Optional> = Optional.Missing(), - val flags: Optional = Optional.Missing() + val flags: Optional = Optional.Missing(), + val poll: Optional = Optional.Missing() ) public data class MultipartForumThreadMessageCreateRequest( val request: ForumThreadMessageRequest, val files: List = emptyList(), ) + + +@Serializable +public data class CreatablePoll( + val question: DiscordPoll.Media, + val answers: List, + val expiry: Instant, + @SerialName("allow_multiselect") + val allowMultiselect: Optional = Optional.Missing(), + @SerialName("layout_type") + val layoutType: PollLayoutType, +) diff --git a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt index 4eebe8c9014..c976bd4c39e 100644 --- a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt @@ -1,8 +1,8 @@ package dev.kord.rest.json.request import dev.kord.common.entity.AllowedMentions +import dev.kord.rest.json.request.CreatablePoll import dev.kord.common.entity.DiscordComponent -import dev.kord.common.entity.DiscordPoll import dev.kord.common.entity.MessageFlags import dev.kord.common.entity.Snowflake import dev.kord.common.entity.optional.Optional @@ -40,7 +40,7 @@ public data class WebhookExecuteRequest( val threadName: Optional = Optional.Missing(), @SerialName("applied_tags") val appliedTags: Optional> = Optional.Missing(), - val poll: Optional = Optional.Missing() + val poll: Optional = Optional.Missing() ) public data class MultiPartWebhookExecuteRequest( diff --git a/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt b/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt index 84454f9b636..c132ddf398f 100644 --- a/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt +++ b/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt @@ -1,8 +1,11 @@ package dev.kord.core +import dev.kord.core.behavior.reply import dev.kord.core.event.message.MessageCreateEvent import dev.kord.gateway.Intent import dev.kord.gateway.PrivilegedIntent +import dev.kord.rest.builder.message.create.poll +import kotlin.time.Duration.Companion.minutes suspend fun main(args: Array) { val kord = Kord(args.firstOrNull() ?: error("token required")) @@ -10,6 +13,18 @@ suspend fun main(args: Array) { kord.on { if (message.author?.isBot == true) return@on if (message.content == "!ping") message.channel.createMessage("pong") + if (message.content == "!poll") { + message.reply { + poll { + question("Does this work?") + + answer("Yes") + answer("No") + + expiresIn(5.minutes) + } + } + } } kord.login { From 57d49575cc19b5674a1261591547577b097c8412 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 21 Mar 2024 22:35:25 +0100 Subject: [PATCH 04/26] Api Dump --- common/api/common.api | 199 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 191 insertions(+), 8 deletions(-) diff --git a/common/api/common.api b/common/api/common.api index c5b3b0f34e9..64bd94e5628 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -4541,8 +4541,8 @@ public final class dev/kord/common/entity/DiscordMentionedChannel$Companion { public final class dev/kord/common/entity/DiscordMessage { public static final field Companion Ldev/kord/common/entity/DiscordMessage$Companion; - public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;IILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Z public final fun component11 ()Ljava/util/List; @@ -4569,14 +4569,15 @@ public final class dev/kord/common/entity/DiscordMessage { public final fun component30 ()Ldev/kord/common/entity/optional/Optional; public final fun component31 ()Ldev/kord/common/entity/optional/Optional; public final fun component32 ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun component33 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ldev/kord/common/entity/DiscordUser; public final fun component5 ()Ldev/kord/common/entity/optional/Optional; public final fun component6 ()Ljava/lang/String; public final fun component7 ()Lkotlinx/datetime/Instant; public final fun component8 ()Lkotlinx/datetime/Instant; public final fun component9 ()Z - public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;)Ldev/kord/common/entity/DiscordMessage; - public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordMessage;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordMessage; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordMessage; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordMessage;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/DiscordUser;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;IILjava/lang/Object;)Ldev/kord/common/entity/DiscordMessage; public fun equals (Ljava/lang/Object;)Z public final fun getActivity ()Ldev/kord/common/entity/optional/Optional; public final fun getApplication ()Ldev/kord/common/entity/optional/Optional; @@ -4600,6 +4601,7 @@ public final class dev/kord/common/entity/DiscordMessage { public final fun getMessageReference ()Ldev/kord/common/entity/optional/Optional; public final fun getNonce ()Ldev/kord/common/entity/optional/Optional; public final fun getPinned ()Z + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getPosition ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getReactions ()Ldev/kord/common/entity/optional/Optional; public final fun getReferencedMessage ()Ldev/kord/common/entity/optional/Optional; @@ -5289,6 +5291,163 @@ public final class dev/kord/common/entity/DiscordPinsUpdateData$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/kord/common/entity/DiscordPoll { + public static final field Companion Ldev/kord/common/entity/DiscordPoll$Companion; + public fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)V + public final fun component1 ()Ldev/kord/common/entity/DiscordPoll$Media; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Lkotlinx/datetime/Instant; + public final fun component4 ()Z + public final fun component5 ()Ldev/kord/common/entity/PollLayoutType; + public final fun component6 ()Ldev/kord/common/entity/DiscordPoll$Results; + public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)Ldev/kord/common/entity/DiscordPoll; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll; + public fun equals (Ljava/lang/Object;)Z + public final fun getAllowMultiselect ()Z + public final fun getAnswers ()Ljava/util/List; + public final fun getExpiry ()Lkotlinx/datetime/Instant; + public final fun getLayoutType ()Ldev/kord/common/entity/PollLayoutType; + public final fun getQuestion ()Ldev/kord/common/entity/DiscordPoll$Media; + public final fun getResults ()Ldev/kord/common/entity/DiscordPoll$Results; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/DiscordPoll$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Answer { + public static final field Companion Ldev/kord/common/entity/DiscordPoll$Answer$Companion; + public fun (ILdev/kord/common/entity/DiscordPoll$Media;)V + public final fun component1 ()I + public final fun component2 ()Ldev/kord/common/entity/DiscordPoll$Media; + public final fun copy (ILdev/kord/common/entity/DiscordPoll$Media;)Ldev/kord/common/entity/DiscordPoll$Answer; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll$Answer;ILdev/kord/common/entity/DiscordPoll$Media;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll$Answer; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnswerId ()I + public final fun getPollMedia ()Ldev/kord/common/entity/DiscordPoll$Media; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/DiscordPoll$Answer$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Answer$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Answer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Answer;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Answer$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Media { + public static final field Companion Ldev/kord/common/entity/DiscordPoll$Media$Companion; + public fun ()V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/kord/common/entity/optional/Optional; + public final fun component2 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordPoll$Media; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll$Media;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll$Media; + public fun equals (Ljava/lang/Object;)Z + public final fun getEmoji ()Ldev/kord/common/entity/optional/Optional; + public final fun getText ()Ldev/kord/common/entity/optional/Optional; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/DiscordPoll$Media$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Media$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Media; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Media;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Media$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Results { + public static final field Companion Ldev/kord/common/entity/DiscordPoll$Results$Companion; + public fun (ZLjava/util/List;)V + public final fun component1 ()Z + public final fun component2 ()Ljava/util/List; + public final fun copy (ZLjava/util/List;)Ldev/kord/common/entity/DiscordPoll$Results; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll$Results;ZLjava/util/List;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll$Results; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnswerCounts ()Ljava/util/List; + public fun hashCode ()I + public final fun isFinalized ()Z + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/DiscordPoll$Results$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Results$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Results$AnswerCount { + public static final field Companion Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount$Companion; + public fun (IIZ)V + public final fun component1 ()I + public final fun component2 ()I + public final fun component3 ()Z + public final fun copy (IIZ)Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount;IIZILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount; + public fun equals (Ljava/lang/Object;)Z + public final fun getCount ()I + public final fun getId ()I + public final fun getMeVoted ()Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/DiscordPoll$Results$AnswerCount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Results$AnswerCount$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordPoll$Results$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/kord/common/entity/DiscordPresenceUpdate { public static final field Companion Ldev/kord/common/entity/DiscordPresenceUpdate$Companion; public fun (Ldev/kord/common/entity/DiscordPresenceUser;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/PresenceStatus;Ljava/util/List;Ldev/kord/common/entity/DiscordClientStatus;)V @@ -6880,11 +7039,12 @@ public final class dev/kord/common/entity/IntegrationExpireBehavior$Unknown : de public final class dev/kord/common/entity/InteractionCallbackData { public static final field Companion Ldev/kord/common/entity/InteractionCallbackData$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; public final fun component11 ()Ldev/kord/common/entity/optional/Optional; + public final fun component12 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component4 ()Ldev/kord/common/entity/optional/Optional; @@ -6893,8 +7053,8 @@ public final class dev/kord/common/entity/InteractionCallbackData { public final fun component7 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/InteractionCallbackData; - public static synthetic fun copy$default (Ldev/kord/common/entity/InteractionCallbackData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/InteractionCallbackData; + public final fun copy (Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/InteractionCallbackData; + public static synthetic fun copy$default (Ldev/kord/common/entity/InteractionCallbackData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/InteractionCallbackData; public fun equals (Ljava/lang/Object;)Z public final fun getComponentType ()Ldev/kord/common/entity/optional/Optional; public final fun getComponents ()Ldev/kord/common/entity/optional/Optional; @@ -6903,6 +7063,7 @@ public final class dev/kord/common/entity/InteractionCallbackData { public final fun getId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun getName ()Ldev/kord/common/entity/optional/Optional; public final fun getOptions ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getResolved ()Ldev/kord/common/entity/optional/Optional; public final fun getTargetId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun getType ()Ldev/kord/common/entity/optional/Optional; @@ -7934,6 +8095,28 @@ public final class dev/kord/common/entity/PermissionsKt { public static final fun getALL (Ldev/kord/common/entity/Permissions$NewCompanion;)Ldev/kord/common/entity/Permissions; } +public abstract class dev/kord/common/entity/PollLayoutType { + public static final field Companion Ldev/kord/common/entity/PollLayoutType$Companion; + public synthetic fun (ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun equals (Ljava/lang/Object;)Z + public final fun getValue ()I + public final fun hashCode ()I + public final fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/PollLayoutType$Companion { + public final fun from (I)Ldev/kord/common/entity/PollLayoutType; + public final fun getEntries ()Ljava/util/List; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/PollLayoutType$DEFAULT : dev/kord/common/entity/PollLayoutType { + public static final field INSTANCE Ldev/kord/common/entity/PollLayoutType$DEFAULT; +} + +public final class dev/kord/common/entity/PollLayoutType$Unknown : dev/kord/common/entity/PollLayoutType { +} + public abstract class dev/kord/common/entity/PremiumTier { public static final field Companion Ldev/kord/common/entity/PremiumTier$Companion; public synthetic fun (ILkotlin/jvm/internal/DefaultConstructorMarker;)V From 9ea2746d0e55435779b4c397ec936d7ec4905104 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 24 Mar 2024 16:59:21 +0100 Subject: [PATCH 05/26] Add error codes --- rest/src/commonMain/kotlin/json/JsonErrorCode.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rest/src/commonMain/kotlin/json/JsonErrorCode.kt b/rest/src/commonMain/kotlin/json/JsonErrorCode.kt index c57cacb517e..c5a72c4b836 100644 --- a/rest/src/commonMain/kotlin/json/JsonErrorCode.kt +++ b/rest/src/commonMain/kotlin/json/JsonErrorCode.kt @@ -626,6 +626,21 @@ public enum class JsonErrorCode(public val code: Int) { /** Cannot update onboarding while below requirements. */ CannotUpdateOnboarding(350001), + /** + * Poll voting is blocked. + */ + PollVotingBlocked(520000), + + /** + * Poll has expired. + */ + PollExpired(5200001), + + /** + * Invalid channel type for poll creation. + */ + PollInvalidChannelType(520002) + ; internal object Serializer : KSerializer { From 23e450a17c2751a863df00e52ffbd923cb033b2c Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 24 Mar 2024 17:10:46 +0100 Subject: [PATCH 06/26] Add routes --- rest/src/commonMain/kotlin/route/Route.kt | 13 +++++++++ .../kotlin/service/ChannelService.kt | 28 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/rest/src/commonMain/kotlin/route/Route.kt b/rest/src/commonMain/kotlin/route/Route.kt index d861a485263..6d3ffef1b67 100644 --- a/rest/src/commonMain/kotlin/route/Route.kt +++ b/rest/src/commonMain/kotlin/route/Route.kt @@ -81,6 +81,7 @@ public sealed class Route( public object ScheduledEventId : Key("{event.id}", true) public object StickerId : Key("{sticker.id}") public object AutoModerationRuleId : Key("{auto_moderation_rule.id}") + public object PollAnswerId : Key("{poll.answer.id}") protected constructor( @@ -1046,4 +1047,16 @@ public sealed class Route( "/guilds/$GuildId/stickers/$StickerId", DiscordMessageSticker.serializer() ) + + public object GetVoteAnswer : Route>( + HttpMethod.Get, + "/channels/$ChannelId/polls/$MessageId/answers/$PollAnswerId", + ListSerializer(DiscordUser.serializer()) + ) + + public object PostExpirePoll : Route( + HttpMethod.Post, + "/channels/$ChannelId/polls/$MessageId/expire", + DiscordMessage.serializer() + ) } diff --git a/rest/src/commonMain/kotlin/service/ChannelService.kt b/rest/src/commonMain/kotlin/service/ChannelService.kt index 14dfab1289f..4e59137197d 100644 --- a/rest/src/commonMain/kotlin/service/ChannelService.kt +++ b/rest/src/commonMain/kotlin/service/ChannelService.kt @@ -414,6 +414,34 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques ): ListThreadsResponse = call(Route.JoinedPrivateArchivedThreadsGet) { listThreadsConfig(channelId, request.before, request.limit) } + + public suspend fun getPollUsersByAnswer( + channelId: Snowflake, + messageId: Snowflake, + answerId: Int, + after: Snowflake? = null, + limit: Int? = null + ): List = call(Route.GetVoteAnswer) { + keys[Route.ChannelId] = channelId + keys[Route.MessageId] = messageId + keys[Route.PollAnswerId] = answerId.toString() + + if (after != null) { + parameter("after", after) + } + + if (limit != null) { + parameter("limit", limit) + } + } + + public suspend fun expirePoll( + channelId: Snowflake, + messageId: Snowflake, + ): DiscordMessage = call(Route.PostExpirePoll) { + keys[Route.ChannelId] = channelId + keys[Route.MessageId] = messageId + } } private fun RequestBuilder.listThreadsConfig(channelId: Snowflake, before: Any?, limit: Int?) { From 8a1b62fc70e8e21f714ea18cc19cc9745a703eb2 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 24 Mar 2024 17:18:31 +0100 Subject: [PATCH 07/26] Add events --- gateway/src/commonMain/kotlin/Event.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gateway/src/commonMain/kotlin/Event.kt b/gateway/src/commonMain/kotlin/Event.kt index ac19a5dd5ce..5d3838f34e2 100644 --- a/gateway/src/commonMain/kotlin/Event.kt +++ b/gateway/src/commonMain/kotlin/Event.kt @@ -199,6 +199,8 @@ public sealed class Event { "APPLICATION_COMMAND_DELETE" -> @Suppress("DEPRECATION_ERROR") ApplicationCommandDelete(decode(DiscordApplicationCommand.serializer()), sequence) + "MESSAGE_POLL_VOTE_ADD" -> MessagePollVoteAdd(decode(MessagePollEventData.serializer()), sequence) + "MESSAGE_POLL_VOTE_REMOVE" -> MessagePollVoteRemove(decode(MessagePollEventData.serializer()), sequence) else -> { jsonLogger.debug { "Unknown gateway event name: $eventName" } UnknownDispatchEvent(eventName, eventData, sequence) @@ -646,3 +648,20 @@ public data class DiscordThreadMembersUpdate( @SerialName("removed_member_ids") val removedMemberIds: Optional> = Optional.Missing() ) + +public data class MessagePollVoteAdd(val data: MessagePollEventData, override val sequence: Int?) : DispatchEvent() +public data class MessagePollVoteRemove(val data: MessagePollEventData, override val sequence: Int?) : DispatchEvent() + +@Serializable +public data class MessagePollEventData( + @SerialName("user_id") + val userId: Snowflake, + @SerialName("channel_id") + val channelId: Snowflake, + @SerialName("message_id") + val messageId: Snowflake, + @SerialName("guild_id") + val guildId: OptionalSnowflake = OptionalSnowflake.Missing, + @SerialName("answer_id") + val answerId: Int +) From eea7cc3e71391d1d92e3b0edacaf9ea3701093b3 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 24 Mar 2024 17:27:03 +0100 Subject: [PATCH 08/26] Add polls to core Currently this is only partial and we might add something like a PollMessage or Poll class to core --- .../behavior/channel/MessageChannelBehavior.kt | 15 +++++++++++++++ .../commonMain/kotlin/cache/data/MessageData.kt | 4 +++- core/src/commonMain/kotlin/entity/Message.kt | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt index 99d36695c8f..b9f76bd590e 100644 --- a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt @@ -12,8 +12,10 @@ import dev.kord.core.hash import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.rest.builder.message.EmbedBuilder +import dev.kord.rest.builder.message.PollBuilder import dev.kord.rest.builder.message.create.MessageCreateBuilder import dev.kord.rest.builder.message.create.UserMessageCreateBuilder +import dev.kord.rest.builder.message.create.poll import dev.kord.rest.builder.message.embed import dev.kord.rest.request.RestRequestException import dev.kord.rest.service.RestClient @@ -300,6 +302,19 @@ public suspend inline fun MessageChannelBehavior.createEmbed(block: EmbedBuilder return createMessage { embed(block) } } +/** + * Requests to create a message with only a [poll][MessageCreateBuilder.poll]. + * + * @throws [RestRequestException] if something went wrong during the request. + */ +public suspend inline fun MessageChannelBehavior.createPoll(block: PollBuilder.() -> Unit): Message { + contract { + callsInPlace(block, InvocationKind.EXACTLY_ONCE) + } + + return createMessage { poll(block) } +} + /** * Requests to trigger the typing indicator for the bot in this channel. * The typing status will be refreshed until the [block] has been completed. diff --git a/core/src/commonMain/kotlin/cache/data/MessageData.kt b/core/src/commonMain/kotlin/cache/data/MessageData.kt index 6883ae3d39a..9f5744ad69a 100644 --- a/core/src/commonMain/kotlin/cache/data/MessageData.kt +++ b/core/src/commonMain/kotlin/cache/data/MessageData.kt @@ -39,6 +39,7 @@ public data class MessageData( val components: Optional> = Optional.Missing(), val roleSubscriptionData: Optional = Optional.Missing(), val position: OptionalInt = OptionalInt.Missing, + val poll: Optional = Optional.Missing() ) { public fun plus(selfId: Snowflake, reaction: MessageReactionAddData): MessageData { @@ -108,7 +109,7 @@ public data class MessageData( interaction = interaction, components = components, roleSubscriptionData = roleSubscriptionData, - position = position, + position = position ) } @@ -147,6 +148,7 @@ public data class MessageData( components = components.mapList { ComponentData.from(it) }, roleSubscriptionData = roleSubscriptionData, position = position, + poll = poll ) } } diff --git a/core/src/commonMain/kotlin/entity/Message.kt b/core/src/commonMain/kotlin/entity/Message.kt index 3669a148878..7146d0af531 100644 --- a/core/src/commonMain/kotlin/entity/Message.kt +++ b/core/src/commonMain/kotlin/entity/Message.kt @@ -300,6 +300,12 @@ public class Message( public val actionRows: List get() = data.components.orEmpty().map { ActionRowComponent(it) } + /** + * The [poll][DiscordPoll] of this message if any. + */ + public val poll: DiscordPoll? + get() = data.poll.value + /** * Returns itself. */ From 303c792c5d27771140d668d2762712f8718f356a Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 26 Mar 2024 23:57:15 +0100 Subject: [PATCH 09/26] Make results nullable --- common/src/commonMain/kotlin/entity/DiscordMessage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index e4080d05224..d3e4ac2e26b 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -720,7 +720,7 @@ public data class DiscordPoll( val allowMultiselect: Boolean, @SerialName("layout_type") val layoutType: PollLayoutType, - val results: Results + val results: Results? ) { /** * Shared object between answers and questions. From e09b4d716cff93fa5eba3efd1fc560149cffd265 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 26 Mar 2024 23:58:17 +0100 Subject: [PATCH 10/26] Api dump --- core/api/core.api | 12 +++++--- gateway/api/gateway.api | 62 +++++++++++++++++++++++++++++++++++++++++ rest/api/rest.api | 18 ++++++++++++ 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/core/api/core.api b/core/api/core.api index 19c163b67c2..6ff3602394e 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -1280,6 +1280,7 @@ public final class dev/kord/core/behavior/channel/MessageChannelBehaviorKt { public static synthetic fun MessageChannelBehavior$default (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplyStrategy;ILjava/lang/Object;)Ldev/kord/core/behavior/channel/MessageChannelBehavior; public static final fun createEmbed (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createMessage (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun createPoll (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun withTyping (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -4260,8 +4261,8 @@ public final class dev/kord/core/cache/data/MembersChunkData$Companion { public final class dev/kord/core/cache/data/MessageData { public static final field Companion Ldev/kord/core/cache/data/MessageData$Companion; - public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ljava/util/List; public final fun component11 ()Ljava/util/List; @@ -4286,14 +4287,15 @@ public final class dev/kord/core/cache/data/MessageData { public final fun component29 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component30 ()Ldev/kord/common/entity/optional/OptionalInt; + public final fun component31 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ldev/kord/core/cache/data/UserData; public final fun component5 ()Ljava/lang/String; public final fun component6 ()Lkotlinx/datetime/Instant; public final fun component7 ()Lkotlinx/datetime/Instant; public final fun component8 ()Z public final fun component9 ()Z - public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;)Ldev/kord/core/cache/data/MessageData; - public static synthetic fun copy$default (Ldev/kord/core/cache/data/MessageData;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;ILjava/lang/Object;)Ldev/kord/core/cache/data/MessageData; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/MessageData; + public static synthetic fun copy$default (Ldev/kord/core/cache/data/MessageData;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/core/cache/data/UserData;Ljava/lang/String;Lkotlinx/datetime/Instant;Lkotlinx/datetime/Instant;ZZLjava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Ljava/util/List;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ZLdev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/MessageType;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/MessageData; public fun equals (Ljava/lang/Object;)Z public final fun getActivity ()Ldev/kord/common/entity/optional/Optional; public final fun getApplication ()Ldev/kord/common/entity/optional/Optional; @@ -4316,6 +4318,7 @@ public final class dev/kord/core/cache/data/MessageData { public final fun getMessageReference ()Ldev/kord/common/entity/optional/Optional; public final fun getNonce ()Ldev/kord/common/entity/optional/Optional; public final fun getPinned ()Z + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getPosition ()Ldev/kord/common/entity/optional/OptionalInt; public final fun getReactions ()Ldev/kord/common/entity/optional/Optional; public final fun getReferencedMessage ()Ldev/kord/common/entity/optional/Optional; @@ -6583,6 +6586,7 @@ public final class dev/kord/core/entity/Message : dev/kord/core/behavior/Message public final fun getMentionedUsers ()Lkotlinx/coroutines/flow/Flow; public final fun getMentionsEveryone ()Z public final fun getMessageReference ()Ldev/kord/core/entity/MessageReference; + public final fun getPoll ()Ldev/kord/common/entity/DiscordPoll; public final fun getPosition ()Ljava/lang/Integer; public final fun getReactions ()Ljava/util/Set; public fun getReactors (Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; diff --git a/gateway/api/gateway.api b/gateway/api/gateway.api index 4891edf17d6..789b20e3bea 100644 --- a/gateway/api/gateway.api +++ b/gateway/api/gateway.api @@ -1415,6 +1415,68 @@ public final class dev/kord/gateway/MessageDeleteBulk : dev/kord/gateway/Dispatc public fun toString ()Ljava/lang/String; } +public final class dev/kord/gateway/MessagePollEventData { + public static final field Companion Ldev/kord/gateway/MessagePollEventData$Companion; + public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;I)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;IILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/kord/common/entity/Snowflake; + public final fun component2 ()Ldev/kord/common/entity/Snowflake; + public final fun component3 ()Ldev/kord/common/entity/Snowflake; + public final fun component4 ()Ldev/kord/common/entity/optional/OptionalSnowflake; + public final fun component5 ()I + public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;I)Ldev/kord/gateway/MessagePollEventData; + public static synthetic fun copy$default (Ldev/kord/gateway/MessagePollEventData;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;IILjava/lang/Object;)Ldev/kord/gateway/MessagePollEventData; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnswerId ()I + public final fun getChannelId ()Ldev/kord/common/entity/Snowflake; + public final fun getGuildId ()Ldev/kord/common/entity/optional/OptionalSnowflake; + public final fun getMessageId ()Ldev/kord/common/entity/Snowflake; + public final fun getUserId ()Ldev/kord/common/entity/Snowflake; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/gateway/MessagePollEventData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/gateway/MessagePollEventData$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/gateway/MessagePollEventData; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/gateway/MessagePollEventData;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/gateway/MessagePollEventData$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/gateway/MessagePollVoteAdd : dev/kord/gateway/DispatchEvent { + public fun (Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;)V + public final fun component1 ()Ldev/kord/gateway/MessagePollEventData; + public final fun component2 ()Ljava/lang/Integer; + public final fun copy (Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;)Ldev/kord/gateway/MessagePollVoteAdd; + public static synthetic fun copy$default (Ldev/kord/gateway/MessagePollVoteAdd;Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/kord/gateway/MessagePollVoteAdd; + public fun equals (Ljava/lang/Object;)Z + public final fun getData ()Ldev/kord/gateway/MessagePollEventData; + public fun getSequence ()Ljava/lang/Integer; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/kord/gateway/MessagePollVoteRemove : dev/kord/gateway/DispatchEvent { + public fun (Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;)V + public final fun component1 ()Ldev/kord/gateway/MessagePollEventData; + public final fun component2 ()Ljava/lang/Integer; + public final fun copy (Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;)Ldev/kord/gateway/MessagePollVoteRemove; + public static synthetic fun copy$default (Ldev/kord/gateway/MessagePollVoteRemove;Ldev/kord/gateway/MessagePollEventData;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/kord/gateway/MessagePollVoteRemove; + public fun equals (Ljava/lang/Object;)Z + public final fun getData ()Ldev/kord/gateway/MessagePollEventData; + public fun getSequence ()Ljava/lang/Integer; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + public final class dev/kord/gateway/MessageReactionAdd : dev/kord/gateway/DispatchEvent { public fun (Ldev/kord/common/entity/MessageReactionAddData;Ljava/lang/Integer;)V public final fun component1 ()Ldev/kord/common/entity/MessageReactionAddData; diff --git a/rest/api/rest.api b/rest/api/rest.api index 91bf1d6b21b..a8737e5694e 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -2626,6 +2626,9 @@ public final class dev/kord/rest/json/JsonErrorCode : java/lang/Enum { public static final field OwnerCannotBePendingMember Ldev/kord/rest/json/JsonErrorCode; public static final field OwnershipCannotBeTransferredToBot Ldev/kord/rest/json/JsonErrorCode; public static final field PermissionLack Ldev/kord/rest/json/JsonErrorCode; + public static final field PollExpired Ldev/kord/rest/json/JsonErrorCode; + public static final field PollInvalidChannelType Ldev/kord/rest/json/JsonErrorCode; + public static final field PollVotingBlocked Ldev/kord/rest/json/JsonErrorCode; public static final field ProvidedMessageCountInsufficient Ldev/kord/rest/json/JsonErrorCode; public static final field RasterizedImagesInLotties Ldev/kord/rest/json/JsonErrorCode; public static final field ReactionBlocked Ldev/kord/rest/json/JsonErrorCode; @@ -6510,6 +6513,10 @@ public final class dev/kord/rest/route/Route$GatewayGet : dev/kord/rest/route/Ro public static final field INSTANCE Ldev/kord/rest/route/Route$GatewayGet; } +public final class dev/kord/rest/route/Route$GetVoteAnswer : dev/kord/rest/route/Route { + public static final field INSTANCE Ldev/kord/rest/route/Route$GetVoteAnswer; +} + public final class dev/kord/rest/route/Route$GetWebhookMessage : dev/kord/rest/route/Route { public static final field INSTANCE Ldev/kord/rest/route/Route$GetWebhookMessage; } @@ -6958,6 +6965,14 @@ public final class dev/kord/rest/route/Route$PinsGet : dev/kord/rest/route/Route public static final field INSTANCE Ldev/kord/rest/route/Route$PinsGet; } +public final class dev/kord/rest/route/Route$PollAnswerId : dev/kord/rest/route/Route$Key { + public static final field INSTANCE Ldev/kord/rest/route/Route$PollAnswerId; +} + +public final class dev/kord/rest/route/Route$PostExpirePoll : dev/kord/rest/route/Route { + public static final field INSTANCE Ldev/kord/rest/route/Route$PostExpirePoll; +} + public final class dev/kord/rest/route/Route$PrivateArchivedThreadsGet : dev/kord/rest/route/Route { public static final field INSTANCE Ldev/kord/rest/route/Route$PrivateArchivedThreadsGet; } @@ -7181,6 +7196,7 @@ public final class dev/kord/rest/service/ChannelService : dev/kord/rest/service/ public final fun editMessage (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/json/request/MultipartMessagePatchRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun editMessage (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/json/request/MultipartWebhookEditMessageRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun editMessage (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun expirePoll (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun followNewsChannel (Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/json/request/ChannelFollowRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getChannel (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getChannelInvites (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7188,6 +7204,8 @@ public final class dev/kord/rest/service/ChannelService : dev/kord/rest/service/ public final fun getMessage (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getMessages (Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/route/Position;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getMessages$default (Ldev/kord/rest/service/ChannelService;Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/route/Position;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun getPollUsersByAnswer (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;ILdev/kord/common/entity/Snowflake;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun getPollUsersByAnswer$default (Ldev/kord/rest/service/ChannelService;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;ILdev/kord/common/entity/Snowflake;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun getReactions (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/rest/route/Position$After;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getReactions$default (Ldev/kord/rest/service/ChannelService;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/rest/route/Position$After;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun joinThread (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; From 5c394c4fe6d7232a231842cbfc114f71e37a8840 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 20:17:45 +0200 Subject: [PATCH 11/26] Add PollParentChannelBehavior --- .../channel/MessageChannelBehavior.kt | 13 -------- .../channel/PollParentChannelBehavior.kt | 31 +++++++++++++++++++ .../behavior/channel/StageChannelBehavior.kt | 2 +- .../behavior/channel/TextChannelBehavior.kt | 2 +- .../behavior/channel/VoiceChannelBehavior.kt | 2 +- .../channel/threads/ThreadChannelBehavior.kt | 9 +++--- .../kotlin/entity/channel/DmChannel.kt | 3 +- .../message/create/MessageCreateBuilder.kt | 7 ++++- 8 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt diff --git a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt index b9f76bd590e..c9442ab4a30 100644 --- a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt @@ -302,19 +302,6 @@ public suspend inline fun MessageChannelBehavior.createEmbed(block: EmbedBuilder return createMessage { embed(block) } } -/** - * Requests to create a message with only a [poll][MessageCreateBuilder.poll]. - * - * @throws [RestRequestException] if something went wrong during the request. - */ -public suspend inline fun MessageChannelBehavior.createPoll(block: PollBuilder.() -> Unit): Message { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - - return createMessage { poll(block) } -} - /** * Requests to trigger the typing indicator for the bot in this channel. * The typing status will be refreshed until the [block] has been completed. diff --git a/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt new file mode 100644 index 00000000000..3475795731b --- /dev/null +++ b/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt @@ -0,0 +1,31 @@ +package dev.kord.core.behavior.channel + +import dev.kord.common.annotation.KordUnsafe +import dev.kord.common.entity.DiscordPoll +import dev.kord.core.entity.Message +import dev.kord.rest.builder.message.PollBuilder +import dev.kord.rest.builder.message.create.poll +import dev.kord.rest.request.RestRequestException +import kotlin.contracts.InvocationKind +import kotlin.contracts.contract + +/** + * A channel behavior which allows for [poll creation][DiscordPoll]. + * + * @see createPoll + */ +public interface PollParentChannelBehavior : MessageChannelBehavior + +/** + * Requests to create a poll. + * + * @throws [RestRequestException] if something went wrong during the request. + */ +@OptIn(KordUnsafe::class) +public suspend inline fun PollParentChannelBehavior.createPoll(block: PollBuilder.() -> Unit): Message { + contract { + callsInPlace(block, InvocationKind.EXACTLY_ONCE) + } + + return createMessage { poll(block) } +} \ No newline at end of file diff --git a/core/src/commonMain/kotlin/behavior/channel/StageChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/StageChannelBehavior.kt index e7a06570247..ad7e40ed7ee 100644 --- a/core/src/commonMain/kotlin/behavior/channel/StageChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/StageChannelBehavior.kt @@ -20,7 +20,7 @@ import dev.kord.rest.service.patchStageVoiceChannel import kotlin.contracts.InvocationKind import kotlin.contracts.contract -public interface StageChannelBehavior : BaseVoiceChannelBehavior, TopGuildMessageChannelBehavior { +public interface StageChannelBehavior : BaseVoiceChannelBehavior, TopGuildMessageChannelBehavior, PollParentChannelBehavior { /** * Returns a new [StageChannelBehavior] with the given [strategy]. diff --git a/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt index 63d15d744c2..f4a5822184a 100644 --- a/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt @@ -26,7 +26,7 @@ import kotlinx.datetime.Instant import kotlin.contracts.InvocationKind import kotlin.contracts.contract -public interface TextChannelBehavior : TopGuildMessageChannelBehavior, PrivateThreadParentChannelBehavior { +public interface TextChannelBehavior : TopGuildMessageChannelBehavior, PrivateThreadParentChannelBehavior, PollParentChannelBehavior { override val activeThreads: Flow get() = super.activeThreads.filterIsInstance() diff --git a/core/src/commonMain/kotlin/behavior/channel/VoiceChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/VoiceChannelBehavior.kt index 0c1b1ed4874..6bb6a06829e 100644 --- a/core/src/commonMain/kotlin/behavior/channel/VoiceChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/VoiceChannelBehavior.kt @@ -19,7 +19,7 @@ import kotlin.contracts.contract /** * The behavior of a Discord Voice Channel associated to a guild. */ -public interface VoiceChannelBehavior : TopGuildMessageChannelBehavior, BaseVoiceChannelBehavior { +public interface VoiceChannelBehavior : TopGuildMessageChannelBehavior, BaseVoiceChannelBehavior, PollParentChannelBehavior { /** * Requests to get the this behavior as a [VoiceChannel]. diff --git a/core/src/commonMain/kotlin/behavior/channel/threads/ThreadChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/threads/ThreadChannelBehavior.kt index eca052dd8ed..1ee2fe4cdfe 100644 --- a/core/src/commonMain/kotlin/behavior/channel/threads/ThreadChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/threads/ThreadChannelBehavior.kt @@ -4,6 +4,7 @@ import dev.kord.common.entity.Snowflake import dev.kord.common.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.channel.GuildMessageChannelBehavior +import dev.kord.core.behavior.channel.PollParentChannelBehavior import dev.kord.core.cache.data.toData import dev.kord.core.entity.channel.Channel import dev.kord.core.entity.channel.ThreadParentChannel @@ -19,7 +20,7 @@ import kotlinx.coroutines.flow.Flow import kotlin.contracts.InvocationKind import kotlin.contracts.contract -public interface ThreadChannelBehavior : GuildMessageChannelBehavior { +public interface ThreadChannelBehavior : GuildMessageChannelBehavior, PollParentChannelBehavior { public val parentId: Snowflake @@ -88,7 +89,7 @@ public interface ThreadChannelBehavior : GuildMessageChannelBehavior { * Deleting a thread requires the [Manage Threads][dev.kord.common.entity.Permission.ManageThreads] permission. */ override suspend fun delete(reason: String?) { - super.delete(reason) + super.delete(reason) } /** @@ -113,11 +114,11 @@ public interface ThreadChannelBehavior : GuildMessageChannelBehavior { override suspend fun asChannel(): ThreadChannel { - return super.asChannel() as ThreadChannel + return super.asChannel() as ThreadChannel } override suspend fun asChannelOrNull(): ThreadChannel? { - return super.asChannelOrNull() as? ThreadChannel + return super.asChannelOrNull() as? ThreadChannel } override fun withStrategy(strategy: EntitySupplyStrategy<*>): ThreadChannelBehavior { diff --git a/core/src/commonMain/kotlin/entity/channel/DmChannel.kt b/core/src/commonMain/kotlin/entity/channel/DmChannel.kt index e03ac7476e3..0d82487a8e1 100644 --- a/core/src/commonMain/kotlin/entity/channel/DmChannel.kt +++ b/core/src/commonMain/kotlin/entity/channel/DmChannel.kt @@ -6,6 +6,7 @@ import dev.kord.common.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.UserBehavior import dev.kord.core.behavior.channel.ChannelBehavior +import dev.kord.core.behavior.channel.PollParentChannelBehavior import dev.kord.core.cache.data.ChannelData import dev.kord.core.entity.User import dev.kord.core.hash @@ -23,7 +24,7 @@ public data class DmChannel( override val data: ChannelData, override val kord: Kord, override val supplier: EntitySupplier = kord.defaultSupplier -) : MessageChannel { +) : MessageChannel, PollParentChannelBehavior { /** * The ids of the recipients of the channel. */ diff --git a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt index d0f204ae1ea..fe1344115ef 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt @@ -1,6 +1,8 @@ package dev.kord.rest.builder.message.create import dev.kord.common.annotation.KordDsl +import dev.kord.rest.json.request.CreatablePoll +import dev.kord.common.entity.DiscordPoll import dev.kord.common.entity.MessageFlag import dev.kord.common.entity.MessageFlags import dev.kord.common.entity.optional.Optional @@ -13,6 +15,7 @@ import dev.kord.rest.builder.message.AllowedMentionsBuilder import dev.kord.rest.builder.message.AttachmentBuilder import dev.kord.rest.builder.message.EmbedBuilder import dev.kord.rest.builder.message.MessageBuilder +import dev.kord.rest.builder.message.PollBuilder import kotlin.contracts.InvocationKind import kotlin.contracts.contract import dev.kord.rest.builder.message.actionRow as actionRowExtensionOnNewSupertype @@ -29,6 +32,7 @@ public sealed interface MessageCreateBuilder : MessageBuilder { /** * The poll of this message. */ + @set:KordUnsafe public var poll: CreatablePoll? /** Whether this message should be played as a text-to-speech message. */ @@ -154,8 +158,9 @@ public inline fun MessageCreateBuilder.messageFlags(builder: MessageFlags.Builde * Set's the [poll][dev.kord.common.entity.DiscordMessage.poll] of this message. * * **Please note that if poll is set, you currently cannot set [MessageBuilder.content], - * [MessageBuilder.attachments], [MessageBuilder.embeds] or [MessageBuilder.components] + * [MessageBuilder.attachments], [MessageBuilder.embeds] or [MessageBuilder.components]** */ +@KordUnsafe public inline fun MessageCreateBuilder.poll(builder: PollBuilder.() -> Unit) { contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) From 509933555331a42d4886382d99e08763613e7f33 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 20:38:43 +0200 Subject: [PATCH 12/26] Fix warning --- .../kotlin/builder/message/create/MessageCreateBuilder.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt index fe1344115ef..87d1cbb67dd 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt @@ -82,6 +82,7 @@ public sealed class AbstractMessageCreateBuilder : MessageCreateBuilder { final override var suppressNotifications: Boolean? = null internal var _poll: Optional = Optional.Missing() + @KordUnsafe final override var poll: CreatablePoll? by ::_poll.delegate() } From 25053f44c00a663c2f53d24601f07a88ee29bca6 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 20:39:06 +0200 Subject: [PATCH 13/26] Add subclasses for Message --- .../channel/PollParentChannelBehavior.kt | 6 +- core/src/commonMain/kotlin/entity/Message.kt | 68 +++++++++++++------ 2 files changed, 52 insertions(+), 22 deletions(-) diff --git a/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt index 3475795731b..bb76c9488aa 100644 --- a/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/PollParentChannelBehavior.kt @@ -2,7 +2,7 @@ package dev.kord.core.behavior.channel import dev.kord.common.annotation.KordUnsafe import dev.kord.common.entity.DiscordPoll -import dev.kord.core.entity.Message +import dev.kord.core.entity.Poll import dev.kord.rest.builder.message.PollBuilder import dev.kord.rest.builder.message.create.poll import dev.kord.rest.request.RestRequestException @@ -22,10 +22,10 @@ public interface PollParentChannelBehavior : MessageChannelBehavior * @throws [RestRequestException] if something went wrong during the request. */ @OptIn(KordUnsafe::class) -public suspend inline fun PollParentChannelBehavior.createPoll(block: PollBuilder.() -> Unit): Message { +public suspend inline fun PollParentChannelBehavior.createPoll(block: PollBuilder.() -> Unit): Poll { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } - return createMessage { poll(block) } + return createMessage { poll(block) } as Poll } \ No newline at end of file diff --git a/core/src/commonMain/kotlin/entity/Message.kt b/core/src/commonMain/kotlin/entity/Message.kt index 7146d0af531..6811afedd1d 100644 --- a/core/src/commonMain/kotlin/entity/Message.kt +++ b/core/src/commonMain/kotlin/entity/Message.kt @@ -2,10 +2,7 @@ package dev.kord.core.entity import dev.kord.common.entity.* import dev.kord.common.entity.MessageType.RoleSubscriptionPurchase -import dev.kord.common.entity.optional.mapNullable -import dev.kord.common.entity.optional.orEmpty -import dev.kord.common.entity.optional.unwrap -import dev.kord.common.entity.optional.value +import dev.kord.common.entity.optional.* import dev.kord.common.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.MessageBehavior @@ -23,22 +20,19 @@ import dev.kord.core.entity.component.ActionRowComponent import dev.kord.core.entity.interaction.ActionInteraction import dev.kord.core.entity.interaction.followup.FollowupMessage import dev.kord.core.exception.EntityNotFoundException +import dev.kord.core.hash import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.core.supplier.getChannelOf import dev.kord.core.supplier.getChannelOfOrNull import kotlinx.coroutines.flow.* import kotlinx.datetime.Instant -import dev.kord.core.hash /** * An instance of a [Discord Message][https://discord.com/developers/docs/resources/channel#message-object]. */ -public class Message( - public val data: MessageData, - override val kord: Kord, - override val supplier: EntitySupplier = kord.defaultSupplier, -) : MessageBehavior { +public interface Message : MessageBehavior { + public val data: MessageData /** * An instance of [MessageInteraction](https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object) @@ -300,12 +294,6 @@ public class Message( public val actionRows: List get() = data.components.orEmpty().map { ActionRowComponent(it) } - /** - * The [poll][DiscordPoll] of this message if any. - */ - public val poll: DiscordPoll? - get() = data.poll.value - /** * Returns itself. */ @@ -355,10 +343,38 @@ public class Message( */ public suspend fun getGuildOrNull(): Guild? = supplier.getChannelOfOrNull(channelId)?.getGuildOrNull() + override fun withStrategy(strategy: EntitySupplyStrategy<*>): Message +} + +public class DefaultMessage( + override val data: MessageData, + override val kord: Kord, + override val supplier: EntitySupplier = kord.defaultSupplier, +) : Message { + override fun hashCode(): Int = hash(id) + + override fun equals(other: Any?): Boolean = when (other) { + is MessageBehavior -> other.id == id && other.channelId == channelId + else -> false + } + + override fun withStrategy(strategy: EntitySupplyStrategy<*>): DefaultMessage = + DefaultMessage(data, kord, strategy.supply(kord)) +} + +/** + * A message which has a [poll]. + */ +public class Poll( + override val data: MessageData, + override val kord: Kord, + override val supplier: EntitySupplier = kord.defaultSupplier, +) : Message { /** - * Returns a new [Message] with the given [strategy]. + * The [poll][DiscordPoll]. */ - override fun withStrategy(strategy: EntitySupplyStrategy<*>): Message = Message(data, kord, strategy.supply(kord)) + public val poll: DiscordPoll + get() = data.poll.value!! override fun hashCode(): Int = hash(id) @@ -367,8 +383,22 @@ public class Message( else -> false } + override fun withStrategy(strategy: EntitySupplyStrategy<*>): Poll = + Poll(data, kord, strategy.supply(kord)) + override fun toString(): String { - return "Message(data=$data, kord=$kord, supplier=$supplier)" + return "Poll(data=$data, kord=$kord, supplier=$supplier)" } +} +/** + * Constructor for [Message] + */ +public fun Message( + data: MessageData, + kord: Kord, + supplier: EntitySupplier = kord.defaultSupplier +): Message = when { + data.poll is Optional.Value<*> -> Poll(data, kord, supplier) + else -> DefaultMessage(data, kord, supplier) } From 5f327644ae112af55eb3ff80952d2187976c5024 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 20:39:53 +0200 Subject: [PATCH 14/26] Api dump --- core/api/core.api | 355 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 280 insertions(+), 75 deletions(-) diff --git a/core/api/core.api b/core/api/core.api index 6ff3602394e..0c369518656 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -1280,7 +1280,6 @@ public final class dev/kord/core/behavior/channel/MessageChannelBehaviorKt { public static synthetic fun MessageChannelBehavior$default (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplyStrategy;ILjava/lang/Object;)Ldev/kord/core/behavior/channel/MessageChannelBehavior; public static final fun createEmbed (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createMessage (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun createPoll (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun withTyping (Ldev/kord/core/behavior/channel/MessageChannelBehavior;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -1341,7 +1340,37 @@ public final class dev/kord/core/behavior/channel/NewsChannelBehaviorKt { public static final fun edit (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public abstract interface class dev/kord/core/behavior/channel/StageChannelBehavior : dev/kord/core/behavior/channel/BaseVoiceChannelBehavior, dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior { +public abstract interface class dev/kord/core/behavior/channel/PollParentChannelBehavior : dev/kord/core/behavior/channel/MessageChannelBehavior { +} + +public final class dev/kord/core/behavior/channel/PollParentChannelBehavior$DefaultImpls { + public static fun asChannel (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun asChannelOrNull (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun compareTo (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/core/entity/Entity;)I + public static fun createMessage (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun delete (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteMessage (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchChannel (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchChannelOrNull (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getMention (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;)Ljava/lang/String; + public static fun getMessage (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getMessageOrNull (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getMessages (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;)Lkotlinx/coroutines/flow/Flow; + public static fun getMessagesAfter (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; + public static fun getMessagesAround (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;I)Lkotlinx/coroutines/flow/Flow; + public static fun getMessagesBefore (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; + public static fun getPinnedMessages (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;)Lkotlinx/coroutines/flow/Flow; + public static fun type (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun typeUntil (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/time/TimeMark;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun typeUntil (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlinx/datetime/Instant;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun withStrategy (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/channel/MessageChannelBehavior; +} + +public final class dev/kord/core/behavior/channel/PollParentChannelBehaviorKt { + public static final fun createPoll (Ldev/kord/core/behavior/channel/PollParentChannelBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class dev/kord/core/behavior/channel/StageChannelBehavior : dev/kord/core/behavior/channel/BaseVoiceChannelBehavior, dev/kord/core/behavior/channel/PollParentChannelBehavior, dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior { public abstract fun getStageInstance (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun getStageInstanceOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/channel/StageChannelBehavior; @@ -1391,7 +1420,7 @@ public final class dev/kord/core/behavior/channel/StageChannelBehaviorKt { public static final fun editVoiceState (Ldev/kord/core/behavior/channel/StageChannelBehavior;Ldev/kord/common/entity/Snowflake;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public abstract interface class dev/kord/core/behavior/channel/TextChannelBehavior : dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior, dev/kord/core/behavior/channel/threads/PrivateThreadParentChannelBehavior { +public abstract interface class dev/kord/core/behavior/channel/TextChannelBehavior : dev/kord/core/behavior/channel/PollParentChannelBehavior, dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior, dev/kord/core/behavior/channel/threads/PrivateThreadParentChannelBehavior { public abstract fun asChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun asChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun fetchChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1524,7 +1553,7 @@ public final class dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior public static fun withStrategy (Ldev/kord/core/behavior/channel/TopGuildMessageChannelBehavior;Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/channel/TopGuildMessageChannelBehavior; } -public abstract interface class dev/kord/core/behavior/channel/VoiceChannelBehavior : dev/kord/core/behavior/channel/BaseVoiceChannelBehavior, dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior { +public abstract interface class dev/kord/core/behavior/channel/VoiceChannelBehavior : dev/kord/core/behavior/channel/BaseVoiceChannelBehavior, dev/kord/core/behavior/channel/PollParentChannelBehavior, dev/kord/core/behavior/channel/TopGuildMessageChannelBehavior { public abstract fun asChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun asChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun fetchChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1598,7 +1627,7 @@ public final class dev/kord/core/behavior/channel/threads/PrivateThreadParentCha public static fun getWebhooks (Ldev/kord/core/behavior/channel/threads/PrivateThreadParentChannelBehavior;)Lkotlinx/coroutines/flow/Flow; } -public abstract interface class dev/kord/core/behavior/channel/threads/ThreadChannelBehavior : dev/kord/core/behavior/channel/GuildMessageChannelBehavior { +public abstract interface class dev/kord/core/behavior/channel/threads/ThreadChannelBehavior : dev/kord/core/behavior/channel/GuildMessageChannelBehavior, dev/kord/core/behavior/channel/PollParentChannelBehavior { public abstract fun addUser (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun asChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun asChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -5888,6 +5917,76 @@ public final class dev/kord/core/entity/ClientStatus$Client$Web : dev/kord/core/ public fun (Ldev/kord/common/entity/PresenceStatus;)V } +public final class dev/kord/core/entity/DefaultMessage : dev/kord/core/entity/Message { + public fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V + public synthetic fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun addReaction (Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun addReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun asMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun asMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun compareTo (Ldev/kord/core/entity/Entity;)I + public synthetic fun compareTo (Ljava/lang/Object;)I + public fun delete (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteAllReactions (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteOwnReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteReaction (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun equals (Ljava/lang/Object;)Z + public fun fetchMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun fetchMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getActionRows ()Ljava/util/List; + public fun getApplicationId ()Ldev/kord/common/entity/Snowflake; + public fun getAttachments ()Ljava/util/Set; + public fun getAuthor ()Ldev/kord/core/entity/User; + public fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getAuthorAsMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getChannel ()Ldev/kord/core/behavior/channel/MessageChannelBehavior; + public fun getChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getChannelId ()Ldev/kord/common/entity/Snowflake; + public fun getChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getContent ()Ljava/lang/String; + public fun getData ()Ldev/kord/core/cache/data/MessageData; + public fun getEditedTimestamp ()Lkotlinx/datetime/Instant; + public fun getEmbeds ()Ljava/util/List; + public fun getFlags ()Ldev/kord/common/entity/MessageFlags; + public fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getId ()Ldev/kord/common/entity/Snowflake; + public fun getInteraction ()Ldev/kord/core/entity/Message$Interaction; + public fun getKord ()Ldev/kord/core/Kord; + public fun getMentionedChannelBehaviors ()Ljava/util/Set; + public fun getMentionedChannelIds ()Ljava/util/Set; + public fun getMentionedChannels ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionedRoleIds ()Ljava/util/Set; + public fun getMentionedRoles ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionedUserBehaviors ()Ljava/util/Set; + public fun getMentionedUserIds ()Ljava/util/Set; + public fun getMentionedUsers ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionsEveryone ()Z + public fun getMessageReference ()Ldev/kord/core/entity/MessageReference; + public fun getPosition ()Ljava/lang/Integer; + public fun getReactions ()Ljava/util/Set; + public fun getReactors (Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; + public fun getReferencedMessage ()Ldev/kord/core/entity/Message; + public fun getRoleSubscriptionData ()Ldev/kord/common/entity/RoleSubscription; + public fun getStickers ()Ljava/util/List; + public fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier; + public fun getTimestamp ()Lkotlinx/datetime/Instant; + public fun getTts ()Z + public fun getType ()Ldev/kord/common/entity/MessageType; + public fun getWebhookId ()Ldev/kord/common/entity/Snowflake; + public fun hashCode ()I + public fun isPinned ()Z + public fun pin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun publish (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun unpin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/MessageBehavior; + public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/DefaultMessage; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Message; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; +} + public final class dev/kord/core/entity/Embed : dev/kord/core/KordObject { public fun (Ldev/kord/core/cache/data/EmbedData;Ldev/kord/core/Kord;)V public final fun apply (Ldev/kord/rest/builder/message/EmbedBuilder;)V @@ -6538,75 +6637,104 @@ public final class dev/kord/core/entity/Member : dev/kord/core/entity/User, dev/ public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/User; } -public final class dev/kord/core/entity/Message : dev/kord/core/behavior/MessageBehavior { - public fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V - public synthetic fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun addReaction (Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun addReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun asMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun asMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun compareTo (Ldev/kord/core/entity/Entity;)I - public synthetic fun compareTo (Ljava/lang/Object;)I - public fun delete (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun deleteAllReactions (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun deleteOwnReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun deleteReaction (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun deleteReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun equals (Ljava/lang/Object;)Z - public fun fetchMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun fetchMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getActionRows ()Ljava/util/List; - public final fun getApplicationId ()Ldev/kord/common/entity/Snowflake; - public final fun getAttachments ()Ljava/util/Set; - public final fun getAuthor ()Ldev/kord/core/entity/User; - public final fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getAuthorAsMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun getChannel ()Ldev/kord/core/behavior/channel/MessageChannelBehavior; - public fun getChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun getChannelId ()Ldev/kord/common/entity/Snowflake; - public fun getChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getContent ()Ljava/lang/String; - public final fun getData ()Ldev/kord/core/cache/data/MessageData; - public final fun getEditedTimestamp ()Lkotlinx/datetime/Instant; - public final fun getEmbeds ()Ljava/util/List; - public final fun getFlags ()Ldev/kord/common/entity/MessageFlags; - public final fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun getId ()Ldev/kord/common/entity/Snowflake; - public final fun getInteraction ()Ldev/kord/core/entity/Message$Interaction; - public fun getKord ()Ldev/kord/core/Kord; - public final fun getMentionedChannelBehaviors ()Ljava/util/Set; - public final fun getMentionedChannelIds ()Ljava/util/Set; - public final fun getMentionedChannels ()Lkotlinx/coroutines/flow/Flow; - public final fun getMentionedRoleIds ()Ljava/util/Set; - public final fun getMentionedRoles ()Lkotlinx/coroutines/flow/Flow; - public final fun getMentionedUserBehaviors ()Ljava/util/Set; - public final fun getMentionedUserIds ()Ljava/util/Set; - public final fun getMentionedUsers ()Lkotlinx/coroutines/flow/Flow; - public final fun getMentionsEveryone ()Z - public final fun getMessageReference ()Ldev/kord/core/entity/MessageReference; - public final fun getPoll ()Ldev/kord/common/entity/DiscordPoll; - public final fun getPosition ()Ljava/lang/Integer; - public final fun getReactions ()Ljava/util/Set; - public fun getReactors (Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; - public final fun getReferencedMessage ()Ldev/kord/core/entity/Message; - public final fun getRoleSubscriptionData ()Ldev/kord/common/entity/RoleSubscription; - public final fun getStickers ()Ljava/util/List; - public fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier; - public final fun getTimestamp ()Lkotlinx/datetime/Instant; - public final fun getTts ()Z - public final fun getType ()Ldev/kord/common/entity/MessageType; - public final fun getWebhookId ()Ldev/kord/common/entity/Snowflake; - public fun hashCode ()I - public final fun isPinned ()Z - public fun pin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun publish (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun toString ()Ljava/lang/String; - public fun unpin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/MessageBehavior; - public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Message; - public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; +public abstract interface class dev/kord/core/entity/Message : dev/kord/core/behavior/MessageBehavior { + public abstract fun asMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun asMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getActionRows ()Ljava/util/List; + public abstract fun getApplicationId ()Ldev/kord/common/entity/Snowflake; + public abstract fun getAttachments ()Ljava/util/Set; + public abstract fun getAuthor ()Ldev/kord/core/entity/User; + public abstract fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getAuthorAsMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getChannelId ()Ldev/kord/common/entity/Snowflake; + public abstract fun getContent ()Ljava/lang/String; + public abstract fun getData ()Ldev/kord/core/cache/data/MessageData; + public abstract fun getEditedTimestamp ()Lkotlinx/datetime/Instant; + public abstract fun getEmbeds ()Ljava/util/List; + public abstract fun getFlags ()Ldev/kord/common/entity/MessageFlags; + public abstract fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getId ()Ldev/kord/common/entity/Snowflake; + public abstract fun getInteraction ()Ldev/kord/core/entity/Message$Interaction; + public abstract fun getMentionedChannelBehaviors ()Ljava/util/Set; + public abstract fun getMentionedChannelIds ()Ljava/util/Set; + public abstract fun getMentionedChannels ()Lkotlinx/coroutines/flow/Flow; + public abstract fun getMentionedRoleIds ()Ljava/util/Set; + public abstract fun getMentionedRoles ()Lkotlinx/coroutines/flow/Flow; + public abstract fun getMentionedUserBehaviors ()Ljava/util/Set; + public abstract fun getMentionedUserIds ()Ljava/util/Set; + public abstract fun getMentionedUsers ()Lkotlinx/coroutines/flow/Flow; + public abstract fun getMentionsEveryone ()Z + public abstract fun getMessageReference ()Ldev/kord/core/entity/MessageReference; + public abstract fun getPosition ()Ljava/lang/Integer; + public abstract fun getReactions ()Ljava/util/Set; + public abstract fun getReferencedMessage ()Ldev/kord/core/entity/Message; + public abstract fun getRoleSubscriptionData ()Ldev/kord/common/entity/RoleSubscription; + public abstract fun getStickers ()Ljava/util/List; + public abstract fun getTimestamp ()Lkotlinx/datetime/Instant; + public abstract fun getTts ()Z + public abstract fun getType ()Ldev/kord/common/entity/MessageType; + public abstract fun getWebhookId ()Ldev/kord/common/entity/Snowflake; + public abstract fun isPinned ()Z + public abstract fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Message; +} + +public final class dev/kord/core/entity/Message$DefaultImpls { + public static fun addReaction (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun addReaction (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun asMessage (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun asMessageOrNull (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun compareTo (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/Entity;)I + public static fun delete (Ldev/kord/core/entity/Message;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun delete (Ldev/kord/core/entity/Message;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteAllReactions (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteOwnReaction (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteReaction (Ldev/kord/core/entity/Message;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteReaction (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchMessage (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchMessageOrNull (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getActionRows (Ldev/kord/core/entity/Message;)Ljava/util/List; + public static fun getApplicationId (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/Snowflake; + public static fun getAttachments (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getAuthor (Ldev/kord/core/entity/Message;)Ldev/kord/core/entity/User; + public static fun getAuthorAsMember (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getAuthorAsMemberOrNull (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getChannel (Ldev/kord/core/entity/Message;)Ldev/kord/core/behavior/channel/MessageChannelBehavior; + public static fun getChannel (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getChannelId (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/Snowflake; + public static fun getChannelOrNull (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getContent (Ldev/kord/core/entity/Message;)Ljava/lang/String; + public static fun getEditedTimestamp (Ldev/kord/core/entity/Message;)Lkotlinx/datetime/Instant; + public static fun getEmbeds (Ldev/kord/core/entity/Message;)Ljava/util/List; + public static fun getFlags (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/MessageFlags; + public static fun getGuild (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getGuildOrNull (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getId (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/Snowflake; + public static fun getInteraction (Ldev/kord/core/entity/Message;)Ldev/kord/core/entity/Message$Interaction; + public static fun getMentionedChannelBehaviors (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getMentionedChannelIds (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getMentionedChannels (Ldev/kord/core/entity/Message;)Lkotlinx/coroutines/flow/Flow; + public static fun getMentionedRoleIds (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getMentionedRoles (Ldev/kord/core/entity/Message;)Lkotlinx/coroutines/flow/Flow; + public static fun getMentionedUserBehaviors (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getMentionedUserIds (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getMentionedUsers (Ldev/kord/core/entity/Message;)Lkotlinx/coroutines/flow/Flow; + public static fun getMentionsEveryone (Ldev/kord/core/entity/Message;)Z + public static fun getMessageReference (Ldev/kord/core/entity/Message;)Ldev/kord/core/entity/MessageReference; + public static fun getPosition (Ldev/kord/core/entity/Message;)Ljava/lang/Integer; + public static fun getReactions (Ldev/kord/core/entity/Message;)Ljava/util/Set; + public static fun getReactors (Ldev/kord/core/entity/Message;Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; + public static fun getReferencedMessage (Ldev/kord/core/entity/Message;)Ldev/kord/core/entity/Message; + public static fun getRoleSubscriptionData (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/RoleSubscription; + public static fun getStickers (Ldev/kord/core/entity/Message;)Ljava/util/List; + public static fun getTimestamp (Ldev/kord/core/entity/Message;)Lkotlinx/datetime/Instant; + public static fun getTts (Ldev/kord/core/entity/Message;)Z + public static fun getType (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/MessageType; + public static fun getWebhookId (Ldev/kord/core/entity/Message;)Ldev/kord/common/entity/Snowflake; + public static fun isPinned (Ldev/kord/core/entity/Message;)Z + public static fun pin (Ldev/kord/core/entity/Message;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun publish (Ldev/kord/core/entity/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun unpin (Ldev/kord/core/entity/Message;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class dev/kord/core/entity/Message$Interaction : dev/kord/core/entity/KordEntity, dev/kord/core/entity/Strategizable { @@ -6627,6 +6755,11 @@ public final class dev/kord/core/entity/Message$Interaction : dev/kord/core/enti public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; } +public final class dev/kord/core/entity/MessageKt { + public static final fun Message (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)Ldev/kord/core/entity/Message; + public static synthetic fun Message$default (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILjava/lang/Object;)Ldev/kord/core/entity/Message; +} + public final class dev/kord/core/entity/MessageReference : dev/kord/core/KordObject { public fun (Ldev/kord/core/cache/data/MessageReferenceData;Ldev/kord/core/Kord;)V public final fun getChannel ()Ldev/kord/core/behavior/channel/MessageChannelBehavior; @@ -6789,6 +6922,78 @@ public final class dev/kord/core/entity/PermissionOverwriteEntity : dev/kord/cor public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; } +public final class dev/kord/core/entity/Poll : dev/kord/core/entity/Message { + public fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V + public synthetic fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun addReaction (Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun addReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun asMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun asMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun compareTo (Ldev/kord/core/entity/Entity;)I + public synthetic fun compareTo (Ljava/lang/Object;)I + public fun delete (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteAllReactions (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteOwnReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteReaction (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun deleteReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun equals (Ljava/lang/Object;)Z + public fun fetchMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun fetchMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getActionRows ()Ljava/util/List; + public fun getApplicationId ()Ldev/kord/common/entity/Snowflake; + public fun getAttachments ()Ljava/util/Set; + public fun getAuthor ()Ldev/kord/core/entity/User; + public fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getAuthorAsMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getChannel ()Ldev/kord/core/behavior/channel/MessageChannelBehavior; + public fun getChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getChannelId ()Ldev/kord/common/entity/Snowflake; + public fun getChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getContent ()Ljava/lang/String; + public fun getData ()Ldev/kord/core/cache/data/MessageData; + public fun getEditedTimestamp ()Lkotlinx/datetime/Instant; + public fun getEmbeds ()Ljava/util/List; + public fun getFlags ()Ldev/kord/common/entity/MessageFlags; + public fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getId ()Ldev/kord/common/entity/Snowflake; + public fun getInteraction ()Ldev/kord/core/entity/Message$Interaction; + public fun getKord ()Ldev/kord/core/Kord; + public fun getMentionedChannelBehaviors ()Ljava/util/Set; + public fun getMentionedChannelIds ()Ljava/util/Set; + public fun getMentionedChannels ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionedRoleIds ()Ljava/util/Set; + public fun getMentionedRoles ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionedUserBehaviors ()Ljava/util/Set; + public fun getMentionedUserIds ()Ljava/util/Set; + public fun getMentionedUsers ()Lkotlinx/coroutines/flow/Flow; + public fun getMentionsEveryone ()Z + public fun getMessageReference ()Ldev/kord/core/entity/MessageReference; + public final fun getPoll ()Ldev/kord/common/entity/DiscordPoll; + public fun getPosition ()Ljava/lang/Integer; + public fun getReactions ()Ljava/util/Set; + public fun getReactors (Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; + public fun getReferencedMessage ()Ldev/kord/core/entity/Message; + public fun getRoleSubscriptionData ()Ldev/kord/common/entity/RoleSubscription; + public fun getStickers ()Ljava/util/List; + public fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier; + public fun getTimestamp ()Lkotlinx/datetime/Instant; + public fun getTts ()Z + public fun getType ()Ldev/kord/common/entity/MessageType; + public fun getWebhookId ()Ldev/kord/common/entity/Snowflake; + public fun hashCode ()I + public fun isPinned ()Z + public fun pin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun publish (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun toString ()Ljava/lang/String; + public fun unpin (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/MessageBehavior; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Message; + public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Poll; + public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; +} + public final class dev/kord/core/entity/Presence : dev/kord/core/KordObject, dev/kord/core/entity/Strategizable { public fun (Ldev/kord/core/cache/data/PresenceData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V public synthetic fun (Ldev/kord/core/cache/data/PresenceData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -7809,7 +8014,7 @@ public final class dev/kord/core/entity/channel/Channel$DefaultImpls { public static fun withStrategy (Ldev/kord/core/entity/channel/Channel;Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/channel/Channel; } -public final class dev/kord/core/entity/channel/DmChannel : dev/kord/core/entity/channel/MessageChannel { +public final class dev/kord/core/entity/channel/DmChannel : dev/kord/core/behavior/channel/PollParentChannelBehavior, dev/kord/core/entity/channel/MessageChannel { public fun (Ldev/kord/core/cache/data/ChannelData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V public synthetic fun (Ldev/kord/core/cache/data/ChannelData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun asChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; From a883c08931b8d73d121d1d4fe5ba50f915a287c5 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 20:49:58 +0200 Subject: [PATCH 15/26] Fix unsafe api usage --- samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt b/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt index c132ddf398f..1fa305bd312 100644 --- a/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt +++ b/samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt @@ -1,10 +1,10 @@ package dev.kord.core -import dev.kord.core.behavior.reply +import dev.kord.core.behavior.channel.PollParentChannelBehavior +import dev.kord.core.behavior.channel.createPoll import dev.kord.core.event.message.MessageCreateEvent import dev.kord.gateway.Intent import dev.kord.gateway.PrivilegedIntent -import dev.kord.rest.builder.message.create.poll import kotlin.time.Duration.Companion.minutes suspend fun main(args: Array) { @@ -14,8 +14,7 @@ suspend fun main(args: Array) { if (message.author?.isBot == true) return@on if (message.content == "!ping") message.channel.createMessage("pong") if (message.content == "!poll") { - message.reply { - poll { + (message.channel as PollParentChannelBehavior).createPoll { question("Does this work?") answer("Yes") @@ -25,7 +24,6 @@ suspend fun main(args: Array) { } } } - } kord.login { presence { playing("!ping to pong") } From 987969b2459260aa6ed11df42c2f110560d94f93 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 9 Apr 2024 21:02:38 +0200 Subject: [PATCH 16/26] Fix test --- core/src/jvmTest/kotlin/entity/MessageTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/jvmTest/kotlin/entity/MessageTest.kt b/core/src/jvmTest/kotlin/entity/MessageTest.kt index 203bb63a84f..e101a689ad5 100644 --- a/core/src/jvmTest/kotlin/entity/MessageTest.kt +++ b/core/src/jvmTest/kotlin/entity/MessageTest.kt @@ -1,5 +1,6 @@ package dev.kord.core.entity +import dev.kord.common.entity.optional.Optional import dev.kord.core.behavior.MessageBehavior import dev.kord.core.cache.data.MessageData import dev.kord.core.equality.BehaviorEqualityTest @@ -13,6 +14,7 @@ internal class MessageTest : EntityEqualityTest by EntityEqualityTest({ val data = mockk() every { data.id } returns it every { data.channelId } returns it + every { data.poll } returns Optional.Missing() Message(data, kord) }), BehaviorEqualityTest { override fun Message.behavior(): KordEntity = MessageBehavior(messageId = id, channelId = id, kord = kord) From 65a578fac5495b80059a79c34ac8cd27312c18fd Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 25 Aug 2024 12:55:50 +0200 Subject: [PATCH 17/26] Make expiry nullable --- buildSrc/src/main/kotlin/Compiler.kt | 2 +- common/api/common.api | 50 ++-- common/api/common.klib.api | 203 +++++++++++++- .../dev/kord/common/entity/PollLayoutType.kt | 1 - .../kotlin/entity/DiscordMessage.kt | 2 +- core/api/core.klib.api | 259 ++++++++++-------- gateway/api/gateway.api | 10 +- gateway/api/gateway.klib.api | 70 +++++ rest/api/rest.api | 126 +++++++-- rest/api/rest.klib.api | 126 ++++++++- .../message/create/MessageCreateBuilder.kt | 1 + 11 files changed, 669 insertions(+), 181 deletions(-) diff --git a/buildSrc/src/main/kotlin/Compiler.kt b/buildSrc/src/main/kotlin/Compiler.kt index 00b3f31b5b6..e137103d598 100644 --- a/buildSrc/src/main/kotlin/Compiler.kt +++ b/buildSrc/src/main/kotlin/Compiler.kt @@ -19,7 +19,7 @@ object Jvm { fun KotlinCommonCompilerOptions.applyKordCompilerOptions() { allWarningsAsErrors = true progressiveMode = true - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xdont-warn-on-error-suppression") } internal fun NamedDomainObjectSet.applyKordTestOptIns() { diff --git a/common/api/common.api b/common/api/common.api index 64bd94e5628..f0d6db923cb 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -5313,13 +5313,13 @@ public final class dev/kord/common/entity/DiscordPoll { public fun toString ()Ljava/lang/String; } -public final class dev/kord/common/entity/DiscordPoll$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/common/entity/DiscordPoll$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } @@ -5338,13 +5338,13 @@ public final class dev/kord/common/entity/DiscordPoll$Answer { public fun toString ()Ljava/lang/String; } -public final class dev/kord/common/entity/DiscordPoll$Answer$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/common/entity/DiscordPoll$Answer$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Answer$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Answer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Answer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Answer;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Answer;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } @@ -5373,13 +5373,13 @@ public final class dev/kord/common/entity/DiscordPoll$Media { public fun toString ()Ljava/lang/String; } -public final class dev/kord/common/entity/DiscordPoll$Media$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/common/entity/DiscordPoll$Media$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Media$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Media; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Media; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Media;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Media;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } @@ -5402,13 +5402,13 @@ public final class dev/kord/common/entity/DiscordPoll$Results { public fun toString ()Ljava/lang/String; } -public final class dev/kord/common/entity/DiscordPoll$Results$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/common/entity/DiscordPoll$Results$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Results$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } @@ -5429,13 +5429,13 @@ public final class dev/kord/common/entity/DiscordPoll$Results$AnswerCount { public fun toString ()Ljava/lang/String; } -public final class dev/kord/common/entity/DiscordPoll$Results$AnswerCount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/common/entity/DiscordPoll$Results$AnswerCount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordPoll$Results$AnswerCount;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } diff --git a/common/api/common.klib.api b/common/api/common.klib.api index 9308b8f8f82..c21a8a41720 100644 --- a/common/api/common.klib.api +++ b/common/api/common.klib.api @@ -3305,7 +3305,7 @@ final class dev.kord.common.entity/DiscordMentionedChannel { // dev.kord.common. } final class dev.kord.common.entity/DiscordMessage { // dev.kord.common.entity/DiscordMessage|null[0] - constructor (dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/DiscordUser, dev.kord.common.entity.optional/Optional = ..., kotlin/String, kotlinx.datetime/Instant, kotlinx.datetime/Instant?, kotlin/Boolean, kotlin/Boolean, kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ...) // dev.kord.common.entity/DiscordMessage.|(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.DiscordUser;dev.kord.common.entity.optional.Optional;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt){}[0] + constructor (dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/DiscordUser, dev.kord.common.entity.optional/Optional = ..., kotlin/String, kotlinx.datetime/Instant, kotlinx.datetime/Instant?, kotlin/Boolean, kotlin/Boolean, kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.common.entity/DiscordMessage.|(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.DiscordUser;dev.kord.common.entity.optional.Optional;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt;dev.kord.common.entity.optional.Optional){}[0] final val activity // dev.kord.common.entity/DiscordMessage.activity|{}activity[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.activity.|(){}[0] @@ -3351,6 +3351,8 @@ final class dev.kord.common.entity/DiscordMessage { // dev.kord.common.entity/Di final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.nonce.|(){}[0] final val pinned // dev.kord.common.entity/DiscordMessage.pinned|{}pinned[0] final fun (): kotlin/Boolean // dev.kord.common.entity/DiscordMessage.pinned.|(){}[0] + final val poll // dev.kord.common.entity/DiscordMessage.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.poll.|(){}[0] final val position // dev.kord.common.entity/DiscordMessage.position|{}position[0] final fun (): dev.kord.common.entity.optional/OptionalInt // dev.kord.common.entity/DiscordMessage.position.|(){}[0] final val reactions // dev.kord.common.entity/DiscordMessage.reactions|{}reactions[0] @@ -3398,13 +3400,14 @@ final class dev.kord.common.entity/DiscordMessage { // dev.kord.common.entity/Di final fun component30(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.component30|component30(){}[0] final fun component31(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.component31|component31(){}[0] final fun component32(): dev.kord.common.entity.optional/OptionalInt // dev.kord.common.entity/DiscordMessage.component32|component32(){}[0] + final fun component33(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.component33|component33(){}[0] final fun component4(): dev.kord.common.entity/DiscordUser // dev.kord.common.entity/DiscordMessage.component4|component4(){}[0] final fun component5(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordMessage.component5|component5(){}[0] final fun component6(): kotlin/String // dev.kord.common.entity/DiscordMessage.component6|component6(){}[0] final fun component7(): kotlinx.datetime/Instant // dev.kord.common.entity/DiscordMessage.component7|component7(){}[0] final fun component8(): kotlinx.datetime/Instant? // dev.kord.common.entity/DiscordMessage.component8|component8(){}[0] final fun component9(): kotlin/Boolean // dev.kord.common.entity/DiscordMessage.component9|component9(){}[0] - final fun copy(dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/DiscordUser = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/String = ..., kotlinx.datetime/Instant = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., kotlin/Boolean = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ...): dev.kord.common.entity/DiscordMessage // dev.kord.common.entity/DiscordMessage.copy|copy(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.DiscordUser;dev.kord.common.entity.optional.Optional;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt){}[0] + final fun copy(dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/DiscordUser = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/String = ..., kotlinx.datetime/Instant = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., kotlin/Boolean = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.common.entity/DiscordMessage // dev.kord.common.entity/DiscordMessage.copy|copy(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.DiscordUser;dev.kord.common.entity.optional.Optional;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordMessage.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordMessage.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.common.entity/DiscordMessage.toString|toString(){}[0] @@ -4201,6 +4204,172 @@ final class dev.kord.common.entity/DiscordPinsUpdateData { // dev.kord.common.en } } +final class dev.kord.common.entity/DiscordPoll { // dev.kord.common.entity/DiscordPoll|null[0] + constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant?, kotlin/Boolean, dev.kord.common.entity/PollLayoutType, dev.kord.common.entity/DiscordPoll.Results?) // dev.kord.common.entity/DiscordPoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0] + + final val allowMultiselect // dev.kord.common.entity/DiscordPoll.allowMultiselect|{}allowMultiselect[0] + final fun (): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.allowMultiselect.|(){}[0] + final val answers // dev.kord.common.entity/DiscordPoll.answers|{}answers[0] + final fun (): kotlin.collections/List // dev.kord.common.entity/DiscordPoll.answers.|(){}[0] + final val expiry // dev.kord.common.entity/DiscordPoll.expiry|{}expiry[0] + final fun (): kotlinx.datetime/Instant? // dev.kord.common.entity/DiscordPoll.expiry.|(){}[0] + final val layoutType // dev.kord.common.entity/DiscordPoll.layoutType|{}layoutType[0] + final fun (): dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/DiscordPoll.layoutType.|(){}[0] + final val question // dev.kord.common.entity/DiscordPoll.question|{}question[0] + final fun (): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.question.|(){}[0] + final val results // dev.kord.common.entity/DiscordPoll.results|{}results[0] + final fun (): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.results.|(){}[0] + + final fun component1(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.component1|component1(){}[0] + final fun component2(): kotlin.collections/List // dev.kord.common.entity/DiscordPoll.component2|component2(){}[0] + final fun component3(): kotlinx.datetime/Instant? // dev.kord.common.entity/DiscordPoll.component3|component3(){}[0] + final fun component4(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.component4|component4(){}[0] + final fun component5(): dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/DiscordPoll.component5|component5(){}[0] + final fun component6(): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.component6|component6(){}[0] + final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., dev.kord.common.entity/PollLayoutType = ..., dev.kord.common.entity/DiscordPoll.Results? = ...): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.toString|toString(){}[0] + + final class Answer { // dev.kord.common.entity/DiscordPoll.Answer|null[0] + constructor (kotlin/Int, dev.kord.common.entity/DiscordPoll.Media) // dev.kord.common.entity/DiscordPoll.Answer.|(kotlin.Int;dev.kord.common.entity.DiscordPoll.Media){}[0] + + final val answerId // dev.kord.common.entity/DiscordPoll.Answer.answerId|{}answerId[0] + final fun (): kotlin/Int // dev.kord.common.entity/DiscordPoll.Answer.answerId.|(){}[0] + final val pollMedia // dev.kord.common.entity/DiscordPoll.Answer.pollMedia|{}pollMedia[0] + final fun (): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.Answer.pollMedia.|(){}[0] + + final fun component1(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Answer.component1|component1(){}[0] + final fun component2(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.Answer.component2|component2(){}[0] + final fun copy(kotlin/Int = ..., dev.kord.common.entity/DiscordPoll.Media = ...): dev.kord.common.entity/DiscordPoll.Answer // dev.kord.common.entity/DiscordPoll.Answer.copy|copy(kotlin.Int;dev.kord.common.entity.DiscordPoll.Media){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Answer.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Answer.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.Answer.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.common.entity/DiscordPoll.Answer.$serializer|null[0] + final val descriptor // dev.kord.common.entity/DiscordPoll.Answer.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/DiscordPoll.Answer.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.common.entity/DiscordPoll.Answer.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/DiscordPoll.Answer // dev.kord.common.entity/DiscordPoll.Answer.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/DiscordPoll.Answer) // dev.kord.common.entity/DiscordPoll.Answer.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.DiscordPoll.Answer){}[0] + } + + final object Companion { // dev.kord.common.entity/DiscordPoll.Answer.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/DiscordPoll.Answer.Companion.serializer|serializer(){}[0] + } + } + + final class Media { // dev.kord.common.entity/DiscordPoll.Media|null[0] + constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.common.entity/DiscordPoll.Media.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] + + final val emoji // dev.kord.common.entity/DiscordPoll.Media.emoji|{}emoji[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.Media.emoji.|(){}[0] + final val text // dev.kord.common.entity/DiscordPoll.Media.text|{}text[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.Media.text.|(){}[0] + + final fun component1(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.Media.component1|component1(){}[0] + final fun component2(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.Media.component2|component2(){}[0] + final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.Media.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Media.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Media.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.Media.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.common.entity/DiscordPoll.Media.$serializer|null[0] + final val descriptor // dev.kord.common.entity/DiscordPoll.Media.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/DiscordPoll.Media.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.common.entity/DiscordPoll.Media.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.Media.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/DiscordPoll.Media) // dev.kord.common.entity/DiscordPoll.Media.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.DiscordPoll.Media){}[0] + } + + final object Companion { // dev.kord.common.entity/DiscordPoll.Media.Companion|null[0] + final val $childSerializers // dev.kord.common.entity/DiscordPoll.Media.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/DiscordPoll.Media.Companion.serializer|serializer(){}[0] + } + } + + final class Results { // dev.kord.common.entity/DiscordPoll.Results|null[0] + constructor (kotlin/Boolean, kotlin.collections/List) // dev.kord.common.entity/DiscordPoll.Results.|(kotlin.Boolean;kotlin.collections.List){}[0] + + final val answerCounts // dev.kord.common.entity/DiscordPoll.Results.answerCounts|{}answerCounts[0] + final fun (): kotlin.collections/List // dev.kord.common.entity/DiscordPoll.Results.answerCounts.|(){}[0] + final val isFinalized // dev.kord.common.entity/DiscordPoll.Results.isFinalized|{}isFinalized[0] + final fun (): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.isFinalized.|(){}[0] + + final fun component1(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.component1|component1(){}[0] + final fun component2(): kotlin.collections/List // dev.kord.common.entity/DiscordPoll.Results.component2|component2(){}[0] + final fun copy(kotlin/Boolean = ..., kotlin.collections/List = ...): dev.kord.common.entity/DiscordPoll.Results // dev.kord.common.entity/DiscordPoll.Results.copy|copy(kotlin.Boolean;kotlin.collections.List){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.Results.toString|toString(){}[0] + + final class AnswerCount { // dev.kord.common.entity/DiscordPoll.Results.AnswerCount|null[0] + constructor (kotlin/Int, kotlin/Int, kotlin/Boolean) // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.|(kotlin.Int;kotlin.Int;kotlin.Boolean){}[0] + + final val count // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.count|{}count[0] + final fun (): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.count.|(){}[0] + final val id // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.id|{}id[0] + final fun (): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.id.|(){}[0] + final val meVoted // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.meVoted|{}meVoted[0] + final fun (): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.meVoted.|(){}[0] + + final fun component1(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.component1|component1(){}[0] + final fun component2(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.component2|component2(){}[0] + final fun component3(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.component3|component3(){}[0] + final fun copy(kotlin/Int = ..., kotlin/Int = ..., kotlin/Boolean = ...): dev.kord.common.entity/DiscordPoll.Results.AnswerCount // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.copy|copy(kotlin.Int;kotlin.Int;kotlin.Boolean){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer|null[0] + final val descriptor // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/DiscordPoll.Results.AnswerCount // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/DiscordPoll.Results.AnswerCount) // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.DiscordPoll.Results.AnswerCount){}[0] + } + + final object Companion { // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/DiscordPoll.Results.AnswerCount.Companion.serializer|serializer(){}[0] + } + } + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.common.entity/DiscordPoll.Results.$serializer|null[0] + final val descriptor // dev.kord.common.entity/DiscordPoll.Results.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/DiscordPoll.Results.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.common.entity/DiscordPoll.Results.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/DiscordPoll.Results // dev.kord.common.entity/DiscordPoll.Results.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/DiscordPoll.Results) // dev.kord.common.entity/DiscordPoll.Results.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.DiscordPoll.Results){}[0] + } + + final object Companion { // dev.kord.common.entity/DiscordPoll.Results.Companion|null[0] + final val $childSerializers // dev.kord.common.entity/DiscordPoll.Results.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/DiscordPoll.Results.Companion.serializer|serializer(){}[0] + } + } + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.common.entity/DiscordPoll.$serializer|null[0] + final val descriptor // dev.kord.common.entity/DiscordPoll.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common.entity/DiscordPoll.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.common.entity/DiscordPoll.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common.entity/DiscordPoll) // dev.kord.common.entity/DiscordPoll.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.entity.DiscordPoll){}[0] + } + + final object Companion { // dev.kord.common.entity/DiscordPoll.Companion|null[0] + final val $childSerializers // dev.kord.common.entity/DiscordPoll.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/DiscordPoll.Companion.serializer|serializer(){}[0] + } +} + final class dev.kord.common.entity/DiscordPresenceUpdate { // dev.kord.common.entity/DiscordPresenceUpdate|null[0] constructor (dev.kord.common.entity/DiscordPresenceUser, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/PresenceStatus, kotlin.collections/List, dev.kord.common.entity/DiscordClientStatus) // dev.kord.common.entity/DiscordPresenceUpdate.|(dev.kord.common.entity.DiscordPresenceUser;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.PresenceStatus;kotlin.collections.List;dev.kord.common.entity.DiscordClientStatus){}[0] @@ -5582,7 +5751,7 @@ final class dev.kord.common.entity/IntegrationApplication { // dev.kord.common.e } final class dev.kord.common.entity/InteractionCallbackData { // dev.kord.common.entity/InteractionCallbackData|null[0] - constructor (dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ...) // dev.kord.common.entity/InteractionCallbackData.|(dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>){}[0] + constructor (dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.common.entity/InteractionCallbackData.|(dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final val componentType // dev.kord.common.entity/InteractionCallbackData.componentType|{}componentType[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.componentType.|(){}[0] @@ -5598,6 +5767,8 @@ final class dev.kord.common.entity/InteractionCallbackData { // dev.kord.common. final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.name.|(){}[0] final val options // dev.kord.common.entity/InteractionCallbackData.options|{}options[0] final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.common.entity/InteractionCallbackData.options.|(){}[0] + final val poll // dev.kord.common.entity/InteractionCallbackData.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.poll.|(){}[0] final val resolved // dev.kord.common.entity/InteractionCallbackData.resolved|{}resolved[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.resolved.|(){}[0] final val targetId // dev.kord.common.entity/InteractionCallbackData.targetId|{}targetId[0] @@ -5610,6 +5781,7 @@ final class dev.kord.common.entity/InteractionCallbackData { // dev.kord.common. final fun component1(): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.common.entity/InteractionCallbackData.component1|component1(){}[0] final fun component10(): dev.kord.common.entity.optional/Optional> // dev.kord.common.entity/InteractionCallbackData.component10|component10(){}[0] final fun component11(): dev.kord.common.entity.optional/Optional> // dev.kord.common.entity/InteractionCallbackData.component11|component11(){}[0] + final fun component12(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.component12|component12(){}[0] final fun component2(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.component2|component2(){}[0] final fun component3(): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.common.entity/InteractionCallbackData.component3|component3(){}[0] final fun component4(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.component4|component4(){}[0] @@ -5618,7 +5790,7 @@ final class dev.kord.common.entity/InteractionCallbackData { // dev.kord.common. final fun component7(): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.common.entity/InteractionCallbackData.component7|component7(){}[0] final fun component8(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.component8|component8(){}[0] final fun component9(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/InteractionCallbackData.component9|component9(){}[0] - final fun copy(dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ...): dev.kord.common.entity/InteractionCallbackData // dev.kord.common.entity/InteractionCallbackData.copy|copy(dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>){}[0] + final fun copy(dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.common.entity/InteractionCallbackData // dev.kord.common.entity/InteractionCallbackData.copy|copy(dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/InteractionCallbackData.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.common.entity/InteractionCallbackData.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.common.entity/InteractionCallbackData.toString|toString(){}[0] @@ -8580,6 +8752,29 @@ sealed class dev.kord.common.entity/Permission { // dev.kord.common.entity/Permi final object ViewGuildInsights : dev.kord.common.entity/Permission // dev.kord.common.entity/Permission.ViewGuildInsights|null[0] } +sealed class dev.kord.common.entity/PollLayoutType { // dev.kord.common.entity/PollLayoutType|null[0] + constructor (kotlin/Int) // dev.kord.common.entity/PollLayoutType.|(kotlin.Int){}[0] + + final val value // dev.kord.common.entity/PollLayoutType.value|{}value[0] + final fun (): kotlin/Int // dev.kord.common.entity/PollLayoutType.value.|(){}[0] + + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/PollLayoutType.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.common.entity/PollLayoutType.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.common.entity/PollLayoutType.toString|toString(){}[0] + + final class Unknown : dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/PollLayoutType.Unknown|null[0] + + final object Companion { // dev.kord.common.entity/PollLayoutType.Companion|null[0] + final val entries // dev.kord.common.entity/PollLayoutType.Companion.entries|{}entries[0] + final fun (): kotlin.collections/List // dev.kord.common.entity/PollLayoutType.Companion.entries.|(){}[0] + + final fun from(kotlin/Int): dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/PollLayoutType.Companion.from|from(kotlin.Int){}[0] + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/PollLayoutType.Companion.serializer|serializer(){}[0] + } + + final object DEFAULT : dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/PollLayoutType.DEFAULT|null[0] +} + sealed class dev.kord.common.entity/PremiumTier { // dev.kord.common.entity/PremiumTier|null[0] constructor (kotlin/Int) // dev.kord.common.entity/PremiumTier.|(kotlin.Int){}[0] diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt index be3cc657002..967a23d97a3 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt @@ -69,7 +69,6 @@ public sealed class PollLayoutType( ) } - /** * Returns an instance of [PollLayoutType] with [PollLayoutType.value] equal to the * specified [value]. diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index d3e4ac2e26b..b9b930f7f00 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -715,7 +715,7 @@ public data class RoleSubscription( public data class DiscordPoll( val question: Media, val answers: List, - val expiry: Instant, + val expiry: Instant?, @SerialName("allow_multiselect") val allowMultiselect: Boolean, @SerialName("layout_type") diff --git a/core/api/core.klib.api b/core/api/core.klib.api index 1d39196ab5f..77150c7d21c 100644 --- a/core/api/core.klib.api +++ b/core/api/core.klib.api @@ -73,7 +73,7 @@ abstract interface dev.kord.core.behavior.channel.threads/PrivateThreadParentCha open fun getPrivateArchivedThreads(kotlinx.datetime/Instant? = ..., kotlin/Int? = ...): kotlinx.coroutines.flow/Flow // dev.kord.core.behavior.channel.threads/PrivateThreadParentChannelBehavior.getPrivateArchivedThreads|getPrivateArchivedThreads(kotlinx.datetime.Instant?;kotlin.Int?){}[0] } -abstract interface dev.kord.core.behavior.channel.threads/ThreadChannelBehavior : dev.kord.core.behavior.channel/GuildMessageChannelBehavior { // dev.kord.core.behavior.channel.threads/ThreadChannelBehavior|null[0] +abstract interface dev.kord.core.behavior.channel.threads/ThreadChannelBehavior : dev.kord.core.behavior.channel/GuildMessageChannelBehavior, dev.kord.core.behavior.channel/PollParentChannelBehavior { // dev.kord.core.behavior.channel.threads/ThreadChannelBehavior|null[0] abstract val parentId // dev.kord.core.behavior.channel.threads/ThreadChannelBehavior.parentId|{}parentId[0] abstract fun (): dev.kord.common.entity/Snowflake // dev.kord.core.behavior.channel.threads/ThreadChannelBehavior.parentId.|(){}[0] open val members // dev.kord.core.behavior.channel.threads/ThreadChannelBehavior.members|{}members[0] @@ -238,13 +238,15 @@ abstract interface dev.kord.core.behavior.channel/NewsChannelBehavior : dev.kord open suspend fun startPublicThreadWithMessage(dev.kord.common.entity/Snowflake, kotlin/String, kotlin/Function1 = ...): dev.kord.core.entity.channel.thread/NewsChannelThread // dev.kord.core.behavior.channel/NewsChannelBehavior.startPublicThreadWithMessage|startPublicThreadWithMessage(dev.kord.common.entity.Snowflake;kotlin.String;kotlin.Function1){}[0] } -abstract interface dev.kord.core.behavior.channel/StageChannelBehavior : dev.kord.core.behavior.channel/BaseVoiceChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/StageChannelBehavior|null[0] +abstract interface dev.kord.core.behavior.channel/PollParentChannelBehavior : dev.kord.core.behavior.channel/MessageChannelBehavior // dev.kord.core.behavior.channel/PollParentChannelBehavior|null[0] + +abstract interface dev.kord.core.behavior.channel/StageChannelBehavior : dev.kord.core.behavior.channel/BaseVoiceChannelBehavior, dev.kord.core.behavior.channel/PollParentChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/StageChannelBehavior|null[0] open fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.behavior.channel/StageChannelBehavior // dev.kord.core.behavior.channel/StageChannelBehavior.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] open suspend fun getStageInstance(): dev.kord.core.entity/StageInstance // dev.kord.core.behavior.channel/StageChannelBehavior.getStageInstance|getStageInstance(){}[0] open suspend fun getStageInstanceOrNull(): dev.kord.core.entity/StageInstance? // dev.kord.core.behavior.channel/StageChannelBehavior.getStageInstanceOrNull|getStageInstanceOrNull(){}[0] } -abstract interface dev.kord.core.behavior.channel/TextChannelBehavior : dev.kord.core.behavior.channel.threads/PrivateThreadParentChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/TextChannelBehavior|null[0] +abstract interface dev.kord.core.behavior.channel/TextChannelBehavior : dev.kord.core.behavior.channel.threads/PrivateThreadParentChannelBehavior, dev.kord.core.behavior.channel/PollParentChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/TextChannelBehavior|null[0] open val activeThreads // dev.kord.core.behavior.channel/TextChannelBehavior.activeThreads|{}activeThreads[0] open fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.behavior.channel/TextChannelBehavior.activeThreads.|(){}[0] @@ -279,7 +281,7 @@ abstract interface dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior open suspend fun fetchChannelOrNull(): dev.kord.core.entity.channel/TopGuildMessageChannel? // dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior.fetchChannelOrNull|fetchChannelOrNull(){}[0] } -abstract interface dev.kord.core.behavior.channel/VoiceChannelBehavior : dev.kord.core.behavior.channel/BaseVoiceChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/VoiceChannelBehavior|null[0] +abstract interface dev.kord.core.behavior.channel/VoiceChannelBehavior : dev.kord.core.behavior.channel/BaseVoiceChannelBehavior, dev.kord.core.behavior.channel/PollParentChannelBehavior, dev.kord.core.behavior.channel/TopGuildMessageChannelBehavior { // dev.kord.core.behavior.channel/VoiceChannelBehavior|null[0] open fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.behavior.channel/VoiceChannelBehavior // dev.kord.core.behavior.channel/VoiceChannelBehavior.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] open suspend fun asChannel(): dev.kord.core.entity.channel/VoiceChannel // dev.kord.core.behavior.channel/VoiceChannelBehavior.asChannel|asChannel(){}[0] open suspend fun asChannelOrNull(): dev.kord.core.entity.channel/VoiceChannel? // dev.kord.core.behavior.channel/VoiceChannelBehavior.asChannelOrNull|asChannelOrNull(){}[0] @@ -847,6 +849,104 @@ abstract interface dev.kord.core.entity/Entity : kotlin/Comparable(): dev.kord.core.cache.data/MessageData // dev.kord.core.entity/Message.data.|(){}[0] + open val actionRows // dev.kord.core.entity/Message.actionRows|{}actionRows[0] + open fun (): kotlin.collections/List // dev.kord.core.entity/Message.actionRows.|(){}[0] + open val applicationId // dev.kord.core.entity/Message.applicationId|{}applicationId[0] + open fun (): dev.kord.common.entity/Snowflake? // dev.kord.core.entity/Message.applicationId.|(){}[0] + open val attachments // dev.kord.core.entity/Message.attachments|{}attachments[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.attachments.|(){}[0] + open val author // dev.kord.core.entity/Message.author|{}author[0] + open fun (): dev.kord.core.entity/User? // dev.kord.core.entity/Message.author.|(){}[0] + open val channelId // dev.kord.core.entity/Message.channelId|{}channelId[0] + open fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.channelId.|(){}[0] + open val content // dev.kord.core.entity/Message.content|{}content[0] + open fun (): kotlin/String // dev.kord.core.entity/Message.content.|(){}[0] + open val editedTimestamp // dev.kord.core.entity/Message.editedTimestamp|{}editedTimestamp[0] + open fun (): kotlinx.datetime/Instant? // dev.kord.core.entity/Message.editedTimestamp.|(){}[0] + open val embeds // dev.kord.core.entity/Message.embeds|{}embeds[0] + open fun (): kotlin.collections/List // dev.kord.core.entity/Message.embeds.|(){}[0] + open val flags // dev.kord.core.entity/Message.flags|{}flags[0] + open fun (): dev.kord.common.entity/MessageFlags? // dev.kord.core.entity/Message.flags.|(){}[0] + open val id // dev.kord.core.entity/Message.id|{}id[0] + open fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.id.|(){}[0] + open val interaction // dev.kord.core.entity/Message.interaction|{}interaction[0] + open fun (): dev.kord.core.entity/Message.Interaction? // dev.kord.core.entity/Message.interaction.|(){}[0] + open val isPinned // dev.kord.core.entity/Message.isPinned|{}isPinned[0] + open fun (): kotlin/Boolean // dev.kord.core.entity/Message.isPinned.|(){}[0] + open val mentionedChannelBehaviors // dev.kord.core.entity/Message.mentionedChannelBehaviors|{}mentionedChannelBehaviors[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedChannelBehaviors.|(){}[0] + open val mentionedChannelIds // dev.kord.core.entity/Message.mentionedChannelIds|{}mentionedChannelIds[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedChannelIds.|(){}[0] + open val mentionedChannels // dev.kord.core.entity/Message.mentionedChannels|{}mentionedChannels[0] + open fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedChannels.|(){}[0] + open val mentionedRoleIds // dev.kord.core.entity/Message.mentionedRoleIds|{}mentionedRoleIds[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedRoleIds.|(){}[0] + open val mentionedRoles // dev.kord.core.entity/Message.mentionedRoles|{}mentionedRoles[0] + open fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedRoles.|(){}[0] + open val mentionedUserBehaviors // dev.kord.core.entity/Message.mentionedUserBehaviors|{}mentionedUserBehaviors[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedUserBehaviors.|(){}[0] + open val mentionedUserIds // dev.kord.core.entity/Message.mentionedUserIds|{}mentionedUserIds[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedUserIds.|(){}[0] + open val mentionedUsers // dev.kord.core.entity/Message.mentionedUsers|{}mentionedUsers[0] + open fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedUsers.|(){}[0] + open val mentionsEveryone // dev.kord.core.entity/Message.mentionsEveryone|{}mentionsEveryone[0] + open fun (): kotlin/Boolean // dev.kord.core.entity/Message.mentionsEveryone.|(){}[0] + open val messageReference // dev.kord.core.entity/Message.messageReference|{}messageReference[0] + open fun (): dev.kord.core.entity/MessageReference? // dev.kord.core.entity/Message.messageReference.|(){}[0] + open val position // dev.kord.core.entity/Message.position|{}position[0] + open fun (): kotlin/Int? // dev.kord.core.entity/Message.position.|(){}[0] + open val reactions // dev.kord.core.entity/Message.reactions|{}reactions[0] + open fun (): kotlin.collections/Set // dev.kord.core.entity/Message.reactions.|(){}[0] + open val referencedMessage // dev.kord.core.entity/Message.referencedMessage|{}referencedMessage[0] + open fun (): dev.kord.core.entity/Message? // dev.kord.core.entity/Message.referencedMessage.|(){}[0] + open val roleSubscriptionData // dev.kord.core.entity/Message.roleSubscriptionData|{}roleSubscriptionData[0] + open fun (): dev.kord.common.entity/RoleSubscription? // dev.kord.core.entity/Message.roleSubscriptionData.|(){}[0] + open val stickers // dev.kord.core.entity/Message.stickers|{}stickers[0] + open fun (): kotlin.collections/List // dev.kord.core.entity/Message.stickers.|(){}[0] + open val timestamp // dev.kord.core.entity/Message.timestamp|{}timestamp[0] + open fun (): kotlinx.datetime/Instant // dev.kord.core.entity/Message.timestamp.|(){}[0] + open val tts // dev.kord.core.entity/Message.tts|{}tts[0] + open fun (): kotlin/Boolean // dev.kord.core.entity/Message.tts.|(){}[0] + open val type // dev.kord.core.entity/Message.type|{}type[0] + open fun (): dev.kord.common.entity/MessageType // dev.kord.core.entity/Message.type.|(){}[0] + open val webhookId // dev.kord.core.entity/Message.webhookId|{}webhookId[0] + open fun (): dev.kord.common.entity/Snowflake? // dev.kord.core.entity/Message.webhookId.|(){}[0] + + abstract fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/Message // dev.kord.core.entity/Message.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] + open suspend fun asMessage(): dev.kord.core.entity/Message // dev.kord.core.entity/Message.asMessage|asMessage(){}[0] + open suspend fun asMessageOrNull(): dev.kord.core.entity/Message // dev.kord.core.entity/Message.asMessageOrNull|asMessageOrNull(){}[0] + open suspend fun getAuthorAsMember(): dev.kord.core.entity/Member // dev.kord.core.entity/Message.getAuthorAsMember|getAuthorAsMember(){}[0] + open suspend fun getAuthorAsMemberOrNull(): dev.kord.core.entity/Member? // dev.kord.core.entity/Message.getAuthorAsMemberOrNull|getAuthorAsMemberOrNull(){}[0] + open suspend fun getGuild(): dev.kord.core.entity/Guild // dev.kord.core.entity/Message.getGuild|getGuild(){}[0] + open suspend fun getGuildOrNull(): dev.kord.core.entity/Guild? // dev.kord.core.entity/Message.getGuildOrNull|getGuildOrNull(){}[0] + + final class Interaction : dev.kord.core.entity/KordEntity, dev.kord.core.entity/Strategizable { // dev.kord.core.entity/Message.Interaction|null[0] + constructor (dev.kord.core.cache.data/MessageInteractionData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Message.Interaction.|(dev.kord.core.cache.data.MessageInteractionData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] + + final val data // dev.kord.core.entity/Message.Interaction.data|{}data[0] + final fun (): dev.kord.core.cache.data/MessageInteractionData // dev.kord.core.entity/Message.Interaction.data.|(){}[0] + final val id // dev.kord.core.entity/Message.Interaction.id|{}id[0] + final fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.Interaction.id.|(){}[0] + final val kord // dev.kord.core.entity/Message.Interaction.kord|{}kord[0] + final fun (): dev.kord.core/Kord // dev.kord.core.entity/Message.Interaction.kord.|(){}[0] + final val name // dev.kord.core.entity/Message.Interaction.name|{}name[0] + final fun (): kotlin/String // dev.kord.core.entity/Message.Interaction.name.|(){}[0] + final val supplier // dev.kord.core.entity/Message.Interaction.supplier|{}supplier[0] + final fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/Message.Interaction.supplier.|(){}[0] + final val type // dev.kord.core.entity/Message.Interaction.type|{}type[0] + final fun (): dev.kord.common.entity/InteractionType // dev.kord.core.entity/Message.Interaction.type.|(){}[0] + final val user // dev.kord.core.entity/Message.Interaction.user|{}user[0] + final fun (): dev.kord.core.behavior/UserBehavior // dev.kord.core.entity/Message.Interaction.user.|(){}[0] + + final fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/Message.Interaction // dev.kord.core.entity/Message.Interaction.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] + final suspend fun getUser(): dev.kord.core.entity/User // dev.kord.core.entity/Message.Interaction.getUser|getUser(){}[0] + final suspend fun getUserOrNull(): dev.kord.core.entity/User? // dev.kord.core.entity/Message.Interaction.getUserOrNull|getUserOrNull(){}[0] + } +} + abstract interface dev.kord.core.entity/Strategizable { // dev.kord.core.entity/Strategizable|null[0] abstract val supplier // dev.kord.core.entity/Strategizable.supplier|{}supplier[0] abstract fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/Strategizable.supplier.|(){}[0] @@ -4009,7 +4109,7 @@ final class dev.kord.core.cache.data/MembersChunkData { // dev.kord.core.cache.d } final class dev.kord.core.cache.data/MessageData { // dev.kord.core.cache.data/MessageData|null[0] - constructor (dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.core.cache.data/UserData, kotlin/String, kotlinx.datetime/Instant, kotlinx.datetime/Instant? = ..., kotlin/Boolean, kotlin/Boolean, kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ...) // dev.kord.core.cache.data/MessageData.|(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.core.cache.data.UserData;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt){}[0] + constructor (dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.core.cache.data/UserData, kotlin/String, kotlinx.datetime/Instant, kotlinx.datetime/Instant? = ..., kotlin/Boolean, kotlin/Boolean, kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List, kotlin.collections/List, dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean, dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.core.cache.data/MessageData.|(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.core.cache.data.UserData;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt;dev.kord.common.entity.optional.Optional){}[0] final val activity // dev.kord.core.cache.data/MessageData.activity|{}activity[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.core.cache.data/MessageData.activity.|(){}[0] @@ -4053,6 +4153,8 @@ final class dev.kord.core.cache.data/MessageData { // dev.kord.core.cache.data/M final fun (): dev.kord.common.entity.optional/Optional // dev.kord.core.cache.data/MessageData.nonce.|(){}[0] final val pinned // dev.kord.core.cache.data/MessageData.pinned|{}pinned[0] final fun (): kotlin/Boolean // dev.kord.core.cache.data/MessageData.pinned.|(){}[0] + final val poll // dev.kord.core.cache.data/MessageData.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.core.cache.data/MessageData.poll.|(){}[0] final val position // dev.kord.core.cache.data/MessageData.position|{}position[0] final fun (): dev.kord.common.entity.optional/OptionalInt // dev.kord.core.cache.data/MessageData.position.|(){}[0] final val reactions // dev.kord.core.cache.data/MessageData.reactions|{}reactions[0] @@ -4096,13 +4198,14 @@ final class dev.kord.core.cache.data/MessageData { // dev.kord.core.cache.data/M final fun component29(): dev.kord.common.entity.optional/Optional // dev.kord.core.cache.data/MessageData.component29|component29(){}[0] final fun component3(): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.core.cache.data/MessageData.component3|component3(){}[0] final fun component30(): dev.kord.common.entity.optional/OptionalInt // dev.kord.core.cache.data/MessageData.component30|component30(){}[0] + final fun component31(): dev.kord.common.entity.optional/Optional // dev.kord.core.cache.data/MessageData.component31|component31(){}[0] final fun component4(): dev.kord.core.cache.data/UserData // dev.kord.core.cache.data/MessageData.component4|component4(){}[0] final fun component5(): kotlin/String // dev.kord.core.cache.data/MessageData.component5|component5(){}[0] final fun component6(): kotlinx.datetime/Instant // dev.kord.core.cache.data/MessageData.component6|component6(){}[0] final fun component7(): kotlinx.datetime/Instant? // dev.kord.core.cache.data/MessageData.component7|component7(){}[0] final fun component8(): kotlin/Boolean // dev.kord.core.cache.data/MessageData.component8|component8(){}[0] final fun component9(): kotlin/Boolean // dev.kord.core.cache.data/MessageData.component9|component9(){}[0] - final fun copy(dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.core.cache.data/UserData = ..., kotlin/String = ..., kotlinx.datetime/Instant = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., kotlin/Boolean = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ...): dev.kord.core.cache.data/MessageData // dev.kord.core.cache.data/MessageData.copy|copy(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.core.cache.data.UserData;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt){}[0] + final fun copy(dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.core.cache.data/UserData = ..., kotlin/String = ..., kotlinx.datetime/Instant = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., kotlin/Boolean = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., kotlin.collections/List = ..., kotlin.collections/List = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., kotlin/Boolean = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity/MessageType = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalInt = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.core.cache.data/MessageData // dev.kord.core.cache.data/MessageData.copy|copy(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.core.cache.data.UserData;kotlin.String;kotlinx.datetime.Instant;kotlinx.datetime.Instant?;kotlin.Boolean;kotlin.Boolean;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;kotlin.collections.List;kotlin.collections.List;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;kotlin.Boolean;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.MessageType;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalSnowflake;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalInt;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.core.cache.data/MessageData.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.core.cache.data/MessageData.hashCode|hashCode(){}[0] final fun plus(dev.kord.common.entity/DiscordPartialMessage): dev.kord.core.cache.data/MessageData // dev.kord.core.cache.data/MessageData.plus|plus(dev.kord.common.entity.DiscordPartialMessage){}[0] @@ -6009,7 +6112,7 @@ final class dev.kord.core.entity.channel/Category : dev.kord.core.behavior.chann final suspend fun asChannelOrNull(): dev.kord.core.entity.channel/Category // dev.kord.core.entity.channel/Category.asChannelOrNull|asChannelOrNull(){}[0] } -final class dev.kord.core.entity.channel/DmChannel : dev.kord.core.entity.channel/MessageChannel { // dev.kord.core.entity.channel/DmChannel|null[0] +final class dev.kord.core.entity.channel/DmChannel : dev.kord.core.behavior.channel/PollParentChannelBehavior, dev.kord.core.entity.channel/MessageChannel { // dev.kord.core.entity.channel/DmChannel|null[0] constructor (dev.kord.core.cache.data/ChannelData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity.channel/DmChannel.|(dev.kord.core.cache.data.ChannelData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] final val data // dev.kord.core.entity.channel/DmChannel.data|{}data[0] @@ -7108,6 +7211,21 @@ final class dev.kord.core.entity/ClientStatus { // dev.kord.core.entity/ClientSt } } +final class dev.kord.core.entity/DefaultMessage : dev.kord.core.entity/Message { // dev.kord.core.entity/DefaultMessage|null[0] + constructor (dev.kord.core.cache.data/MessageData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/DefaultMessage.|(dev.kord.core.cache.data.MessageData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] + + final val data // dev.kord.core.entity/DefaultMessage.data|{}data[0] + final fun (): dev.kord.core.cache.data/MessageData // dev.kord.core.entity/DefaultMessage.data.|(){}[0] + final val kord // dev.kord.core.entity/DefaultMessage.kord|{}kord[0] + final fun (): dev.kord.core/Kord // dev.kord.core.entity/DefaultMessage.kord.|(){}[0] + final val supplier // dev.kord.core.entity/DefaultMessage.supplier|{}supplier[0] + final fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/DefaultMessage.supplier.|(){}[0] + + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.core.entity/DefaultMessage.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.core.entity/DefaultMessage.hashCode|hashCode(){}[0] + final fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/DefaultMessage // dev.kord.core.entity/DefaultMessage.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] +} + final class dev.kord.core.entity/Embed : dev.kord.core/KordObject { // dev.kord.core.entity/Embed|null[0] constructor (dev.kord.core.cache.data/EmbedData, dev.kord.core/Kord) // dev.kord.core.entity/Embed.|(dev.kord.core.cache.data.EmbedData;dev.kord.core.Kord){}[0] @@ -7859,113 +7977,6 @@ final class dev.kord.core.entity/Member : dev.kord.core.behavior/MemberBehavior, final suspend fun isOwner(): kotlin/Boolean // dev.kord.core.entity/Member.isOwner|isOwner(){}[0] } -final class dev.kord.core.entity/Message : dev.kord.core.behavior/MessageBehavior { // dev.kord.core.entity/Message|null[0] - constructor (dev.kord.core.cache.data/MessageData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Message.|(dev.kord.core.cache.data.MessageData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] - - final val actionRows // dev.kord.core.entity/Message.actionRows|{}actionRows[0] - final fun (): kotlin.collections/List // dev.kord.core.entity/Message.actionRows.|(){}[0] - final val applicationId // dev.kord.core.entity/Message.applicationId|{}applicationId[0] - final fun (): dev.kord.common.entity/Snowflake? // dev.kord.core.entity/Message.applicationId.|(){}[0] - final val attachments // dev.kord.core.entity/Message.attachments|{}attachments[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.attachments.|(){}[0] - final val author // dev.kord.core.entity/Message.author|{}author[0] - final fun (): dev.kord.core.entity/User? // dev.kord.core.entity/Message.author.|(){}[0] - final val channelId // dev.kord.core.entity/Message.channelId|{}channelId[0] - final fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.channelId.|(){}[0] - final val content // dev.kord.core.entity/Message.content|{}content[0] - final fun (): kotlin/String // dev.kord.core.entity/Message.content.|(){}[0] - final val data // dev.kord.core.entity/Message.data|{}data[0] - final fun (): dev.kord.core.cache.data/MessageData // dev.kord.core.entity/Message.data.|(){}[0] - final val editedTimestamp // dev.kord.core.entity/Message.editedTimestamp|{}editedTimestamp[0] - final fun (): kotlinx.datetime/Instant? // dev.kord.core.entity/Message.editedTimestamp.|(){}[0] - final val embeds // dev.kord.core.entity/Message.embeds|{}embeds[0] - final fun (): kotlin.collections/List // dev.kord.core.entity/Message.embeds.|(){}[0] - final val flags // dev.kord.core.entity/Message.flags|{}flags[0] - final fun (): dev.kord.common.entity/MessageFlags? // dev.kord.core.entity/Message.flags.|(){}[0] - final val id // dev.kord.core.entity/Message.id|{}id[0] - final fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.id.|(){}[0] - final val interaction // dev.kord.core.entity/Message.interaction|{}interaction[0] - final fun (): dev.kord.core.entity/Message.Interaction? // dev.kord.core.entity/Message.interaction.|(){}[0] - final val isPinned // dev.kord.core.entity/Message.isPinned|{}isPinned[0] - final fun (): kotlin/Boolean // dev.kord.core.entity/Message.isPinned.|(){}[0] - final val kord // dev.kord.core.entity/Message.kord|{}kord[0] - final fun (): dev.kord.core/Kord // dev.kord.core.entity/Message.kord.|(){}[0] - final val mentionedChannelBehaviors // dev.kord.core.entity/Message.mentionedChannelBehaviors|{}mentionedChannelBehaviors[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedChannelBehaviors.|(){}[0] - final val mentionedChannelIds // dev.kord.core.entity/Message.mentionedChannelIds|{}mentionedChannelIds[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedChannelIds.|(){}[0] - final val mentionedChannels // dev.kord.core.entity/Message.mentionedChannels|{}mentionedChannels[0] - final fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedChannels.|(){}[0] - final val mentionedRoleIds // dev.kord.core.entity/Message.mentionedRoleIds|{}mentionedRoleIds[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedRoleIds.|(){}[0] - final val mentionedRoles // dev.kord.core.entity/Message.mentionedRoles|{}mentionedRoles[0] - final fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedRoles.|(){}[0] - final val mentionedUserBehaviors // dev.kord.core.entity/Message.mentionedUserBehaviors|{}mentionedUserBehaviors[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedUserBehaviors.|(){}[0] - final val mentionedUserIds // dev.kord.core.entity/Message.mentionedUserIds|{}mentionedUserIds[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.mentionedUserIds.|(){}[0] - final val mentionedUsers // dev.kord.core.entity/Message.mentionedUsers|{}mentionedUsers[0] - final fun (): kotlinx.coroutines.flow/Flow // dev.kord.core.entity/Message.mentionedUsers.|(){}[0] - final val mentionsEveryone // dev.kord.core.entity/Message.mentionsEveryone|{}mentionsEveryone[0] - final fun (): kotlin/Boolean // dev.kord.core.entity/Message.mentionsEveryone.|(){}[0] - final val messageReference // dev.kord.core.entity/Message.messageReference|{}messageReference[0] - final fun (): dev.kord.core.entity/MessageReference? // dev.kord.core.entity/Message.messageReference.|(){}[0] - final val position // dev.kord.core.entity/Message.position|{}position[0] - final fun (): kotlin/Int? // dev.kord.core.entity/Message.position.|(){}[0] - final val reactions // dev.kord.core.entity/Message.reactions|{}reactions[0] - final fun (): kotlin.collections/Set // dev.kord.core.entity/Message.reactions.|(){}[0] - final val referencedMessage // dev.kord.core.entity/Message.referencedMessage|{}referencedMessage[0] - final fun (): dev.kord.core.entity/Message? // dev.kord.core.entity/Message.referencedMessage.|(){}[0] - final val roleSubscriptionData // dev.kord.core.entity/Message.roleSubscriptionData|{}roleSubscriptionData[0] - final fun (): dev.kord.common.entity/RoleSubscription? // dev.kord.core.entity/Message.roleSubscriptionData.|(){}[0] - final val stickers // dev.kord.core.entity/Message.stickers|{}stickers[0] - final fun (): kotlin.collections/List // dev.kord.core.entity/Message.stickers.|(){}[0] - final val supplier // dev.kord.core.entity/Message.supplier|{}supplier[0] - final fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/Message.supplier.|(){}[0] - final val timestamp // dev.kord.core.entity/Message.timestamp|{}timestamp[0] - final fun (): kotlinx.datetime/Instant // dev.kord.core.entity/Message.timestamp.|(){}[0] - final val tts // dev.kord.core.entity/Message.tts|{}tts[0] - final fun (): kotlin/Boolean // dev.kord.core.entity/Message.tts.|(){}[0] - final val type // dev.kord.core.entity/Message.type|{}type[0] - final fun (): dev.kord.common.entity/MessageType // dev.kord.core.entity/Message.type.|(){}[0] - final val webhookId // dev.kord.core.entity/Message.webhookId|{}webhookId[0] - final fun (): dev.kord.common.entity/Snowflake? // dev.kord.core.entity/Message.webhookId.|(){}[0] - - final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.core.entity/Message.equals|equals(kotlin.Any?){}[0] - final fun hashCode(): kotlin/Int // dev.kord.core.entity/Message.hashCode|hashCode(){}[0] - final fun toString(): kotlin/String // dev.kord.core.entity/Message.toString|toString(){}[0] - final fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/Message // dev.kord.core.entity/Message.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] - final suspend fun asMessage(): dev.kord.core.entity/Message // dev.kord.core.entity/Message.asMessage|asMessage(){}[0] - final suspend fun asMessageOrNull(): dev.kord.core.entity/Message // dev.kord.core.entity/Message.asMessageOrNull|asMessageOrNull(){}[0] - final suspend fun getAuthorAsMember(): dev.kord.core.entity/Member // dev.kord.core.entity/Message.getAuthorAsMember|getAuthorAsMember(){}[0] - final suspend fun getAuthorAsMemberOrNull(): dev.kord.core.entity/Member? // dev.kord.core.entity/Message.getAuthorAsMemberOrNull|getAuthorAsMemberOrNull(){}[0] - final suspend fun getGuild(): dev.kord.core.entity/Guild // dev.kord.core.entity/Message.getGuild|getGuild(){}[0] - final suspend fun getGuildOrNull(): dev.kord.core.entity/Guild? // dev.kord.core.entity/Message.getGuildOrNull|getGuildOrNull(){}[0] - - final class Interaction : dev.kord.core.entity/KordEntity, dev.kord.core.entity/Strategizable { // dev.kord.core.entity/Message.Interaction|null[0] - constructor (dev.kord.core.cache.data/MessageInteractionData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Message.Interaction.|(dev.kord.core.cache.data.MessageInteractionData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] - - final val data // dev.kord.core.entity/Message.Interaction.data|{}data[0] - final fun (): dev.kord.core.cache.data/MessageInteractionData // dev.kord.core.entity/Message.Interaction.data.|(){}[0] - final val id // dev.kord.core.entity/Message.Interaction.id|{}id[0] - final fun (): dev.kord.common.entity/Snowflake // dev.kord.core.entity/Message.Interaction.id.|(){}[0] - final val kord // dev.kord.core.entity/Message.Interaction.kord|{}kord[0] - final fun (): dev.kord.core/Kord // dev.kord.core.entity/Message.Interaction.kord.|(){}[0] - final val name // dev.kord.core.entity/Message.Interaction.name|{}name[0] - final fun (): kotlin/String // dev.kord.core.entity/Message.Interaction.name.|(){}[0] - final val supplier // dev.kord.core.entity/Message.Interaction.supplier|{}supplier[0] - final fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/Message.Interaction.supplier.|(){}[0] - final val type // dev.kord.core.entity/Message.Interaction.type|{}type[0] - final fun (): dev.kord.common.entity/InteractionType // dev.kord.core.entity/Message.Interaction.type.|(){}[0] - final val user // dev.kord.core.entity/Message.Interaction.user|{}user[0] - final fun (): dev.kord.core.behavior/UserBehavior // dev.kord.core.entity/Message.Interaction.user.|(){}[0] - - final fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/Message.Interaction // dev.kord.core.entity/Message.Interaction.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] - final suspend fun getUser(): dev.kord.core.entity/User // dev.kord.core.entity/Message.Interaction.getUser|getUser(){}[0] - final suspend fun getUserOrNull(): dev.kord.core.entity/User? // dev.kord.core.entity/Message.Interaction.getUserOrNull|getUserOrNull(){}[0] - } -} - final class dev.kord.core.entity/MessageReference : dev.kord.core/KordObject { // dev.kord.core.entity/MessageReference|null[0] constructor (dev.kord.core.cache.data/MessageReferenceData, dev.kord.core/Kord) // dev.kord.core.entity/MessageReference.|(dev.kord.core.cache.data.MessageReferenceData;dev.kord.core.Kord){}[0] @@ -8070,6 +8081,24 @@ final class dev.kord.core.entity/PermissionOverwriteEntity : dev.kord.core.entit final suspend fun getGuildOrNull(): dev.kord.core.entity/Guild? // dev.kord.core.entity/PermissionOverwriteEntity.getGuildOrNull|getGuildOrNull(){}[0] } +final class dev.kord.core.entity/Poll : dev.kord.core.entity/Message { // dev.kord.core.entity/Poll|null[0] + constructor (dev.kord.core.cache.data/MessageData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Poll.|(dev.kord.core.cache.data.MessageData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] + + final val data // dev.kord.core.entity/Poll.data|{}data[0] + final fun (): dev.kord.core.cache.data/MessageData // dev.kord.core.entity/Poll.data.|(){}[0] + final val kord // dev.kord.core.entity/Poll.kord|{}kord[0] + final fun (): dev.kord.core/Kord // dev.kord.core.entity/Poll.kord.|(){}[0] + final val poll // dev.kord.core.entity/Poll.poll|{}poll[0] + final fun (): dev.kord.common.entity/DiscordPoll // dev.kord.core.entity/Poll.poll.|(){}[0] + final val supplier // dev.kord.core.entity/Poll.supplier|{}supplier[0] + final fun (): dev.kord.core.supplier/EntitySupplier // dev.kord.core.entity/Poll.supplier.|(){}[0] + + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.core.entity/Poll.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.core.entity/Poll.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.core.entity/Poll.toString|toString(){}[0] + final fun withStrategy(dev.kord.core.supplier/EntitySupplyStrategy<*>): dev.kord.core.entity/Poll // dev.kord.core.entity/Poll.withStrategy|withStrategy(dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] +} + final class dev.kord.core.entity/Presence : dev.kord.core.entity/Strategizable, dev.kord.core/KordObject { // dev.kord.core.entity/Presence|null[0] constructor (dev.kord.core.cache.data/PresenceData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Presence.|(dev.kord.core.cache.data.PresenceData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] @@ -12092,6 +12121,7 @@ final fun dev.kord.core.entity.interaction/GuildApplicationCommandInteraction(de final fun dev.kord.core.entity.interaction/InteractionCommand(dev.kord.core.cache.data/ApplicationInteractionData, dev.kord.core/Kord): dev.kord.core.entity.interaction/InteractionCommand // dev.kord.core.entity.interaction/InteractionCommand|InteractionCommand(dev.kord.core.cache.data.ApplicationInteractionData;dev.kord.core.Kord){}[0] final fun dev.kord.core.entity.interaction/ModalSubmitInteraction(dev.kord.core.cache.data/InteractionData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...): dev.kord.core.entity.interaction/ModalSubmitInteraction // dev.kord.core.entity.interaction/ModalSubmitInteraction|ModalSubmitInteraction(dev.kord.core.cache.data.InteractionData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] final fun dev.kord.core.entity.interaction/OptionValue(dev.kord.common.entity/CommandArgument<*>, dev.kord.core.entity.interaction/ResolvedObjects?): dev.kord.core.entity.interaction/OptionValue<*> // dev.kord.core.entity.interaction/OptionValue|OptionValue(dev.kord.common.entity.CommandArgument<*>;dev.kord.core.entity.interaction.ResolvedObjects?){}[0] +final fun dev.kord.core.entity/Message(dev.kord.core.cache.data/MessageData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...): dev.kord.core.entity/Message // dev.kord.core.entity/Message|Message(dev.kord.core.cache.data.MessageData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] final fun dev.kord.core/logCaughtThrowable(kotlin/Throwable) // dev.kord.core/logCaughtThrowable|logCaughtThrowable(kotlin.Throwable){}[0] final inline fun (dev.kord.core.behavior/GuildBehavior).dev.kord.core.behavior/getAuditLogEntries(kotlin/Function1 = ...): kotlinx.coroutines.flow/Flow // dev.kord.core.behavior/getAuditLogEntries|getAuditLogEntries@dev.kord.core.behavior.GuildBehavior(kotlin.Function1){}[0] final inline fun (dev.kord.core.behavior/GuildBehavior).dev.kord.core.behavior/requestMembers(kotlin/Function1 = ...): kotlinx.coroutines.flow/Flow // dev.kord.core.behavior/requestMembers|requestMembers@dev.kord.core.behavior.GuildBehavior(kotlin.Function1){}[0] @@ -12140,6 +12170,7 @@ final suspend inline fun (dev.kord.core.behavior.channel/MediaChannelBehavior).d final suspend inline fun (dev.kord.core.behavior.channel/MessageChannelBehavior).dev.kord.core.behavior.channel/createEmbed(kotlin/Function1): dev.kord.core.entity/Message // dev.kord.core.behavior.channel/createEmbed|createEmbed@dev.kord.core.behavior.channel.MessageChannelBehavior(kotlin.Function1){}[0] final suspend inline fun (dev.kord.core.behavior.channel/MessageChannelBehavior).dev.kord.core.behavior.channel/createMessage(kotlin/Function1): dev.kord.core.entity/Message // dev.kord.core.behavior.channel/createMessage|createMessage@dev.kord.core.behavior.channel.MessageChannelBehavior(kotlin.Function1){}[0] final suspend inline fun (dev.kord.core.behavior.channel/NewsChannelBehavior).dev.kord.core.behavior.channel/edit(kotlin/Function1): dev.kord.core.entity.channel/NewsChannel // dev.kord.core.behavior.channel/edit|edit@dev.kord.core.behavior.channel.NewsChannelBehavior(kotlin.Function1){}[0] +final suspend inline fun (dev.kord.core.behavior.channel/PollParentChannelBehavior).dev.kord.core.behavior.channel/createPoll(kotlin/Function1): dev.kord.core.entity/Poll // dev.kord.core.behavior.channel/createPoll|createPoll@dev.kord.core.behavior.channel.PollParentChannelBehavior(kotlin.Function1){}[0] final suspend inline fun (dev.kord.core.behavior.channel/StageChannelBehavior).dev.kord.core.behavior.channel/createStageInstance(kotlin/String, kotlin/Function1 = ...): dev.kord.core.entity/StageInstance // dev.kord.core.behavior.channel/createStageInstance|createStageInstance@dev.kord.core.behavior.channel.StageChannelBehavior(kotlin.String;kotlin.Function1){}[0] final suspend inline fun (dev.kord.core.behavior.channel/StageChannelBehavior).dev.kord.core.behavior.channel/editCurrentVoiceState(kotlin/Function1) // dev.kord.core.behavior.channel/editCurrentVoiceState|editCurrentVoiceState@dev.kord.core.behavior.channel.StageChannelBehavior(kotlin.Function1){}[0] final suspend inline fun (dev.kord.core.behavior.channel/StageChannelBehavior).dev.kord.core.behavior.channel/editVoiceState(dev.kord.common.entity/Snowflake, kotlin/Function1) // dev.kord.core.behavior.channel/editVoiceState|editVoiceState@dev.kord.core.behavior.channel.StageChannelBehavior(dev.kord.common.entity.Snowflake;kotlin.Function1){}[0] diff --git a/gateway/api/gateway.api b/gateway/api/gateway.api index 789b20e3bea..79d99c5c969 100644 --- a/gateway/api/gateway.api +++ b/gateway/api/gateway.api @@ -1436,13 +1436,13 @@ public final class dev/kord/gateway/MessagePollEventData { public fun toString ()Ljava/lang/String; } -public final class dev/kord/gateway/MessagePollEventData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { +public synthetic class dev/kord/gateway/MessagePollEventData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { public static final field INSTANCE Ldev/kord/gateway/MessagePollEventData$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/gateway/MessagePollEventData; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/gateway/MessagePollEventData; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/gateway/MessagePollEventData;)V + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/gateway/MessagePollEventData;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } diff --git a/gateway/api/gateway.klib.api b/gateway/api/gateway.klib.api index a3a0da74c31..8f40804b4f4 100644 --- a/gateway/api/gateway.klib.api +++ b/gateway/api/gateway.klib.api @@ -1562,6 +1562,76 @@ final class dev.kord.gateway/MessageDeleteBulk : dev.kord.gateway/DispatchEvent final fun toString(): kotlin/String // dev.kord.gateway/MessageDeleteBulk.toString|toString(){}[0] } +final class dev.kord.gateway/MessagePollEventData { // dev.kord.gateway/MessagePollEventData|null[0] + constructor (dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.common.entity.optional/OptionalSnowflake = ..., kotlin/Int) // dev.kord.gateway/MessagePollEventData.|(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;kotlin.Int){}[0] + + final val answerId // dev.kord.gateway/MessagePollEventData.answerId|{}answerId[0] + final fun (): kotlin/Int // dev.kord.gateway/MessagePollEventData.answerId.|(){}[0] + final val channelId // dev.kord.gateway/MessagePollEventData.channelId|{}channelId[0] + final fun (): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.channelId.|(){}[0] + final val guildId // dev.kord.gateway/MessagePollEventData.guildId|{}guildId[0] + final fun (): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.gateway/MessagePollEventData.guildId.|(){}[0] + final val messageId // dev.kord.gateway/MessagePollEventData.messageId|{}messageId[0] + final fun (): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.messageId.|(){}[0] + final val userId // dev.kord.gateway/MessagePollEventData.userId|{}userId[0] + final fun (): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.userId.|(){}[0] + + final fun component1(): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.component1|component1(){}[0] + final fun component2(): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.component2|component2(){}[0] + final fun component3(): dev.kord.common.entity/Snowflake // dev.kord.gateway/MessagePollEventData.component3|component3(){}[0] + final fun component4(): dev.kord.common.entity.optional/OptionalSnowflake // dev.kord.gateway/MessagePollEventData.component4|component4(){}[0] + final fun component5(): kotlin/Int // dev.kord.gateway/MessagePollEventData.component5|component5(){}[0] + final fun copy(dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity/Snowflake = ..., dev.kord.common.entity.optional/OptionalSnowflake = ..., kotlin/Int = ...): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollEventData.copy|copy(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.common.entity.optional.OptionalSnowflake;kotlin.Int){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.gateway/MessagePollEventData.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.gateway/MessagePollEventData.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.gateway/MessagePollEventData.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.gateway/MessagePollEventData.$serializer|null[0] + final val descriptor // dev.kord.gateway/MessagePollEventData.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.gateway/MessagePollEventData.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.gateway/MessagePollEventData.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollEventData.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.gateway/MessagePollEventData) // dev.kord.gateway/MessagePollEventData.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.gateway.MessagePollEventData){}[0] + } + + final object Companion { // dev.kord.gateway/MessagePollEventData.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.gateway/MessagePollEventData.Companion.serializer|serializer(){}[0] + } +} + +final class dev.kord.gateway/MessagePollVoteAdd : dev.kord.gateway/DispatchEvent { // dev.kord.gateway/MessagePollVoteAdd|null[0] + constructor (dev.kord.gateway/MessagePollEventData, kotlin/Int?) // dev.kord.gateway/MessagePollVoteAdd.|(dev.kord.gateway.MessagePollEventData;kotlin.Int?){}[0] + + final val data // dev.kord.gateway/MessagePollVoteAdd.data|{}data[0] + final fun (): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollVoteAdd.data.|(){}[0] + final val sequence // dev.kord.gateway/MessagePollVoteAdd.sequence|{}sequence[0] + final fun (): kotlin/Int? // dev.kord.gateway/MessagePollVoteAdd.sequence.|(){}[0] + + final fun component1(): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollVoteAdd.component1|component1(){}[0] + final fun component2(): kotlin/Int? // dev.kord.gateway/MessagePollVoteAdd.component2|component2(){}[0] + final fun copy(dev.kord.gateway/MessagePollEventData = ..., kotlin/Int? = ...): dev.kord.gateway/MessagePollVoteAdd // dev.kord.gateway/MessagePollVoteAdd.copy|copy(dev.kord.gateway.MessagePollEventData;kotlin.Int?){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.gateway/MessagePollVoteAdd.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.gateway/MessagePollVoteAdd.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.gateway/MessagePollVoteAdd.toString|toString(){}[0] +} + +final class dev.kord.gateway/MessagePollVoteRemove : dev.kord.gateway/DispatchEvent { // dev.kord.gateway/MessagePollVoteRemove|null[0] + constructor (dev.kord.gateway/MessagePollEventData, kotlin/Int?) // dev.kord.gateway/MessagePollVoteRemove.|(dev.kord.gateway.MessagePollEventData;kotlin.Int?){}[0] + + final val data // dev.kord.gateway/MessagePollVoteRemove.data|{}data[0] + final fun (): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollVoteRemove.data.|(){}[0] + final val sequence // dev.kord.gateway/MessagePollVoteRemove.sequence|{}sequence[0] + final fun (): kotlin/Int? // dev.kord.gateway/MessagePollVoteRemove.sequence.|(){}[0] + + final fun component1(): dev.kord.gateway/MessagePollEventData // dev.kord.gateway/MessagePollVoteRemove.component1|component1(){}[0] + final fun component2(): kotlin/Int? // dev.kord.gateway/MessagePollVoteRemove.component2|component2(){}[0] + final fun copy(dev.kord.gateway/MessagePollEventData = ..., kotlin/Int? = ...): dev.kord.gateway/MessagePollVoteRemove // dev.kord.gateway/MessagePollVoteRemove.copy|copy(dev.kord.gateway.MessagePollEventData;kotlin.Int?){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.gateway/MessagePollVoteRemove.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.gateway/MessagePollVoteRemove.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.gateway/MessagePollVoteRemove.toString|toString(){}[0] +} + final class dev.kord.gateway/MessageReactionAdd : dev.kord.gateway/DispatchEvent { // dev.kord.gateway/MessageReactionAdd|null[0] constructor (dev.kord.common.entity/MessageReactionAddData, kotlin/Int?) // dev.kord.gateway/MessageReactionAdd.|(dev.kord.common.entity.MessageReactionAddData;kotlin.Int?){}[0] diff --git a/rest/api/rest.api b/rest/api/rest.api index a8737e5694e..72ea1af4624 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -2157,6 +2157,33 @@ public final class dev/kord/rest/builder/message/MessageBuilderKt { public static final fun messageFlags (Ldev/kord/rest/builder/message/MessageBuilder;Lkotlin/jvm/functions/Function1;)V } +public final class dev/kord/rest/builder/message/PollBuilder : dev/kord/rest/builder/RequestBuilder { + public fun ()V + public final fun answer (Ljava/lang/String;I)V + public final fun answer (Ljava/lang/String;Ldev/kord/common/entity/Snowflake;I)V + public final fun answer (Ljava/lang/String;Ljava/lang/String;I)V + public static synthetic fun answer$default (Ldev/kord/rest/builder/message/PollBuilder;Ljava/lang/String;IILjava/lang/Object;)V + public static synthetic fun answer$default (Ldev/kord/rest/builder/message/PollBuilder;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;IILjava/lang/Object;)V + public static synthetic fun answer$default (Ldev/kord/rest/builder/message/PollBuilder;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)V + public final fun expiresIn-LRDsOJo (J)V + public final fun getAllowMultiselect ()Ljava/lang/Boolean; + public final fun getAnswers ()Ljava/util/List; + public final fun getExpiry ()Lkotlinx/datetime/Instant; + public final fun getLayoutType ()Ldev/kord/common/entity/PollLayoutType; + public final fun getQuestion ()Ldev/kord/common/entity/DiscordPoll$Media; + public final fun question (Ljava/lang/String;)V + public final fun question (Ljava/lang/String;Ldev/kord/common/entity/Snowflake;)V + public final fun question (Ljava/lang/String;Ljava/lang/String;)V + public static synthetic fun question$default (Ldev/kord/rest/builder/message/PollBuilder;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;ILjava/lang/Object;)V + public static synthetic fun question$default (Ldev/kord/rest/builder/message/PollBuilder;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)V + public final fun setAllowMultiselect (Ljava/lang/Boolean;)V + public final fun setExpiry (Lkotlinx/datetime/Instant;)V + public final fun setLayoutType (Ldev/kord/common/entity/PollLayoutType;)V + public final fun setQuestion (Ldev/kord/common/entity/DiscordPoll$Media;)V + public fun toRequest ()Ldev/kord/rest/json/request/CreatablePoll; + public synthetic fun toRequest ()Ljava/lang/Object; +} + public abstract class dev/kord/rest/builder/message/create/AbstractMessageCreateBuilder : dev/kord/rest/builder/message/create/MessageCreateBuilder { public fun addFile (Ljava/lang/String;Lio/ktor/client/request/forms/ChannelProvider;)Ldev/kord/rest/NamedFile; public final fun getAllowedMentions ()Ldev/kord/rest/builder/message/AllowedMentionsBuilder; @@ -2166,6 +2193,7 @@ public abstract class dev/kord/rest/builder/message/create/AbstractMessageCreate public final fun getEmbeds ()Ljava/util/List; public final fun getFiles ()Ljava/util/List; public final fun getFlags ()Ldev/kord/common/entity/MessageFlags; + public final fun getPoll ()Ldev/kord/rest/json/request/CreatablePoll; public final fun getSuppressEmbeds ()Ljava/lang/Boolean; public final fun getSuppressNotifications ()Ljava/lang/Boolean; public final fun getTts ()Ljava/lang/Boolean; @@ -2175,6 +2203,7 @@ public abstract class dev/kord/rest/builder/message/create/AbstractMessageCreate public final fun setContent (Ljava/lang/String;)V public final fun setEmbeds (Ljava/util/List;)V public final fun setFlags (Ldev/kord/common/entity/MessageFlags;)V + public final fun setPoll (Ldev/kord/rest/json/request/CreatablePoll;)V public final fun setSuppressEmbeds (Ljava/lang/Boolean;)V public final fun setSuppressNotifications (Ljava/lang/Boolean;)V public final fun setTts (Ljava/lang/Boolean;)V @@ -2210,9 +2239,11 @@ public final class dev/kord/rest/builder/message/create/InteractionResponseCreat public abstract interface class dev/kord/rest/builder/message/create/MessageCreateBuilder : dev/kord/rest/builder/message/MessageBuilder { public abstract fun getFlags ()Ldev/kord/common/entity/MessageFlags; + public abstract fun getPoll ()Ldev/kord/rest/json/request/CreatablePoll; public abstract fun getSuppressNotifications ()Ljava/lang/Boolean; public abstract fun getTts ()Ljava/lang/Boolean; public abstract fun setFlags (Ldev/kord/common/entity/MessageFlags;)V + public abstract fun setPoll (Ldev/kord/rest/json/request/CreatablePoll;)V public abstract fun setSuppressNotifications (Ljava/lang/Boolean;)V public abstract fun setTts (Ljava/lang/Boolean;)V } @@ -2221,6 +2252,15 @@ public final class dev/kord/rest/builder/message/create/MessageCreateBuilder$Def public static fun addFile (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Ljava/lang/String;Lio/ktor/client/request/forms/ChannelProvider;)Ldev/kord/rest/NamedFile; } +public final class dev/kord/rest/builder/message/create/MessageCreateBuilderKt { + public static final synthetic fun actionRow (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V + public static final synthetic fun allowedMentions (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun allowedMentions$default (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public static final synthetic fun embed (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V + public static final synthetic fun messageFlags (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V + public static final fun poll (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V +} + public final class dev/kord/rest/builder/message/create/UpdateMessageInteractionResponseCreateBuilder : dev/kord/rest/builder/message/create/AbstractMessageCreateBuilder, dev/kord/rest/builder/RequestBuilder { public fun ()V public fun toRequest ()Ldev/kord/rest/json/request/MultipartInteractionResponseCreateRequest; @@ -3212,6 +3252,42 @@ public final class dev/kord/rest/json/request/ChannelPositionSwapRequest$Compani public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/kord/rest/json/request/CreatablePoll { + public static final field Companion Ldev/kord/rest/json/request/CreatablePoll$Companion; + public fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/PollLayoutType;)V + public synthetic fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/PollLayoutType;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/kord/common/entity/DiscordPoll$Media; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Lkotlinx/datetime/Instant; + public final fun component4 ()Ldev/kord/common/entity/optional/Optional; + public final fun component5 ()Ldev/kord/common/entity/PollLayoutType; + public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/PollLayoutType;)Ldev/kord/rest/json/request/CreatablePoll; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/CreatablePoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/PollLayoutType;ILjava/lang/Object;)Ldev/kord/rest/json/request/CreatablePoll; + public fun equals (Ljava/lang/Object;)Z + public final fun getAllowMultiselect ()Ldev/kord/common/entity/optional/Optional; + public final fun getAnswers ()Ljava/util/List; + public final fun getExpiry ()Lkotlinx/datetime/Instant; + public final fun getLayoutType ()Ldev/kord/common/entity/PollLayoutType; + public final fun getQuestion ()Ldev/kord/common/entity/DiscordPoll$Media; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/kord/rest/json/request/CreatablePoll$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/rest/json/request/CreatablePoll$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/rest/json/request/CreatablePoll; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/rest/json/request/CreatablePoll;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/rest/json/request/CreatablePoll$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/kord/rest/json/request/CurrentUserModifyRequest { public static final field Companion Ldev/kord/rest/json/request/CurrentUserModifyRequest$Companion; public fun ()V @@ -3595,8 +3671,8 @@ public final class dev/kord/rest/json/request/EmojiModifyRequest$Companion { public final class dev/kord/rest/json/request/FollowupMessageCreateRequest { public static final field Companion Ldev/kord/rest/json/request/FollowupMessageCreateRequest$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; @@ -3604,8 +3680,9 @@ public final class dev/kord/rest/json/request/FollowupMessageCreateRequest { public final fun component5 ()Ldev/kord/common/entity/optional/Optional; public final fun component6 ()Ldev/kord/common/entity/optional/Optional; public final fun component7 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/FollowupMessageCreateRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/FollowupMessageCreateRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/FollowupMessageCreateRequest; + public final fun component8 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/FollowupMessageCreateRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/FollowupMessageCreateRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/FollowupMessageCreateRequest; public fun equals (Ljava/lang/Object;)Z public final fun getAllowedMentions ()Ldev/kord/common/entity/optional/Optional; public final fun getAttachments ()Ldev/kord/common/entity/optional/Optional; @@ -3613,6 +3690,7 @@ public final class dev/kord/rest/json/request/FollowupMessageCreateRequest { public final fun getContent ()Ldev/kord/common/entity/optional/Optional; public final fun getEmbeds ()Ldev/kord/common/entity/optional/Optional; public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getTts ()Ldev/kord/common/entity/optional/OptionalBoolean; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -3709,8 +3787,8 @@ public final class dev/kord/rest/json/request/ForumTagRequest$Companion { public final class dev/kord/rest/json/request/ForumThreadMessageRequest { public static final field Companion Ldev/kord/rest/json/request/ForumThreadMessageRequest$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; @@ -3719,8 +3797,9 @@ public final class dev/kord/rest/json/request/ForumThreadMessageRequest { public final fun component6 ()Ldev/kord/common/entity/optional/Optional; public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/ForumThreadMessageRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/ForumThreadMessageRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/ForumThreadMessageRequest; + public final fun component9 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/ForumThreadMessageRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/ForumThreadMessageRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/ForumThreadMessageRequest; public fun equals (Ljava/lang/Object;)Z public final fun getAllowedMentions ()Ldev/kord/common/entity/optional/Optional; public final fun getAttachments ()Ldev/kord/common/entity/optional/Optional; @@ -3728,6 +3807,7 @@ public final class dev/kord/rest/json/request/ForumThreadMessageRequest { public final fun getContent ()Ldev/kord/common/entity/optional/Optional; public final fun getEmbeds ()Ldev/kord/common/entity/optional/Optional; public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getStickerIds ()Ldev/kord/common/entity/optional/Optional; public final fun getTts ()Ldev/kord/common/entity/optional/OptionalBoolean; public fun hashCode ()I @@ -4595,8 +4675,8 @@ public final class dev/kord/rest/json/request/GuildWidgetModifyRequest$Companion public final class dev/kord/rest/json/request/InteractionApplicationCommandCallbackData { public static final field Companion Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component2 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; @@ -4604,8 +4684,9 @@ public final class dev/kord/rest/json/request/InteractionApplicationCommandCallb public final fun component5 ()Ldev/kord/common/entity/optional/Optional; public final fun component6 ()Ldev/kord/common/entity/optional/Optional; public final fun component7 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData; + public final fun component8 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/InteractionApplicationCommandCallbackData; public fun equals (Ljava/lang/Object;)Z public final fun getAllowedMentions ()Ldev/kord/common/entity/optional/Optional; public final fun getAttachments ()Ldev/kord/common/entity/optional/Optional; @@ -4613,6 +4694,7 @@ public final class dev/kord/rest/json/request/InteractionApplicationCommandCallb public final fun getContent ()Ldev/kord/common/entity/optional/Optional; public final fun getEmbeds ()Ldev/kord/common/entity/optional/Optional; public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getTts ()Ldev/kord/common/entity/optional/OptionalBoolean; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -4776,10 +4858,11 @@ public final class dev/kord/rest/json/request/ListThreadsByTimestampRequest { public final class dev/kord/rest/json/request/MessageCreateRequest { public static final field Companion Ldev/kord/rest/json/request/MessageCreateRequest$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/Optional; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; + public final fun component11 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun component4 ()Ldev/kord/common/entity/optional/Optional; @@ -4788,8 +4871,8 @@ public final class dev/kord/rest/json/request/MessageCreateRequest { public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/MessageCreateRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/MessageCreateRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/MessageCreateRequest; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/MessageCreateRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/MessageCreateRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/MessageCreateRequest; public fun equals (Ljava/lang/Object;)Z public final fun getAllowedMentions ()Ldev/kord/common/entity/optional/Optional; public final fun getAttachments ()Ldev/kord/common/entity/optional/Optional; @@ -4799,6 +4882,7 @@ public final class dev/kord/rest/json/request/MessageCreateRequest { public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; public final fun getMessageReference ()Ldev/kord/common/entity/optional/Optional; public final fun getNonce ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getStickerIds ()Ldev/kord/common/entity/optional/Optional; public final fun getTts ()Ldev/kord/common/entity/optional/OptionalBoolean; public fun hashCode ()I @@ -5398,11 +5482,12 @@ public final class dev/kord/rest/json/request/WebhookEditMessageRequest$Companio public final class dev/kord/rest/json/request/WebhookExecuteRequest { public static final field Companion Ldev/kord/rest/json/request/WebhookExecuteRequest$Companion; public fun ()V - public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/optional/Optional; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; public final fun component11 ()Ldev/kord/common/entity/optional/Optional; + public final fun component12 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ldev/kord/common/entity/optional/OptionalBoolean; @@ -5411,8 +5496,8 @@ public final class dev/kord/rest/json/request/WebhookExecuteRequest { public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/WebhookExecuteRequest; - public static synthetic fun copy$default (Ldev/kord/rest/json/request/WebhookExecuteRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/WebhookExecuteRequest; + public final fun copy (Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/rest/json/request/WebhookExecuteRequest; + public static synthetic fun copy$default (Ldev/kord/rest/json/request/WebhookExecuteRequest;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/rest/json/request/WebhookExecuteRequest; public fun equals (Ljava/lang/Object;)Z public final fun getAllowedMentions ()Ldev/kord/common/entity/optional/Optional; public final fun getAppliedTags ()Ldev/kord/common/entity/optional/Optional; @@ -5422,6 +5507,7 @@ public final class dev/kord/rest/json/request/WebhookExecuteRequest { public final fun getContent ()Ldev/kord/common/entity/optional/Optional; public final fun getEmbeds ()Ldev/kord/common/entity/optional/Optional; public final fun getFlags ()Ldev/kord/common/entity/optional/Optional; + public final fun getPoll ()Ldev/kord/common/entity/optional/Optional; public final fun getThreadName ()Ldev/kord/common/entity/optional/Optional; public final fun getTts ()Ldev/kord/common/entity/optional/OptionalBoolean; public final fun getUsername ()Ldev/kord/common/entity/optional/Optional; diff --git a/rest/api/rest.klib.api b/rest/api/rest.klib.api index 569a77c7fb9..f7d47d6cbe4 100644 --- a/rest/api/rest.klib.api +++ b/rest/api/rest.klib.api @@ -127,6 +127,9 @@ final enum class dev.kord.rest.json/JsonErrorCode : kotlin/Enum(): dev.kord.common.entity/MessageFlags? // dev.kord.rest.builder.message.create/MessageCreateBuilder.flags.|(){}[0] abstract fun (dev.kord.common.entity/MessageFlags?) // dev.kord.rest.builder.message.create/MessageCreateBuilder.flags.|(dev.kord.common.entity.MessageFlags?){}[0] + abstract var poll // dev.kord.rest.builder.message.create/MessageCreateBuilder.poll|{}poll[0] + abstract fun (): dev.kord.rest.json.request/CreatablePoll? // dev.kord.rest.builder.message.create/MessageCreateBuilder.poll.|(){}[0] + abstract fun (dev.kord.rest.json.request/CreatablePoll?) // dev.kord.rest.builder.message.create/MessageCreateBuilder.poll.|(dev.kord.rest.json.request.CreatablePoll?){}[0] abstract var suppressNotifications // dev.kord.rest.builder.message.create/MessageCreateBuilder.suppressNotifications|{}suppressNotifications[0] abstract fun (): kotlin/Boolean? // dev.kord.rest.builder.message.create/MessageCreateBuilder.suppressNotifications.|(){}[0] abstract fun (kotlin/Boolean?) // dev.kord.rest.builder.message.create/MessageCreateBuilder.suppressNotifications.|(kotlin.Boolean?){}[0] @@ -2700,6 +2706,35 @@ final class dev.kord.rest.builder.message/EmbedBuilder : dev.kord.rest.builder/R } } +final class dev.kord.rest.builder.message/PollBuilder : dev.kord.rest.builder/RequestBuilder { // dev.kord.rest.builder.message/PollBuilder|null[0] + constructor () // dev.kord.rest.builder.message/PollBuilder.|(){}[0] + + final val answers // dev.kord.rest.builder.message/PollBuilder.answers|{}answers[0] + final fun (): kotlin.collections/MutableList // dev.kord.rest.builder.message/PollBuilder.answers.|(){}[0] + + final var allowMultiselect // dev.kord.rest.builder.message/PollBuilder.allowMultiselect|{}allowMultiselect[0] + final fun (): kotlin/Boolean? // dev.kord.rest.builder.message/PollBuilder.allowMultiselect.|(){}[0] + final fun (kotlin/Boolean?) // dev.kord.rest.builder.message/PollBuilder.allowMultiselect.|(kotlin.Boolean?){}[0] + final var expiry // dev.kord.rest.builder.message/PollBuilder.expiry|{}expiry[0] + final fun (): kotlinx.datetime/Instant? // dev.kord.rest.builder.message/PollBuilder.expiry.|(){}[0] + final fun (kotlinx.datetime/Instant?) // dev.kord.rest.builder.message/PollBuilder.expiry.|(kotlinx.datetime.Instant?){}[0] + final var layoutType // dev.kord.rest.builder.message/PollBuilder.layoutType|{}layoutType[0] + final fun (): dev.kord.common.entity/PollLayoutType // dev.kord.rest.builder.message/PollBuilder.layoutType.|(){}[0] + final fun (dev.kord.common.entity/PollLayoutType) // dev.kord.rest.builder.message/PollBuilder.layoutType.|(dev.kord.common.entity.PollLayoutType){}[0] + final var question // dev.kord.rest.builder.message/PollBuilder.question|{}question[0] + final fun (): dev.kord.common.entity/DiscordPoll.Media? // dev.kord.rest.builder.message/PollBuilder.question.|(){}[0] + final fun (dev.kord.common.entity/DiscordPoll.Media?) // dev.kord.rest.builder.message/PollBuilder.question.|(dev.kord.common.entity.DiscordPoll.Media?){}[0] + + final fun answer(kotlin/String, dev.kord.common.entity/Snowflake? = ..., kotlin/Int = ...) // dev.kord.rest.builder.message/PollBuilder.answer|answer(kotlin.String;dev.kord.common.entity.Snowflake?;kotlin.Int){}[0] + final fun answer(kotlin/String, kotlin/Int = ...) // dev.kord.rest.builder.message/PollBuilder.answer|answer(kotlin.String;kotlin.Int){}[0] + final fun answer(kotlin/String, kotlin/String? = ..., kotlin/Int = ...) // dev.kord.rest.builder.message/PollBuilder.answer|answer(kotlin.String;kotlin.String?;kotlin.Int){}[0] + final fun expiresIn(kotlin.time/Duration) // dev.kord.rest.builder.message/PollBuilder.expiresIn|expiresIn(kotlin.time.Duration){}[0] + final fun question(kotlin/String) // dev.kord.rest.builder.message/PollBuilder.question|question(kotlin.String){}[0] + final fun question(kotlin/String, dev.kord.common.entity/Snowflake? = ...) // dev.kord.rest.builder.message/PollBuilder.question|question(kotlin.String;dev.kord.common.entity.Snowflake?){}[0] + final fun question(kotlin/String, kotlin/String? = ...) // dev.kord.rest.builder.message/PollBuilder.question|question(kotlin.String;kotlin.String?){}[0] + final fun toRequest(): dev.kord.rest.json.request/CreatablePoll // dev.kord.rest.builder.message/PollBuilder.toRequest|toRequest(){}[0] +} + final class dev.kord.rest.builder.role/RoleCreateBuilder : dev.kord.rest.builder/AuditRequestBuilder { // dev.kord.rest.builder.role/RoleCreateBuilder|null[0] constructor () // dev.kord.rest.builder.role/RoleCreateBuilder.|(){}[0] @@ -3510,6 +3545,46 @@ final class dev.kord.rest.json.request/ChannelPositionSwapRequest { // dev.kord. } } +final class dev.kord.rest.json.request/CreatablePoll { // dev.kord.rest.json.request/CreatablePoll|null[0] + constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType) // dev.kord.rest.json.request/CreatablePoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] + + final val allowMultiselect // dev.kord.rest.json.request/CreatablePoll.allowMultiselect|{}allowMultiselect[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/CreatablePoll.allowMultiselect.|(){}[0] + final val answers // dev.kord.rest.json.request/CreatablePoll.answers|{}answers[0] + final fun (): kotlin.collections/List // dev.kord.rest.json.request/CreatablePoll.answers.|(){}[0] + final val expiry // dev.kord.rest.json.request/CreatablePoll.expiry|{}expiry[0] + final fun (): kotlinx.datetime/Instant // dev.kord.rest.json.request/CreatablePoll.expiry.|(){}[0] + final val layoutType // dev.kord.rest.json.request/CreatablePoll.layoutType|{}layoutType[0] + final fun (): dev.kord.common.entity/PollLayoutType // dev.kord.rest.json.request/CreatablePoll.layoutType.|(){}[0] + final val question // dev.kord.rest.json.request/CreatablePoll.question|{}question[0] + final fun (): dev.kord.common.entity/DiscordPoll.Media // dev.kord.rest.json.request/CreatablePoll.question.|(){}[0] + + final fun component1(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.rest.json.request/CreatablePoll.component1|component1(){}[0] + final fun component2(): kotlin.collections/List // dev.kord.rest.json.request/CreatablePoll.component2|component2(){}[0] + final fun component3(): kotlinx.datetime/Instant // dev.kord.rest.json.request/CreatablePoll.component3|component3(){}[0] + final fun component4(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/CreatablePoll.component4|component4(){}[0] + final fun component5(): dev.kord.common.entity/PollLayoutType // dev.kord.rest.json.request/CreatablePoll.component5|component5(){}[0] + final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType = ...): dev.kord.rest.json.request/CreatablePoll // dev.kord.rest.json.request/CreatablePoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/CreatablePoll.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/CreatablePoll.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.rest.json.request/CreatablePoll.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.rest.json.request/CreatablePoll.$serializer|null[0] + final val descriptor // dev.kord.rest.json.request/CreatablePoll.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.rest.json.request/CreatablePoll.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.rest.json.request/CreatablePoll.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.rest.json.request/CreatablePoll // dev.kord.rest.json.request/CreatablePoll.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.rest.json.request/CreatablePoll) // dev.kord.rest.json.request/CreatablePoll.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.rest.json.request.CreatablePoll){}[0] + } + + final object Companion { // dev.kord.rest.json.request/CreatablePoll.Companion|null[0] + final val $childSerializers // dev.kord.rest.json.request/CreatablePoll.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.rest.json.request/CreatablePoll.Companion.serializer|serializer(){}[0] + } +} + final class dev.kord.rest.json.request/CurrentUserModifyRequest { // dev.kord.rest.json.request/CurrentUserModifyRequest|null[0] constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/CurrentUserModifyRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] @@ -3900,7 +3975,7 @@ final class dev.kord.rest.json.request/EmojiModifyRequest { // dev.kord.rest.jso } final class dev.kord.rest.json.request/FollowupMessageCreateRequest { // dev.kord.rest.json.request/FollowupMessageCreateRequest|null[0] - constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/FollowupMessageCreateRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/FollowupMessageCreateRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final val allowedMentions // dev.kord.rest.json.request/FollowupMessageCreateRequest.allowedMentions|{}allowedMentions[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/FollowupMessageCreateRequest.allowedMentions.|(){}[0] @@ -3914,6 +3989,8 @@ final class dev.kord.rest.json.request/FollowupMessageCreateRequest { // dev.kor final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/FollowupMessageCreateRequest.embeds.|(){}[0] final val flags // dev.kord.rest.json.request/FollowupMessageCreateRequest.flags|{}flags[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/FollowupMessageCreateRequest.flags.|(){}[0] + final val poll // dev.kord.rest.json.request/FollowupMessageCreateRequest.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/FollowupMessageCreateRequest.poll.|(){}[0] final val tts // dev.kord.rest.json.request/FollowupMessageCreateRequest.tts|{}tts[0] final fun (): dev.kord.common.entity.optional/OptionalBoolean // dev.kord.rest.json.request/FollowupMessageCreateRequest.tts.|(){}[0] @@ -3924,7 +4001,8 @@ final class dev.kord.rest.json.request/FollowupMessageCreateRequest { // dev.kor final fun component5(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/FollowupMessageCreateRequest.component5|component5(){}[0] final fun component6(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/FollowupMessageCreateRequest.component6|component6(){}[0] final fun component7(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/FollowupMessageCreateRequest.component7|component7(){}[0] - final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/FollowupMessageCreateRequest // dev.kord.rest.json.request/FollowupMessageCreateRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + final fun component8(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/FollowupMessageCreateRequest.component8|component8(){}[0] + final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/FollowupMessageCreateRequest // dev.kord.rest.json.request/FollowupMessageCreateRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/FollowupMessageCreateRequest.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/FollowupMessageCreateRequest.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/FollowupMessageCreateRequest.toString|toString(){}[0] @@ -4026,7 +4104,7 @@ final class dev.kord.rest.json.request/ForumTagRequest { // dev.kord.rest.json.r } final class dev.kord.rest.json.request/ForumThreadMessageRequest { // dev.kord.rest.json.request/ForumThreadMessageRequest|null[0] - constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/ForumThreadMessageRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/ForumThreadMessageRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final val allowedMentions // dev.kord.rest.json.request/ForumThreadMessageRequest.allowedMentions|{}allowedMentions[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/ForumThreadMessageRequest.allowedMentions.|(){}[0] @@ -4040,6 +4118,8 @@ final class dev.kord.rest.json.request/ForumThreadMessageRequest { // dev.kord.r final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/ForumThreadMessageRequest.embeds.|(){}[0] final val flags // dev.kord.rest.json.request/ForumThreadMessageRequest.flags|{}flags[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/ForumThreadMessageRequest.flags.|(){}[0] + final val poll // dev.kord.rest.json.request/ForumThreadMessageRequest.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/ForumThreadMessageRequest.poll.|(){}[0] final val stickerIds // dev.kord.rest.json.request/ForumThreadMessageRequest.stickerIds|{}stickerIds[0] final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/ForumThreadMessageRequest.stickerIds.|(){}[0] final val tts // dev.kord.rest.json.request/ForumThreadMessageRequest.tts|{}tts[0] @@ -4053,7 +4133,8 @@ final class dev.kord.rest.json.request/ForumThreadMessageRequest { // dev.kord.r final fun component6(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/ForumThreadMessageRequest.component6|component6(){}[0] final fun component7(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/ForumThreadMessageRequest.component7|component7(){}[0] final fun component8(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/ForumThreadMessageRequest.component8|component8(){}[0] - final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/ForumThreadMessageRequest // dev.kord.rest.json.request/ForumThreadMessageRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + final fun component9(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/ForumThreadMessageRequest.component9|component9(){}[0] + final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/ForumThreadMessageRequest // dev.kord.rest.json.request/ForumThreadMessageRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/ForumThreadMessageRequest.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/ForumThreadMessageRequest.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/ForumThreadMessageRequest.toString|toString(){}[0] @@ -4999,7 +5080,7 @@ final class dev.kord.rest.json.request/GuildWidgetModifyRequest { // dev.kord.re } final class dev.kord.rest.json.request/InteractionApplicationCommandCallbackData { // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData|null[0] - constructor (dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ...) // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.|(dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>){}[0] + constructor (dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.|(dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final val allowedMentions // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.allowedMentions|{}allowedMentions[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.allowedMentions.|(){}[0] @@ -5013,6 +5094,8 @@ final class dev.kord.rest.json.request/InteractionApplicationCommandCallbackData final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.embeds.|(){}[0] final val flags // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.flags|{}flags[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.flags.|(){}[0] + final val poll // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.poll.|(){}[0] final val tts // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.tts|{}tts[0] final fun (): dev.kord.common.entity.optional/OptionalBoolean // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.tts.|(){}[0] @@ -5023,7 +5106,8 @@ final class dev.kord.rest.json.request/InteractionApplicationCommandCallbackData final fun component5(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.component5|component5(){}[0] final fun component6(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.component6|component6(){}[0] final fun component7(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.component7|component7(){}[0] - final fun copy(dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ...): dev.kord.rest.json.request/InteractionApplicationCommandCallbackData // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.copy|copy(dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>){}[0] + final fun component8(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.component8|component8(){}[0] + final fun copy(dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/InteractionApplicationCommandCallbackData // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.copy|copy(dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/InteractionApplicationCommandCallbackData.toString|toString(){}[0] @@ -5197,7 +5281,7 @@ final class dev.kord.rest.json.request/ListThreadsByTimestampRequest { // dev.ko } final class dev.kord.rest.json.request/MessageCreateRequest { // dev.kord.rest.json.request/MessageCreateRequest|null[0] - constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/MessageCreateRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/MessageCreateRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final val allowedMentions // dev.kord.rest.json.request/MessageCreateRequest.allowedMentions|{}allowedMentions[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.allowedMentions.|(){}[0] @@ -5215,6 +5299,8 @@ final class dev.kord.rest.json.request/MessageCreateRequest { // dev.kord.rest.j final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.messageReference.|(){}[0] final val nonce // dev.kord.rest.json.request/MessageCreateRequest.nonce|{}nonce[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.nonce.|(){}[0] + final val poll // dev.kord.rest.json.request/MessageCreateRequest.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.poll.|(){}[0] final val stickerIds // dev.kord.rest.json.request/MessageCreateRequest.stickerIds|{}stickerIds[0] final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/MessageCreateRequest.stickerIds.|(){}[0] final val tts // dev.kord.rest.json.request/MessageCreateRequest.tts|{}tts[0] @@ -5222,6 +5308,7 @@ final class dev.kord.rest.json.request/MessageCreateRequest { // dev.kord.rest.j final fun component1(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.component1|component1(){}[0] final fun component10(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.component10|component10(){}[0] + final fun component11(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.component11|component11(){}[0] final fun component2(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/MessageCreateRequest.component2|component2(){}[0] final fun component3(): dev.kord.common.entity.optional/OptionalBoolean // dev.kord.rest.json.request/MessageCreateRequest.component3|component3(){}[0] final fun component4(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/MessageCreateRequest.component4|component4(){}[0] @@ -5230,7 +5317,7 @@ final class dev.kord.rest.json.request/MessageCreateRequest { // dev.kord.rest.j final fun component7(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/MessageCreateRequest.component7|component7(){}[0] final fun component8(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/MessageCreateRequest.component8|component8(){}[0] final fun component9(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/MessageCreateRequest.component9|component9(){}[0] - final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/MessageCreateRequest // dev.kord.rest.json.request/MessageCreateRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] + final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/MessageCreateRequest // dev.kord.rest.json.request/MessageCreateRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/MessageCreateRequest.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/MessageCreateRequest.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/MessageCreateRequest.toString|toString(){}[0] @@ -5887,7 +5974,7 @@ final class dev.kord.rest.json.request/WebhookEditMessageRequest { // dev.kord.r } final class dev.kord.rest.json.request/WebhookExecuteRequest { // dev.kord.rest.json.request/WebhookExecuteRequest|null[0] - constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ...) // dev.kord.rest.json.request/WebhookExecuteRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>){}[0] + constructor (dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...) // dev.kord.rest.json.request/WebhookExecuteRequest.|(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final val allowedMentions // dev.kord.rest.json.request/WebhookExecuteRequest.allowedMentions|{}allowedMentions[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.allowedMentions.|(){}[0] @@ -5905,6 +5992,8 @@ final class dev.kord.rest.json.request/WebhookExecuteRequest { // dev.kord.rest. final fun (): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/WebhookExecuteRequest.embeds.|(){}[0] final val flags // dev.kord.rest.json.request/WebhookExecuteRequest.flags|{}flags[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.flags.|(){}[0] + final val poll // dev.kord.rest.json.request/WebhookExecuteRequest.poll|{}poll[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.poll.|(){}[0] final val threadName // dev.kord.rest.json.request/WebhookExecuteRequest.threadName|{}threadName[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.threadName.|(){}[0] final val tts // dev.kord.rest.json.request/WebhookExecuteRequest.tts|{}tts[0] @@ -5915,6 +6004,7 @@ final class dev.kord.rest.json.request/WebhookExecuteRequest { // dev.kord.rest. final fun component1(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component1|component1(){}[0] final fun component10(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component10|component10(){}[0] final fun component11(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/WebhookExecuteRequest.component11|component11(){}[0] + final fun component12(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component12|component12(){}[0] final fun component2(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component2|component2(){}[0] final fun component3(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component3|component3(){}[0] final fun component4(): dev.kord.common.entity.optional/OptionalBoolean // dev.kord.rest.json.request/WebhookExecuteRequest.component4|component4(){}[0] @@ -5923,7 +6013,7 @@ final class dev.kord.rest.json.request/WebhookExecuteRequest { // dev.kord.rest. final fun component7(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/WebhookExecuteRequest.component7|component7(){}[0] final fun component8(): dev.kord.common.entity.optional/Optional> // dev.kord.rest.json.request/WebhookExecuteRequest.component8|component8(){}[0] final fun component9(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/WebhookExecuteRequest.component9|component9(){}[0] - final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ...): dev.kord.rest.json.request/WebhookExecuteRequest // dev.kord.rest.json.request/WebhookExecuteRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>){}[0] + final fun copy(dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/OptionalBoolean = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity.optional/Optional> = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.rest.json.request/WebhookExecuteRequest // dev.kord.rest.json.request/WebhookExecuteRequest.copy|copy(dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.OptionalBoolean;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.optional.Optional>;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/WebhookExecuteRequest.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/WebhookExecuteRequest.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/WebhookExecuteRequest.toString|toString(){}[0] @@ -6561,12 +6651,14 @@ final class dev.kord.rest.service/ChannelService : dev.kord.rest.service/RestSer final suspend fun editMessage(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.rest.json.request/MessageEditPatchRequest): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.editMessage|editMessage(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.rest.json.request.MessageEditPatchRequest){}[0] final suspend fun editMessage(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.rest.json.request/MultipartMessagePatchRequest): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.editMessage|editMessage(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.rest.json.request.MultipartMessagePatchRequest){}[0] final suspend fun editMessage(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, dev.kord.rest.json.request/MultipartWebhookEditMessageRequest): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.editMessage|editMessage(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;dev.kord.rest.json.request.MultipartWebhookEditMessageRequest){}[0] + final suspend fun expirePoll(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.expirePoll|expirePoll(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake){}[0] final suspend fun followNewsChannel(dev.kord.common.entity/Snowflake, dev.kord.rest.json.request/ChannelFollowRequest): dev.kord.rest.json.response/FollowedChannelResponse // dev.kord.rest.service/ChannelService.followNewsChannel|followNewsChannel(dev.kord.common.entity.Snowflake;dev.kord.rest.json.request.ChannelFollowRequest){}[0] final suspend fun getChannel(dev.kord.common.entity/Snowflake): dev.kord.common.entity/DiscordChannel // dev.kord.rest.service/ChannelService.getChannel|getChannel(dev.kord.common.entity.Snowflake){}[0] final suspend fun getChannelInvites(dev.kord.common.entity/Snowflake): kotlin.collections/List // dev.kord.rest.service/ChannelService.getChannelInvites|getChannelInvites(dev.kord.common.entity.Snowflake){}[0] final suspend fun getChannelPins(dev.kord.common.entity/Snowflake): kotlin.collections/List // dev.kord.rest.service/ChannelService.getChannelPins|getChannelPins(dev.kord.common.entity.Snowflake){}[0] final suspend fun getMessage(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.getMessage|getMessage(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake){}[0] final suspend fun getMessages(dev.kord.common.entity/Snowflake, dev.kord.rest.route/Position? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getMessages|getMessages(dev.kord.common.entity.Snowflake;dev.kord.rest.route.Position?;kotlin.Int?){}[0] + final suspend fun getPollUsersByAnswer(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, kotlin/Int, dev.kord.common.entity/Snowflake? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getPollUsersByAnswer|getPollUsersByAnswer(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;kotlin.Int;dev.kord.common.entity.Snowflake?;kotlin.Int?){}[0] final suspend fun getReactions(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, kotlin/String, dev.kord.rest.route/Position.After? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getReactions|getReactions(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;kotlin.String;dev.kord.rest.route.Position.After?;kotlin.Int?){}[0] final suspend fun joinThread(dev.kord.common.entity/Snowflake) // dev.kord.rest.service/ChannelService.joinThread|joinThread(dev.kord.common.entity.Snowflake){}[0] final suspend fun leaveThread(dev.kord.common.entity/Snowflake) // dev.kord.rest.service/ChannelService.leaveThread|leaveThread(dev.kord.common.entity.Snowflake){}[0] @@ -7115,6 +7207,8 @@ sealed class <#A: kotlin/Any?> dev.kord.rest.route/Route { // dev.kord.rest.rout final object GatewayGet : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GatewayGet|null[0] + final object GetVoteAnswer : dev.kord.rest.route/Route> // dev.kord.rest.route/Route.GetVoteAnswer|null[0] + final object GetWebhookMessage : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GetWebhookMessage|null[0] final object GlobalApplicationCommandCreate : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GlobalApplicationCommandCreate|null[0] @@ -7335,6 +7429,10 @@ sealed class <#A: kotlin/Any?> dev.kord.rest.route/Route { // dev.kord.rest.rout final object PinsGet : dev.kord.rest.route/Route> // dev.kord.rest.route/Route.PinsGet|null[0] + final object PollAnswerId : dev.kord.rest.route/Route.Key // dev.kord.rest.route/Route.PollAnswerId|null[0] + + final object PostExpirePoll : dev.kord.rest.route/Route // dev.kord.rest.route/Route.PostExpirePoll|null[0] + final object PrivateArchivedThreadsGet : dev.kord.rest.route/Route // dev.kord.rest.route/Route.PrivateArchivedThreadsGet|null[0] final object PrivateThreadsGet : dev.kord.rest.route/Route // dev.kord.rest.route/Route.PrivateThreadsGet|null[0] @@ -7645,6 +7743,9 @@ sealed class dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder : final var flags // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.flags|{}flags[0] final fun (): dev.kord.common.entity/MessageFlags? // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.flags.|(){}[0] final fun (dev.kord.common.entity/MessageFlags?) // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.flags.|(dev.kord.common.entity.MessageFlags?){}[0] + final var poll // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.poll|{}poll[0] + final fun (): dev.kord.rest.json.request/CreatablePoll? // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.poll.|(){}[0] + final fun (dev.kord.rest.json.request/CreatablePoll?) // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.poll.|(dev.kord.rest.json.request.CreatablePoll?){}[0] final var suppressEmbeds // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.suppressEmbeds|{}suppressEmbeds[0] final fun (): kotlin/Boolean? // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.suppressEmbeds.|(){}[0] final fun (kotlin/Boolean?) // dev.kord.rest.builder.message.create/AbstractMessageCreateBuilder.suppressEmbeds.|(kotlin.Boolean?){}[0] @@ -7895,6 +7996,11 @@ final inline fun (dev.kord.rest.builder.interaction/MultiApplicationCommandBuild final inline fun (dev.kord.rest.builder.interaction/MultiApplicationCommandBuilder).dev.kord.rest.builder.interaction/user(kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/user|user@dev.kord.rest.builder.interaction.MultiApplicationCommandBuilder(kotlin.String;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.interaction/RootInputChatBuilder).dev.kord.rest.builder.interaction/group(kotlin/String, kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/group|group@dev.kord.rest.builder.interaction.RootInputChatBuilder(kotlin.String;kotlin.String;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.interaction/RootInputChatBuilder).dev.kord.rest.builder.interaction/subCommand(kotlin/String, kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/subCommand|subCommand@dev.kord.rest.builder.interaction.RootInputChatBuilder(kotlin.String;kotlin.String;kotlin.Function1){}[0] +final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/actionRow(kotlin/Function1) // dev.kord.rest.builder.message.create/actionRow|actionRow@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] +final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/allowedMentions(kotlin/Function1 = ...) // dev.kord.rest.builder.message.create/allowedMentions|allowedMentions@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] +final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/embed(kotlin/Function1) // dev.kord.rest.builder.message.create/embed|embed@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] +final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/messageFlags(kotlin/Function1) // dev.kord.rest.builder.message.create/messageFlags|messageFlags@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] +final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/poll(kotlin/Function1) // dev.kord.rest.builder.message.create/poll|poll@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message.modify/MessageModifyBuilder).dev.kord.rest.builder.message.modify/keepAttachment(dev.kord.common.entity/Snowflake, kotlin/Function1 = ...) // dev.kord.rest.builder.message.modify/keepAttachment|keepAttachment@dev.kord.rest.builder.message.modify.MessageModifyBuilder(dev.kord.common.entity.Snowflake;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message/MessageBuilder).dev.kord.rest.builder.message/actionRow(kotlin/Function1) // dev.kord.rest.builder.message/actionRow|actionRow@dev.kord.rest.builder.message.MessageBuilder(kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message/MessageBuilder).dev.kord.rest.builder.message/addFile(kotlin/String, io.ktor.client.request.forms/ChannelProvider, kotlin/Function1): dev.kord.rest/NamedFile // dev.kord.rest.builder.message/addFile|addFile@dev.kord.rest.builder.message.MessageBuilder(kotlin.String;io.ktor.client.request.forms.ChannelProvider;kotlin.Function1){}[0] diff --git a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt index 87d1cbb67dd..b24b916db10 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt @@ -1,6 +1,7 @@ package dev.kord.rest.builder.message.create import dev.kord.common.annotation.KordDsl +import dev.kord.common.annotation.KordUnsafe import dev.kord.rest.json.request.CreatablePoll import dev.kord.common.entity.DiscordPoll import dev.kord.common.entity.MessageFlag From 2a306cd0fe133ef5c6bc89c3e43373649b1cfc44 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 25 Aug 2024 13:12:16 +0200 Subject: [PATCH 18/26] Add PollBehavior --- core/api/core.api | 35 ++++++++++++++++++- core/api/core.klib.api | 7 +++- .../kotlin/behavior/MessageBehavior.kt | 29 +++++++++++++-- core/src/commonMain/kotlin/entity/Message.kt | 3 +- core/src/jvmTest/kotlin/rest/RestTest.kt | 16 +++++++++ 5 files changed, 85 insertions(+), 5 deletions(-) diff --git a/core/api/core.api b/core/api/core.api index 0c369518656..61fa8784427 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -641,6 +641,37 @@ public final class dev/kord/core/behavior/MessageCommandBehavior$DefaultImpls { public static fun compareTo (Ldev/kord/core/behavior/MessageCommandBehavior;Ldev/kord/core/entity/Entity;)I } +public abstract interface class dev/kord/core/behavior/PollBehavior : dev/kord/core/behavior/MessageBehavior { + public abstract fun end (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getAnswerVoters (ILkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class dev/kord/core/behavior/PollBehavior$DefaultImpls { + public static fun addReaction (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun addReaction (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun asMessage (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun asMessageOrNull (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun compareTo (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/Entity;)I + public static fun delete (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun delete (Ldev/kord/core/behavior/PollBehavior;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteAllReactions (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteOwnReaction (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteReaction (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun deleteReaction (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun end (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchMessage (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun fetchMessageOrNull (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getAnswerVoters (Ldev/kord/core/behavior/PollBehavior;ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getChannel (Ldev/kord/core/behavior/PollBehavior;)Ldev/kord/core/behavior/channel/MessageChannelBehavior; + public static fun getChannel (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getChannelOrNull (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun getReactors (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/entity/ReactionEmoji;)Lkotlinx/coroutines/flow/Flow; + public static fun pin (Ldev/kord/core/behavior/PollBehavior;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun publish (Ldev/kord/core/behavior/PollBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun unpin (Ldev/kord/core/behavior/PollBehavior;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static fun withStrategy (Ldev/kord/core/behavior/PollBehavior;Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/MessageBehavior; +} + public abstract interface class dev/kord/core/behavior/RoleBehavior : dev/kord/core/entity/KordEntity, dev/kord/core/entity/Strategizable { public abstract fun asRole (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun asRoleOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6922,7 +6953,7 @@ public final class dev/kord/core/entity/PermissionOverwriteEntity : dev/kord/cor public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; } -public final class dev/kord/core/entity/Poll : dev/kord/core/entity/Message { +public final class dev/kord/core/entity/Poll : dev/kord/core/behavior/PollBehavior, dev/kord/core/entity/Message { public fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V public synthetic fun (Ldev/kord/core/cache/data/MessageData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun addReaction (Ldev/kord/core/entity/GuildEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6937,10 +6968,12 @@ public final class dev/kord/core/entity/Poll : dev/kord/core/entity/Message { public fun deleteOwnReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun deleteReaction (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun deleteReaction (Ldev/kord/core/entity/ReactionEmoji;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun end (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z public fun fetchMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun fetchMessageOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getActionRows ()Ljava/util/List; + public fun getAnswerVoters (ILkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getApplicationId ()Ldev/kord/common/entity/Snowflake; public fun getAttachments ()Ljava/util/Set; public fun getAuthor ()Ldev/kord/core/entity/User; diff --git a/core/api/core.klib.api b/core/api/core.klib.api index 77150c7d21c..078c2ac70c7 100644 --- a/core/api/core.klib.api +++ b/core/api/core.klib.api @@ -625,6 +625,11 @@ abstract interface dev.kord.core.behavior/MessageCommandBehavior : dev.kord.core abstract suspend fun edit(kotlin.coroutines/SuspendFunction1): dev.kord.core.entity.application/MessageCommand // dev.kord.core.behavior/MessageCommandBehavior.edit|edit(kotlin.coroutines.SuspendFunction1){}[0] } +abstract interface dev.kord.core.behavior/PollBehavior : dev.kord.core.behavior/MessageBehavior { // dev.kord.core.behavior/PollBehavior|null[0] + open suspend fun end(): dev.kord.core.entity/Poll // dev.kord.core.behavior/PollBehavior.end|end(){}[0] + open suspend fun getAnswerVoters(kotlin/Int): kotlin.collections/List // dev.kord.core.behavior/PollBehavior.getAnswerVoters|getAnswerVoters(kotlin.Int){}[0] +} + abstract interface dev.kord.core.behavior/RoleBehavior : dev.kord.core.entity/KordEntity, dev.kord.core.entity/Strategizable { // dev.kord.core.behavior/RoleBehavior|null[0] abstract val guildId // dev.kord.core.behavior/RoleBehavior.guildId|{}guildId[0] abstract fun (): dev.kord.common.entity/Snowflake // dev.kord.core.behavior/RoleBehavior.guildId.|(){}[0] @@ -8081,7 +8086,7 @@ final class dev.kord.core.entity/PermissionOverwriteEntity : dev.kord.core.entit final suspend fun getGuildOrNull(): dev.kord.core.entity/Guild? // dev.kord.core.entity/PermissionOverwriteEntity.getGuildOrNull|getGuildOrNull(){}[0] } -final class dev.kord.core.entity/Poll : dev.kord.core.entity/Message { // dev.kord.core.entity/Poll|null[0] +final class dev.kord.core.entity/Poll : dev.kord.core.behavior/PollBehavior, dev.kord.core.entity/Message { // dev.kord.core.entity/Poll|null[0] constructor (dev.kord.core.cache.data/MessageData, dev.kord.core/Kord, dev.kord.core.supplier/EntitySupplier = ...) // dev.kord.core.entity/Poll.|(dev.kord.core.cache.data.MessageData;dev.kord.core.Kord;dev.kord.core.supplier.EntitySupplier){}[0] final val data // dev.kord.core.entity/Poll.data|{}data[0] diff --git a/core/src/commonMain/kotlin/behavior/MessageBehavior.kt b/core/src/commonMain/kotlin/behavior/MessageBehavior.kt index fbf1b2e01ce..04db07f517b 100644 --- a/core/src/commonMain/kotlin/behavior/MessageBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/MessageBehavior.kt @@ -1,15 +1,16 @@ package dev.kord.core.behavior -import dev.kord.common.entity.Permission import dev.kord.common.entity.Snowflake import dev.kord.common.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.channel.MessageChannelBehavior import dev.kord.core.behavior.channel.createMessage import dev.kord.core.cache.data.MessageData +import dev.kord.core.cache.data.UserData import dev.kord.core.entity.* import dev.kord.core.entity.channel.MessageChannel import dev.kord.core.exception.EntityNotFoundException +import dev.kord.core.hash import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.core.supplier.getChannelOf @@ -20,7 +21,6 @@ import dev.kord.rest.builder.message.modify.WebhookMessageModifyBuilder import dev.kord.rest.request.RestRequestException import dev.kord.rest.service.RestClient import kotlinx.coroutines.flow.Flow -import dev.kord.core.hash import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -215,7 +215,32 @@ public interface MessageBehavior : KordEntity, Strategizable { override fun withStrategy( strategy: EntitySupplyStrategy<*>, ): MessageBehavior = MessageBehavior(channelId, id, kord, strategy) +} + +/** + * Behavior of a Poll message. + */ +public interface PollBehavior : MessageBehavior { + + /** + * Retrieves the voters who voted for the specified [answer][answerId]. + */ + public suspend fun getAnswerVoters(answerId: Int): List = + kord.rest.channel.getPollUsersByAnswer(channelId, id, answerId).map { + val data = UserData.from(it) + User(data, kord, supplier) + } + + /** + * Ends this poll. + */ + public suspend fun end(): Poll { + val message = kord.rest.channel.expirePoll(channelId, id) + val data = MessageData.from(message) + + return Message(data, kord, supplier) as Poll + } } public fun MessageBehavior( diff --git a/core/src/commonMain/kotlin/entity/Message.kt b/core/src/commonMain/kotlin/entity/Message.kt index 6811afedd1d..78795b96c6b 100644 --- a/core/src/commonMain/kotlin/entity/Message.kt +++ b/core/src/commonMain/kotlin/entity/Message.kt @@ -6,6 +6,7 @@ import dev.kord.common.entity.optional.* import dev.kord.common.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.MessageBehavior +import dev.kord.core.behavior.PollBehavior import dev.kord.core.behavior.UserBehavior import dev.kord.core.behavior.channel.ChannelBehavior import dev.kord.core.behavior.interaction.response.InteractionResponseBehavior @@ -369,7 +370,7 @@ public class Poll( override val data: MessageData, override val kord: Kord, override val supplier: EntitySupplier = kord.defaultSupplier, -) : Message { +) : Message, PollBehavior { /** * The [poll][DiscordPoll]. */ diff --git a/core/src/jvmTest/kotlin/rest/RestTest.kt b/core/src/jvmTest/kotlin/rest/RestTest.kt index dac8135d779..afe37f0b6fa 100644 --- a/core/src/jvmTest/kotlin/rest/RestTest.kt +++ b/core/src/jvmTest/kotlin/rest/RestTest.kt @@ -1,6 +1,7 @@ package dev.kord.core.rest import dev.kord.common.Color +import dev.kord.common.annotation.KordUnsafe import dev.kord.common.entity.* import dev.kord.core.Kord import dev.kord.core.behavior.* @@ -21,6 +22,7 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.toList import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.* import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable import kotlin.io.path.toPath @@ -535,6 +537,20 @@ class RestServiceTest { } + @OptIn(KordUnsafe::class) + @Test + @Order(29) + fun `poll in channel`() = runTest { + val poll = channel.createPoll { + question("Is Kord great?") + answer("Yes") + answer("no") + } + + assertEquals(emptyList(), poll.getAnswerVoters(1)) + poll.end() + } + @Test @Order(Int.MAX_VALUE - 2) fun `delete channel`(): Unit = runBlocking { From 274cf12a0c269e7ca220e0c0a8c0fc80bb19a55e Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Sun, 25 Aug 2024 13:24:44 +0200 Subject: [PATCH 19/26] No longer require expires --- rest/src/commonMain/kotlin/builder/message/PollBuilder.kt | 4 ++-- rest/src/commonMain/kotlin/json/request/MessageRequests.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt index 49658159b51..2175204218f 100644 --- a/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt @@ -1,7 +1,6 @@ package dev.kord.rest.builder.message import dev.kord.common.annotation.KordDsl -import dev.kord.rest.json.request.CreatablePoll import dev.kord.common.entity.DiscordPartialEmoji import dev.kord.common.entity.DiscordPoll import dev.kord.common.entity.PollLayoutType @@ -10,6 +9,7 @@ import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.coerceToMissing import dev.kord.common.entity.optional.delegate.delegate import dev.kord.rest.builder.RequestBuilder +import dev.kord.rest.json.request.CreatablePoll import kotlinx.datetime.Clock import kotlinx.datetime.Instant import kotlin.time.Duration @@ -115,7 +115,7 @@ public class PollBuilder : RequestBuilder { override fun toRequest(): CreatablePoll = CreatablePoll( question ?: error("Please set a question"), answers, - expiry ?: error("Please set an expiry"), + expiry, _allowMultiselect, layoutType ) diff --git a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt index a4521642529..ba03cd81b00 100644 --- a/rest/src/commonMain/kotlin/json/request/MessageRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/MessageRequests.kt @@ -126,7 +126,7 @@ public data class MultipartForumThreadMessageCreateRequest( public data class CreatablePoll( val question: DiscordPoll.Media, val answers: List, - val expiry: Instant, + val expiry: Instant?, @SerialName("allow_multiselect") val allowMultiselect: Optional = Optional.Missing(), @SerialName("layout_type") From 164203b44dce278f0b55b2458503097cc0f86757 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Mon, 2 Sep 2024 18:55:24 +0200 Subject: [PATCH 20/26] Remove deprecated functions They seem to be here by accident, I already removed them for good in #944. --- buildSrc/src/main/kotlin/Compiler.kt | 2 +- rest/api/rest.api | 5 - rest/api/rest.klib.api | 12 +- .../message/create/MessageCreateBuilder.kt | 115 +++--------------- 4 files changed, 23 insertions(+), 111 deletions(-) diff --git a/buildSrc/src/main/kotlin/Compiler.kt b/buildSrc/src/main/kotlin/Compiler.kt index e137103d598..00b3f31b5b6 100644 --- a/buildSrc/src/main/kotlin/Compiler.kt +++ b/buildSrc/src/main/kotlin/Compiler.kt @@ -19,7 +19,7 @@ object Jvm { fun KotlinCommonCompilerOptions.applyKordCompilerOptions() { allWarningsAsErrors = true progressiveMode = true - freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xdont-warn-on-error-suppression") + freeCompilerArgs.add("-Xexpect-actual-classes") } internal fun NamedDomainObjectSet.applyKordTestOptIns() { diff --git a/rest/api/rest.api b/rest/api/rest.api index 72ea1af4624..856f852bb19 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -2253,11 +2253,6 @@ public final class dev/kord/rest/builder/message/create/MessageCreateBuilder$Def } public final class dev/kord/rest/builder/message/create/MessageCreateBuilderKt { - public static final synthetic fun actionRow (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V - public static final synthetic fun allowedMentions (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V - public static synthetic fun allowedMentions$default (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V - public static final synthetic fun embed (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V - public static final synthetic fun messageFlags (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V public static final fun poll (Ldev/kord/rest/builder/message/create/MessageCreateBuilder;Lkotlin/jvm/functions/Function1;)V } diff --git a/rest/api/rest.klib.api b/rest/api/rest.klib.api index f7d47d6cbe4..eb63884e3ce 100644 --- a/rest/api/rest.klib.api +++ b/rest/api/rest.klib.api @@ -3546,14 +3546,14 @@ final class dev.kord.rest.json.request/ChannelPositionSwapRequest { // dev.kord. } final class dev.kord.rest.json.request/CreatablePoll { // dev.kord.rest.json.request/CreatablePoll|null[0] - constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType) // dev.kord.rest.json.request/CreatablePoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] + constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant?, dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType) // dev.kord.rest.json.request/CreatablePoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] final val allowMultiselect // dev.kord.rest.json.request/CreatablePoll.allowMultiselect|{}allowMultiselect[0] final fun (): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/CreatablePoll.allowMultiselect.|(){}[0] final val answers // dev.kord.rest.json.request/CreatablePoll.answers|{}answers[0] final fun (): kotlin.collections/List // dev.kord.rest.json.request/CreatablePoll.answers.|(){}[0] final val expiry // dev.kord.rest.json.request/CreatablePoll.expiry|{}expiry[0] - final fun (): kotlinx.datetime/Instant // dev.kord.rest.json.request/CreatablePoll.expiry.|(){}[0] + final fun (): kotlinx.datetime/Instant? // dev.kord.rest.json.request/CreatablePoll.expiry.|(){}[0] final val layoutType // dev.kord.rest.json.request/CreatablePoll.layoutType|{}layoutType[0] final fun (): dev.kord.common.entity/PollLayoutType // dev.kord.rest.json.request/CreatablePoll.layoutType.|(){}[0] final val question // dev.kord.rest.json.request/CreatablePoll.question|{}question[0] @@ -3561,10 +3561,10 @@ final class dev.kord.rest.json.request/CreatablePoll { // dev.kord.rest.json.req final fun component1(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.rest.json.request/CreatablePoll.component1|component1(){}[0] final fun component2(): kotlin.collections/List // dev.kord.rest.json.request/CreatablePoll.component2|component2(){}[0] - final fun component3(): kotlinx.datetime/Instant // dev.kord.rest.json.request/CreatablePoll.component3|component3(){}[0] + final fun component3(): kotlinx.datetime/Instant? // dev.kord.rest.json.request/CreatablePoll.component3|component3(){}[0] final fun component4(): dev.kord.common.entity.optional/Optional // dev.kord.rest.json.request/CreatablePoll.component4|component4(){}[0] final fun component5(): dev.kord.common.entity/PollLayoutType // dev.kord.rest.json.request/CreatablePoll.component5|component5(){}[0] - final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType = ...): dev.kord.rest.json.request/CreatablePoll // dev.kord.rest.json.request/CreatablePoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] + final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant? = ..., dev.kord.common.entity.optional/Optional = ..., dev.kord.common.entity/PollLayoutType = ...): dev.kord.rest.json.request/CreatablePoll // dev.kord.rest.json.request/CreatablePoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;dev.kord.common.entity.optional.Optional;dev.kord.common.entity.PollLayoutType){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.request/CreatablePoll.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.rest.json.request/CreatablePoll.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.rest.json.request/CreatablePoll.toString|toString(){}[0] @@ -7996,10 +7996,6 @@ final inline fun (dev.kord.rest.builder.interaction/MultiApplicationCommandBuild final inline fun (dev.kord.rest.builder.interaction/MultiApplicationCommandBuilder).dev.kord.rest.builder.interaction/user(kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/user|user@dev.kord.rest.builder.interaction.MultiApplicationCommandBuilder(kotlin.String;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.interaction/RootInputChatBuilder).dev.kord.rest.builder.interaction/group(kotlin/String, kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/group|group@dev.kord.rest.builder.interaction.RootInputChatBuilder(kotlin.String;kotlin.String;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.interaction/RootInputChatBuilder).dev.kord.rest.builder.interaction/subCommand(kotlin/String, kotlin/String, kotlin/Function1 = ...) // dev.kord.rest.builder.interaction/subCommand|subCommand@dev.kord.rest.builder.interaction.RootInputChatBuilder(kotlin.String;kotlin.String;kotlin.Function1){}[0] -final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/actionRow(kotlin/Function1) // dev.kord.rest.builder.message.create/actionRow|actionRow@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] -final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/allowedMentions(kotlin/Function1 = ...) // dev.kord.rest.builder.message.create/allowedMentions|allowedMentions@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] -final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/embed(kotlin/Function1) // dev.kord.rest.builder.message.create/embed|embed@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] -final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/messageFlags(kotlin/Function1) // dev.kord.rest.builder.message.create/messageFlags|messageFlags@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message.create/MessageCreateBuilder).dev.kord.rest.builder.message.create/poll(kotlin/Function1) // dev.kord.rest.builder.message.create/poll|poll@dev.kord.rest.builder.message.create.MessageCreateBuilder(kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message.modify/MessageModifyBuilder).dev.kord.rest.builder.message.modify/keepAttachment(dev.kord.common.entity/Snowflake, kotlin/Function1 = ...) // dev.kord.rest.builder.message.modify/keepAttachment|keepAttachment@dev.kord.rest.builder.message.modify.MessageModifyBuilder(dev.kord.common.entity.Snowflake;kotlin.Function1){}[0] final inline fun (dev.kord.rest.builder.message/MessageBuilder).dev.kord.rest.builder.message/actionRow(kotlin/Function1) // dev.kord.rest.builder.message/actionRow|actionRow@dev.kord.rest.builder.message.MessageBuilder(kotlin.Function1){}[0] diff --git a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt index b24b916db10..b4c4b932108 100644 --- a/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/create/MessageCreateBuilder.kt @@ -2,27 +2,17 @@ package dev.kord.rest.builder.message.create import dev.kord.common.annotation.KordDsl import dev.kord.common.annotation.KordUnsafe -import dev.kord.rest.json.request.CreatablePoll -import dev.kord.common.entity.DiscordPoll -import dev.kord.common.entity.MessageFlag +import dev.kord.common.entity.DiscordMessage import dev.kord.common.entity.MessageFlags 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.rest.NamedFile -import dev.kord.rest.builder.component.ActionRowBuilder import dev.kord.rest.builder.component.MessageComponentBuilder -import dev.kord.rest.builder.message.AllowedMentionsBuilder -import dev.kord.rest.builder.message.AttachmentBuilder -import dev.kord.rest.builder.message.EmbedBuilder -import dev.kord.rest.builder.message.MessageBuilder -import dev.kord.rest.builder.message.PollBuilder +import dev.kord.rest.builder.message.* +import dev.kord.rest.json.request.CreatablePoll import kotlin.contracts.InvocationKind import kotlin.contracts.contract -import dev.kord.rest.builder.message.actionRow as actionRowExtensionOnNewSupertype -import dev.kord.rest.builder.message.allowedMentions as allowedMentionsExtensionOnNewSupertype -import dev.kord.rest.builder.message.embed as embedExtensionOnNewSupertype -import dev.kord.rest.builder.message.messageFlags as messageFlagsExtensionOnNewSupertype /** * The base builder for creating a new message. @@ -51,6 +41,21 @@ public sealed interface MessageCreateBuilder : MessageBuilder { public var suppressNotifications: Boolean? } +/** + * Set's the [poll][DiscordMessage.poll] of this message. + * + * **Please note that if poll is set, you currently cannot set [MessageBuilder.content], + * [MessageBuilder.attachments], [MessageBuilder.embeds] or [MessageBuilder.components]** + */ +@KordUnsafe +public inline fun MessageCreateBuilder.poll(builder: PollBuilder.() -> Unit) { + contract { + callsInPlace(builder, InvocationKind.EXACTLY_ONCE) + } + + poll = PollBuilder().apply(builder).toRequest() +} + // this could have been combined with MessageCreateBuilder into a single sealed class, but it would have broken binary // compatibility, because MessageCreateBuilder would have changed from interface to class @@ -86,87 +91,3 @@ public sealed class AbstractMessageCreateBuilder : MessageCreateBuilder { @KordUnsafe final override var poll: CreatablePoll? by ::_poll.delegate() } - - -/** - * Adds an embed to the message, configured by the [block]. A message can have up to 10 embeds. - */ -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -@kotlin.internal.LowPriorityInOverloadResolution -@Deprecated( - "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.embed'.", - ReplaceWith("this.embed(block)", imports = ["dev.kord.rest.builder.message.embed"]), - DeprecationLevel.HIDDEN, -) -public inline fun MessageCreateBuilder.embed(block: EmbedBuilder.() -> Unit) { - contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } - embedExtensionOnNewSupertype(block) -} - -/** - * Configures the mentions that should trigger a mention (aka ping). Not calling this function will result in the default behavior - * (ping everything), calling this function but not configuring it before the request is build will result in all - * pings being ignored. - */ -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -@kotlin.internal.LowPriorityInOverloadResolution -@Deprecated( - "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.allowedMentions'.", - ReplaceWith("this.allowedMentions(block)", imports = ["dev.kord.rest.builder.message.allowedMentions"]), - DeprecationLevel.HIDDEN, -) -public inline fun MessageCreateBuilder.allowedMentions(block: AllowedMentionsBuilder.() -> Unit = {}) { - contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } - allowedMentionsExtensionOnNewSupertype(block) -} - -/** - * Adds an Action Row to the message, configured by the [builder]. A message can have up to 5 action rows. - */ -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -@kotlin.internal.LowPriorityInOverloadResolution -@Deprecated( - "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.actionRow'.", - ReplaceWith("this.actionRow(builder)", imports = ["dev.kord.rest.builder.message.actionRow"]), - DeprecationLevel.HIDDEN, -) -public inline fun MessageCreateBuilder.actionRow(builder: ActionRowBuilder.() -> Unit) { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - actionRowExtensionOnNewSupertype(builder) -} - -/** - * Sets the [MessageFlags] for the created message. - * - * **Only supports [MessageFlag.SuppressEmbeds] and [MessageFlag.SuppressNotifications]** - */ -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -@kotlin.internal.LowPriorityInOverloadResolution -@Deprecated( - "Replaced by extension on 'MessageBuilder'. Change import to 'dev.kord.rest.builder.message.messageFlags'.", - ReplaceWith("this.messageFlags(builder)", imports = ["dev.kord.rest.builder.message.messageFlags"]), - DeprecationLevel.HIDDEN, -) -public inline fun MessageCreateBuilder.messageFlags(builder: MessageFlags.Builder.() -> Unit) { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - messageFlagsExtensionOnNewSupertype(builder) -} - -/** - * Set's the [poll][dev.kord.common.entity.DiscordMessage.poll] of this message. - * - * **Please note that if poll is set, you currently cannot set [MessageBuilder.content], - * [MessageBuilder.attachments], [MessageBuilder.embeds] or [MessageBuilder.components]** - */ -@KordUnsafe -public inline fun MessageCreateBuilder.poll(builder: PollBuilder.() -> Unit) { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - - poll = PollBuilder().apply(builder).toRequest() -} From f25d559a2608d2ff449031803a2c3654d92aaf13 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 00:26:22 +0200 Subject: [PATCH 21/26] Fix test --- .../kotlin/behavior/MessageBehavior.kt | 3 +- core/src/jvmTest/kotlin/rest/RestTest.kt | 2 -- rest/api/rest.api | 27 ++++++++++++++++ rest/api/rest.klib.api | 32 +++++++++++++++++-- .../json/response/AnswerVotersGetResponse.kt | 7 ++++ rest/src/commonMain/kotlin/route/Route.kt | 4 +-- .../kotlin/service/ChannelService.kt | 3 +- 7 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 rest/src/commonMain/kotlin/json/response/AnswerVotersGetResponse.kt diff --git a/core/src/commonMain/kotlin/behavior/MessageBehavior.kt b/core/src/commonMain/kotlin/behavior/MessageBehavior.kt index 04db07f517b..7e22e6f7fdb 100644 --- a/core/src/commonMain/kotlin/behavior/MessageBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/MessageBehavior.kt @@ -1,5 +1,6 @@ package dev.kord.core.behavior +import dev.kord.common.entity.Permission import dev.kord.common.entity.Snowflake import dev.kord.common.exception.RequestException import dev.kord.core.Kord @@ -226,7 +227,7 @@ public interface PollBehavior : MessageBehavior { * Retrieves the voters who voted for the specified [answer][answerId]. */ public suspend fun getAnswerVoters(answerId: Int): List = - kord.rest.channel.getPollUsersByAnswer(channelId, id, answerId).map { + kord.rest.channel.getPollUsersByAnswer(channelId, id, answerId).users.map { val data = UserData.from(it) User(data, kord, supplier) diff --git a/core/src/jvmTest/kotlin/rest/RestTest.kt b/core/src/jvmTest/kotlin/rest/RestTest.kt index afe37f0b6fa..a0f738b2ac4 100644 --- a/core/src/jvmTest/kotlin/rest/RestTest.kt +++ b/core/src/jvmTest/kotlin/rest/RestTest.kt @@ -1,7 +1,6 @@ package dev.kord.core.rest import dev.kord.common.Color -import dev.kord.common.annotation.KordUnsafe import dev.kord.common.entity.* import dev.kord.core.Kord import dev.kord.core.behavior.* @@ -537,7 +536,6 @@ class RestServiceTest { } - @OptIn(KordUnsafe::class) @Test @Order(29) fun `poll in channel`() = runTest { diff --git a/rest/api/rest.api b/rest/api/rest.api index ddae8100985..5905f5d310f 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -5562,6 +5562,33 @@ public final class dev/kord/rest/json/request/WebhookModifyRequest$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/kord/rest/json/response/AnswerVotersGetResponse { + public static final field Companion Ldev/kord/rest/json/response/AnswerVotersGetResponse$Companion; + public fun (Ljava/util/List;)V + public final fun component1 ()Ljava/util/List; + public final fun copy (Ljava/util/List;)Ldev/kord/rest/json/response/AnswerVotersGetResponse; + public static synthetic fun copy$default (Ldev/kord/rest/json/response/AnswerVotersGetResponse;Ljava/util/List;ILjava/lang/Object;)Ldev/kord/rest/json/response/AnswerVotersGetResponse; + public fun equals (Ljava/lang/Object;)Z + public final fun getUsers ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/kord/rest/json/response/AnswerVotersGetResponse$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/rest/json/response/AnswerVotersGetResponse$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/rest/json/response/AnswerVotersGetResponse; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/rest/json/response/AnswerVotersGetResponse;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/rest/json/response/AnswerVotersGetResponse$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/kord/rest/json/response/BanResponse { public static final field Companion Ldev/kord/rest/json/response/BanResponse$Companion; public fun (Ljava/lang/String;Ldev/kord/common/entity/DiscordUser;)V diff --git a/rest/api/rest.klib.api b/rest/api/rest.klib.api index 185ee916d07..ca823aedfa9 100644 --- a/rest/api/rest.klib.api +++ b/rest/api/rest.klib.api @@ -6074,6 +6074,34 @@ final class dev.kord.rest.json.request/WebhookModifyRequest { // dev.kord.rest.j } } +final class dev.kord.rest.json.response/AnswerVotersGetResponse { // dev.kord.rest.json.response/AnswerVotersGetResponse|null[0] + constructor (kotlin.collections/List) // dev.kord.rest.json.response/AnswerVotersGetResponse.|(kotlin.collections.List){}[0] + + final val users // dev.kord.rest.json.response/AnswerVotersGetResponse.users|{}users[0] + final fun (): kotlin.collections/List // dev.kord.rest.json.response/AnswerVotersGetResponse.users.|(){}[0] + + final fun component1(): kotlin.collections/List // dev.kord.rest.json.response/AnswerVotersGetResponse.component1|component1(){}[0] + final fun copy(kotlin.collections/List = ...): dev.kord.rest.json.response/AnswerVotersGetResponse // dev.kord.rest.json.response/AnswerVotersGetResponse.copy|copy(kotlin.collections.List){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.rest.json.response/AnswerVotersGetResponse.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // dev.kord.rest.json.response/AnswerVotersGetResponse.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // dev.kord.rest.json.response/AnswerVotersGetResponse.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer|null[0] + final val descriptor // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.rest.json.response/AnswerVotersGetResponse // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.rest.json.response/AnswerVotersGetResponse) // dev.kord.rest.json.response/AnswerVotersGetResponse.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.rest.json.response.AnswerVotersGetResponse){}[0] + } + + final object Companion { // dev.kord.rest.json.response/AnswerVotersGetResponse.Companion|null[0] + final val $childSerializers // dev.kord.rest.json.response/AnswerVotersGetResponse.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.rest.json.response/AnswerVotersGetResponse.Companion.serializer|serializer(){}[0] + } +} + final class dev.kord.rest.json.response/BanResponse { // dev.kord.rest.json.response/BanResponse|null[0] constructor (kotlin/String?, dev.kord.common.entity/DiscordUser) // dev.kord.rest.json.response/BanResponse.|(kotlin.String?;dev.kord.common.entity.DiscordUser){}[0] @@ -6664,7 +6692,7 @@ final class dev.kord.rest.service/ChannelService : dev.kord.rest.service/RestSer final suspend fun getChannelPins(dev.kord.common.entity/Snowflake): kotlin.collections/List // dev.kord.rest.service/ChannelService.getChannelPins|getChannelPins(dev.kord.common.entity.Snowflake){}[0] final suspend fun getMessage(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake): dev.kord.common.entity/DiscordMessage // dev.kord.rest.service/ChannelService.getMessage|getMessage(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake){}[0] final suspend fun getMessages(dev.kord.common.entity/Snowflake, dev.kord.rest.route/Position? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getMessages|getMessages(dev.kord.common.entity.Snowflake;dev.kord.rest.route.Position?;kotlin.Int?){}[0] - final suspend fun getPollUsersByAnswer(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, kotlin/Int, dev.kord.common.entity/Snowflake? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getPollUsersByAnswer|getPollUsersByAnswer(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;kotlin.Int;dev.kord.common.entity.Snowflake?;kotlin.Int?){}[0] + final suspend fun getPollUsersByAnswer(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, kotlin/Int, dev.kord.common.entity/Snowflake? = ..., kotlin/Int? = ...): dev.kord.rest.json.response/AnswerVotersGetResponse // dev.kord.rest.service/ChannelService.getPollUsersByAnswer|getPollUsersByAnswer(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;kotlin.Int;dev.kord.common.entity.Snowflake?;kotlin.Int?){}[0] final suspend fun getReactions(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake, kotlin/String, dev.kord.rest.route/Position.After? = ..., kotlin/Int? = ...): kotlin.collections/List // dev.kord.rest.service/ChannelService.getReactions|getReactions(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake;kotlin.String;dev.kord.rest.route.Position.After?;kotlin.Int?){}[0] final suspend fun joinThread(dev.kord.common.entity/Snowflake) // dev.kord.rest.service/ChannelService.joinThread|joinThread(dev.kord.common.entity.Snowflake){}[0] final suspend fun leaveThread(dev.kord.common.entity/Snowflake) // dev.kord.rest.service/ChannelService.leaveThread|leaveThread(dev.kord.common.entity.Snowflake){}[0] @@ -7203,7 +7231,7 @@ sealed class <#A: kotlin/Any?> dev.kord.rest.route/Route { // dev.kord.rest.rout final object GatewayGet : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GatewayGet|null[0] - final object GetVoteAnswer : dev.kord.rest.route/Route> // dev.kord.rest.route/Route.GetVoteAnswer|null[0] + final object GetVoteAnswer : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GetVoteAnswer|null[0] final object GetWebhookMessage : dev.kord.rest.route/Route // dev.kord.rest.route/Route.GetWebhookMessage|null[0] diff --git a/rest/src/commonMain/kotlin/json/response/AnswerVotersGetResponse.kt b/rest/src/commonMain/kotlin/json/response/AnswerVotersGetResponse.kt new file mode 100644 index 00000000000..30d32dd3c5e --- /dev/null +++ b/rest/src/commonMain/kotlin/json/response/AnswerVotersGetResponse.kt @@ -0,0 +1,7 @@ +package dev.kord.rest.json.response + +import dev.kord.common.entity.DiscordUser +import kotlinx.serialization.Serializable + +@Serializable +public data class AnswerVotersGetResponse(val users: List) diff --git a/rest/src/commonMain/kotlin/route/Route.kt b/rest/src/commonMain/kotlin/route/Route.kt index 6d3ffef1b67..fb0b27d9684 100644 --- a/rest/src/commonMain/kotlin/route/Route.kt +++ b/rest/src/commonMain/kotlin/route/Route.kt @@ -1048,10 +1048,10 @@ public sealed class Route( DiscordMessageSticker.serializer() ) - public object GetVoteAnswer : Route>( + public object GetVoteAnswer : Route( HttpMethod.Get, "/channels/$ChannelId/polls/$MessageId/answers/$PollAnswerId", - ListSerializer(DiscordUser.serializer()) + AnswerVotersGetResponse.serializer(), ) public object PostExpirePoll : Route( diff --git a/rest/src/commonMain/kotlin/service/ChannelService.kt b/rest/src/commonMain/kotlin/service/ChannelService.kt index 4e59137197d..4774b9324f3 100644 --- a/rest/src/commonMain/kotlin/service/ChannelService.kt +++ b/rest/src/commonMain/kotlin/service/ChannelService.kt @@ -8,6 +8,7 @@ import dev.kord.rest.builder.channel.thread.StartThreadWithMessageBuilder import dev.kord.rest.builder.message.create.UserMessageCreateBuilder import dev.kord.rest.builder.message.modify.UserMessageModifyBuilder import dev.kord.rest.json.request.* +import dev.kord.rest.json.response.AnswerVotersGetResponse import dev.kord.rest.json.response.FollowedChannelResponse import dev.kord.rest.json.response.ListThreadsResponse import dev.kord.rest.request.RequestBuilder @@ -421,7 +422,7 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques answerId: Int, after: Snowflake? = null, limit: Int? = null - ): List = call(Route.GetVoteAnswer) { + ): AnswerVotersGetResponse = call(Route.GetVoteAnswer) { keys[Route.ChannelId] = channelId keys[Route.MessageId] = messageId keys[Route.PollAnswerId] = answerId.toString() From a58879bd59d2ee4e4fbdd44b32a52e0d13190a4c Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 00:28:29 +0200 Subject: [PATCH 22/26] Rename PollLayoutType.DEFAULT All other kord enums use camel case naming. --- common/api/common.api | 4 ++-- common/api/common.klib.api | 2 +- .../kotlin/dev/kord/common/entity/PollLayoutType.kt | 6 +++--- common/src/commonMain/kotlin/entity/DiscordMessage.kt | 6 +++--- rest/src/commonMain/kotlin/builder/message/PollBuilder.kt | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/api/common.api b/common/api/common.api index f0d6db923cb..1950bc83b7c 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -8110,8 +8110,8 @@ public final class dev/kord/common/entity/PollLayoutType$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/kord/common/entity/PollLayoutType$DEFAULT : dev/kord/common/entity/PollLayoutType { - public static final field INSTANCE Ldev/kord/common/entity/PollLayoutType$DEFAULT; +public final class dev/kord/common/entity/PollLayoutType$Default : dev/kord/common/entity/PollLayoutType { + public static final field INSTANCE Ldev/kord/common/entity/PollLayoutType$Default; } public final class dev/kord/common/entity/PollLayoutType$Unknown : dev/kord/common/entity/PollLayoutType { diff --git a/common/api/common.klib.api b/common/api/common.klib.api index c36142dd707..b15dbd71741 100644 --- a/common/api/common.klib.api +++ b/common/api/common.klib.api @@ -8666,7 +8666,7 @@ sealed class dev.kord.common.entity/PollLayoutType { // dev.kord.common.entity/P final fun serializer(): kotlinx.serialization/KSerializer // dev.kord.common.entity/PollLayoutType.Companion.serializer|serializer(){}[0] } - final object DEFAULT : dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/PollLayoutType.DEFAULT|null[0] + final object Default : dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/PollLayoutType.Default|null[0] } sealed class dev.kord.common.entity/PremiumTier { // dev.kord.common.entity/PremiumTier|null[0] diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt index 967a23d97a3..1ca078a9776 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PollLayoutType.kt @@ -45,7 +45,7 @@ public sealed class PollLayoutType( /** * The, uhm, default layout type. */ - public object DEFAULT : PollLayoutType(1) + public object Default : PollLayoutType(1) internal object Serializer : KSerializer { override val descriptor: SerialDescriptor = @@ -65,7 +65,7 @@ public sealed class PollLayoutType( */ public val entries: List by lazy(mode = PUBLICATION) { listOf( - DEFAULT, + Default, ) } @@ -74,7 +74,7 @@ public sealed class PollLayoutType( * specified [value]. */ public fun from(`value`: Int): PollLayoutType = when (value) { - 1 -> DEFAULT + 1 -> Default else -> Unknown(value) } } diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index b9b930f7f00..d9889821705 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -124,9 +124,9 @@ @file:Generate( INT_KORD_ENUM, name = "PollLayoutType", docUrl = "https://discord.com/developers/docs/resources/poll#layout-type", - entries = [ - Entry("DEFAULT", intValue = 1, kDoc = "The, uhm, default layout type.") - ] + entries = [ + Entry("Default", intValue = 1, kDoc = "The, uhm, default layout type."), + ], ) package dev.kord.common.entity diff --git a/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt index 2175204218f..77a11acde6d 100644 --- a/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/message/PollBuilder.kt @@ -33,7 +33,7 @@ public class PollBuilder : RequestBuilder { internal var _allowMultiselect: Optional = Optional.Missing() public var allowMultiselect: Boolean? by ::_allowMultiselect.delegate() - public var layoutType: PollLayoutType = PollLayoutType.DEFAULT + public var layoutType: PollLayoutType = PollLayoutType.Default /** * Sets the polls [Duration] to [duration]. @@ -119,4 +119,4 @@ public class PollBuilder : RequestBuilder { _allowMultiselect, layoutType ) -} \ No newline at end of file +} From 3efd971b2e7101253d08da5268b1d04ee750d710 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 00:30:36 +0200 Subject: [PATCH 23/26] Make DiscordPoll.results optional --- common/api/common.api | 11 ++++++----- common/api/common.klib.api | 8 ++++---- common/src/commonMain/kotlin/entity/DiscordMessage.kt | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/common/api/common.api b/common/api/common.api index 1950bc83b7c..ea6ead15617 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -5293,22 +5293,23 @@ public final class dev/kord/common/entity/DiscordPinsUpdateData$Companion { public final class dev/kord/common/entity/DiscordPoll { public static final field Companion Ldev/kord/common/entity/DiscordPoll$Companion; - public fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)V + public fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/DiscordPoll$Media; public final fun component2 ()Ljava/util/List; public final fun component3 ()Lkotlinx/datetime/Instant; public final fun component4 ()Z public final fun component5 ()Ldev/kord/common/entity/PollLayoutType; - public final fun component6 ()Ldev/kord/common/entity/DiscordPoll$Results; - public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)Ldev/kord/common/entity/DiscordPoll; - public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll; + public final fun component6 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordPoll; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll; public fun equals (Ljava/lang/Object;)Z public final fun getAllowMultiselect ()Z public final fun getAnswers ()Ljava/util/List; public final fun getExpiry ()Lkotlinx/datetime/Instant; public final fun getLayoutType ()Ldev/kord/common/entity/PollLayoutType; public final fun getQuestion ()Ldev/kord/common/entity/DiscordPoll$Media; - public final fun getResults ()Ldev/kord/common/entity/DiscordPoll$Results; + public final fun getResults ()Ldev/kord/common/entity/optional/Optional; public fun hashCode ()I public fun toString ()Ljava/lang/String; } diff --git a/common/api/common.klib.api b/common/api/common.klib.api index b15dbd71741..cf29e2a708f 100644 --- a/common/api/common.klib.api +++ b/common/api/common.klib.api @@ -4205,7 +4205,7 @@ final class dev.kord.common.entity/DiscordPinsUpdateData { // dev.kord.common.en } final class dev.kord.common.entity/DiscordPoll { // dev.kord.common.entity/DiscordPoll|null[0] - constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant?, kotlin/Boolean, dev.kord.common.entity/PollLayoutType, dev.kord.common.entity/DiscordPoll.Results?) // dev.kord.common.entity/DiscordPoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0] + constructor (dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List, kotlinx.datetime/Instant?, kotlin/Boolean, dev.kord.common.entity/PollLayoutType, dev.kord.common.entity.optional/Optional = ...) // dev.kord.common.entity/DiscordPoll.|(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.optional.Optional){}[0] final val allowMultiselect // dev.kord.common.entity/DiscordPoll.allowMultiselect|{}allowMultiselect[0] final fun (): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.allowMultiselect.|(){}[0] @@ -4218,15 +4218,15 @@ final class dev.kord.common.entity/DiscordPoll { // dev.kord.common.entity/Disco final val question // dev.kord.common.entity/DiscordPoll.question|{}question[0] final fun (): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.question.|(){}[0] final val results // dev.kord.common.entity/DiscordPoll.results|{}results[0] - final fun (): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.results.|(){}[0] + final fun (): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.results.|(){}[0] final fun component1(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.component1|component1(){}[0] final fun component2(): kotlin.collections/List // dev.kord.common.entity/DiscordPoll.component2|component2(){}[0] final fun component3(): kotlinx.datetime/Instant? // dev.kord.common.entity/DiscordPoll.component3|component3(){}[0] final fun component4(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.component4|component4(){}[0] final fun component5(): dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/DiscordPoll.component5|component5(){}[0] - final fun component6(): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.component6|component6(){}[0] - final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., dev.kord.common.entity/PollLayoutType = ..., dev.kord.common.entity/DiscordPoll.Results? = ...): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0] + final fun component6(): dev.kord.common.entity.optional/Optional // dev.kord.common.entity/DiscordPoll.component6|component6(){}[0] + final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., dev.kord.common.entity/PollLayoutType = ..., dev.kord.common.entity.optional/Optional = ...): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.optional.Optional){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.toString|toString(){}[0] diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index d9889821705..1cbdfed9b9f 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -720,7 +720,7 @@ public data class DiscordPoll( val allowMultiselect: Boolean, @SerialName("layout_type") val layoutType: PollLayoutType, - val results: Results? + val results: Optional = Optional.Missing(), ) { /** * Shared object between answers and questions. From 39fcfb71111b496dd4377f142f73fbab52740c87 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 00:31:02 +0200 Subject: [PATCH 24/26] Fix KDoc references --- common/src/commonMain/kotlin/entity/DiscordMessage.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/commonMain/kotlin/entity/DiscordMessage.kt b/common/src/commonMain/kotlin/entity/DiscordMessage.kt index 1cbdfed9b9f..b859e7f522c 100644 --- a/common/src/commonMain/kotlin/entity/DiscordMessage.kt +++ b/common/src/commonMain/kotlin/entity/DiscordMessage.kt @@ -764,9 +764,9 @@ public data class DiscordPoll( * * To compensate for this, after a poll is finished there is a background job which performs a final, * accurate tally of votes. - * This tally has concluded once [dev.kord.common.entity.Poll.Results.isFinalized] is `true`. + * This tally has concluded once [dev.kord.common.entity.DiscordPoll.Results.isFinalized] is `true`. * - * If [dev.kord.common.entity.Poll.Results.answerCounts] does not contain an entry for a particular answer, + * If [dev.kord.common.entity.DiscordPoll.Results.answerCounts] does not contain an entry for a particular answer, * then there are no votes for that answer. * * @property id the [Answer.answerId] From abe3347acd896779013400b1ba365bf62a0c0b98 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 02:29:08 +0200 Subject: [PATCH 25/26] Move routes up --- rest/src/commonMain/kotlin/route/Route.kt | 32 ++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/rest/src/commonMain/kotlin/route/Route.kt b/rest/src/commonMain/kotlin/route/Route.kt index fb0b27d9684..b69041a14a7 100644 --- a/rest/src/commonMain/kotlin/route/Route.kt +++ b/rest/src/commonMain/kotlin/route/Route.kt @@ -988,6 +988,26 @@ public sealed class Route( ) + /* + * Poll: + * https://discord.com/developers/docs/resources/poll + */ + + public object GetVoteAnswer : + Route( + HttpMethod.Get, + "/channels/$ChannelId/polls/$MessageId/answers/$PollAnswerId", + AnswerVotersGetResponse.serializer(), + ) + + public object PostExpirePoll : + Route( + HttpMethod.Post, + "/channels/$ChannelId/polls/$MessageId/expire", + DiscordMessage.serializer(), + ) + + /* * Stage Instance: * https://discord.com/developers/docs/resources/stage-instance @@ -1047,16 +1067,4 @@ public sealed class Route( "/guilds/$GuildId/stickers/$StickerId", DiscordMessageSticker.serializer() ) - - public object GetVoteAnswer : Route( - HttpMethod.Get, - "/channels/$ChannelId/polls/$MessageId/answers/$PollAnswerId", - AnswerVotersGetResponse.serializer(), - ) - - public object PostExpirePoll : Route( - HttpMethod.Post, - "/channels/$ChannelId/polls/$MessageId/expire", - DiscordMessage.serializer() - ) } From 1ef14332e49d9cd071ab4c4c6099cc2499d41287 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 3 Sep 2024 03:17:04 +0200 Subject: [PATCH 26/26] Remove imports --- .../kotlin/behavior/channel/MessageChannelBehavior.kt | 2 -- rest/src/commonMain/kotlin/json/request/WebhookRequests.kt | 1 - 2 files changed, 3 deletions(-) diff --git a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt index c9442ab4a30..99d36695c8f 100644 --- a/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/MessageChannelBehavior.kt @@ -12,10 +12,8 @@ import dev.kord.core.hash import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.rest.builder.message.EmbedBuilder -import dev.kord.rest.builder.message.PollBuilder import dev.kord.rest.builder.message.create.MessageCreateBuilder import dev.kord.rest.builder.message.create.UserMessageCreateBuilder -import dev.kord.rest.builder.message.create.poll import dev.kord.rest.builder.message.embed import dev.kord.rest.request.RestRequestException import dev.kord.rest.service.RestClient diff --git a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt index c976bd4c39e..fbd83dd4f57 100644 --- a/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/WebhookRequests.kt @@ -1,7 +1,6 @@ package dev.kord.rest.json.request import dev.kord.common.entity.AllowedMentions -import dev.kord.rest.json.request.CreatablePoll import dev.kord.common.entity.DiscordComponent import dev.kord.common.entity.MessageFlags import dev.kord.common.entity.Snowflake