From a4311db4775ee5c7df8aa527999cee4403125901 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 20 Aug 2024 00:09:25 +0200 Subject: [PATCH] Document deprecation cycle of deprecated declarations (#969) --- .../dev/kord/common/entity/Permission.kt | 10 +++--- .../kord/common/entity/SystemChannelFlag.kt | 6 ++-- .../kotlin/dev/kord/common/entity/UserFlag.kt | 2 +- common/src/commonMain/kotlin/DiscordBitSet.kt | 2 +- common/src/commonMain/kotlin/Locale.kt | 2 +- .../kotlin/entity/DiscordChannel.kt | 2 +- .../commonMain/kotlin/entity/DiscordShard.kt | 6 ++-- .../commonMain/kotlin/entity/Permissions.kt | 3 +- core/src/commonMain/kotlin/Kord.kt | 2 +- .../interaction/ApplicationCommandCreate.kt | 15 +++++--- .../interaction/ApplicationCommandDelete.kt | 15 +++++--- .../interaction/ApplicationCommandUpdate.kt | 15 +++++--- .../kotlin/dev/kord/gateway/Intent.kt | 4 +-- gateway/src/commonMain/kotlin/Event.kt | 35 ++++++++++++++----- gateway/src/commonMain/kotlin/Gateway.kt | 5 ++- gateway/src/commonMain/kotlin/Utils.kt | 5 ++- .../commonMain/kotlin/builder/LoginBuilder.kt | 5 ++- .../bitflags/ContainsPlusMinusCopy.kt | 7 +++- .../bitflags/DeprecatedNewCompanion.kt | 3 +- .../generation/bitflags/FactoryFunctions.kt | 7 +++- .../src/commonMain/kotlin/route/DiscordCdn.kt | 3 +- voice/src/main/kotlin/gateway/VoiceEvent.kt | 3 +- voice/src/main/kotlin/gateway/VoiceGateway.kt | 5 ++- 23 files changed, 113 insertions(+), 49 deletions(-) diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/Permission.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/Permission.kt index 57ec37f77d5..6f76d846002 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/Permission.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/Permission.kt @@ -549,7 +549,7 @@ public class Permissions internal constructor( @Deprecated( level = DeprecationLevel.HIDDEN, - message = "Binary compatibility, keep for some releases.", + message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.", ) public inline fun copy0(builder: Builder.() -> Unit): Permissions { contract { callsInPlace(builder, EXACTLY_ONCE) } @@ -620,7 +620,8 @@ public class Permissions internal constructor( @Suppress(names = arrayOf("DEPRECATION_ERROR")) @Deprecated( level = DeprecationLevel.ERROR, - message = "Renamed to 'Companion'.", + message = + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.", replaceWith = ReplaceWith(expression = "Permissions.Companion", imports = arrayOf("dev.kord.common.entity.Permissions")), ) @@ -630,7 +631,8 @@ public class Permissions internal constructor( @Deprecated( level = DeprecationLevel.ERROR, - message = "Renamed to 'Companion'.", + message = + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.", replaceWith = ReplaceWith(expression = "Permissions.Companion", imports = arrayOf("dev.kord.common.entity.Permissions")), ) @@ -650,7 +652,7 @@ public inline fun Permissions(builder: Permissions.Builder.() -> Unit = {}): Per @Suppress(names = arrayOf("FunctionName")) @Deprecated( level = DeprecationLevel.HIDDEN, - message = "Binary compatibility, keep for some releases.", + message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.", ) public inline fun Permissions0(builder: Permissions.Builder.() -> Unit = {}): Permissions { contract { callsInPlace(builder, EXACTLY_ONCE) } diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SystemChannelFlag.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SystemChannelFlag.kt index 27f60625c5a..abac9875485 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SystemChannelFlag.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SystemChannelFlag.kt @@ -330,7 +330,8 @@ public class SystemChannelFlags internal constructor( @Suppress(names = arrayOf("DEPRECATION_ERROR")) @Deprecated( level = DeprecationLevel.ERROR, - message = "Renamed to 'Companion'.", + message = + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.", replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports = arrayOf("dev.kord.common.entity.SystemChannelFlags")), ) @@ -340,7 +341,8 @@ public class SystemChannelFlags internal constructor( @Deprecated( level = DeprecationLevel.ERROR, - message = "Renamed to 'Companion'.", + message = + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.", replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports = arrayOf("dev.kord.common.entity.SystemChannelFlags")), ) diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserFlag.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserFlag.kt index af3585bd8bc..0ce65c36e3d 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserFlag.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserFlag.kt @@ -315,7 +315,7 @@ public class UserFlags internal constructor( @Deprecated( level = DeprecationLevel.HIDDEN, - message = "Binary compatibility, keep for some releases.", + message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.", ) public inline fun copy0(builder: Builder.() -> Unit): UserFlags { contract { callsInPlace(builder, EXACTLY_ONCE) } diff --git a/common/src/commonMain/kotlin/DiscordBitSet.kt b/common/src/commonMain/kotlin/DiscordBitSet.kt index 8b98a3b0668..45939272dc5 100644 --- a/common/src/commonMain/kotlin/DiscordBitSet.kt +++ b/common/src/commonMain/kotlin/DiscordBitSet.kt @@ -152,7 +152,7 @@ public fun DiscordBitSet(value: String): DiscordBitSet { @Deprecated( - "Replaced by 'DiscordBitSet.serializer()'.", + "Replaced by 'DiscordBitSet.serializer()'. This declaration will be removed in 0.16.0.", ReplaceWith("DiscordBitSet.serializer()", imports = ["dev.kord.common.DiscordBitSet"]), DeprecationLevel.HIDDEN, ) diff --git a/common/src/commonMain/kotlin/Locale.kt b/common/src/commonMain/kotlin/Locale.kt index 0ed29906bf0..f512ce4edb8 100644 --- a/common/src/commonMain/kotlin/Locale.kt +++ b/common/src/commonMain/kotlin/Locale.kt @@ -237,7 +237,7 @@ public data class Locale(val language: String, val country: String? = null) { } @Deprecated( - "Replaced by 'Locale.serializer()'.", + "Replaced by 'Locale.serializer()'. This declaration will be removed in 0.16.0.", ReplaceWith("Locale.serializer()", imports = ["dev.kord.common.Locale"]), DeprecationLevel.HIDDEN, ) diff --git a/common/src/commonMain/kotlin/entity/DiscordChannel.kt b/common/src/commonMain/kotlin/entity/DiscordChannel.kt index d6b247f33a8..fb6881ff398 100644 --- a/common/src/commonMain/kotlin/entity/DiscordChannel.kt +++ b/common/src/commonMain/kotlin/entity/DiscordChannel.kt @@ -233,7 +233,7 @@ public sealed class ArchiveDuration( @Suppress("UNUSED_PARAMETER") unused: Nothing?, ) : ArchiveDuration(duration) { @Deprecated( - "Replaced by 'ArchiveDuration.from()'.", + "Replaced by 'ArchiveDuration.from()'. This declaration will be removed in 0.16.0.", ReplaceWith("ArchiveDuration.from(duration)", imports = ["dev.kord.common.entity.ArchiveDuration"]), DeprecationLevel.HIDDEN, ) diff --git a/common/src/commonMain/kotlin/entity/DiscordShard.kt b/common/src/commonMain/kotlin/entity/DiscordShard.kt index b7e2b0d9d2d..8fa7bdc16c0 100644 --- a/common/src/commonMain/kotlin/entity/DiscordShard.kt +++ b/common/src/commonMain/kotlin/entity/DiscordShard.kt @@ -35,7 +35,8 @@ public data class DiscordShard(val index: Int, val count: Int) { public companion object { @Suppress("DEPRECATION_ERROR") @Deprecated( - "Renamed to 'Companion'.", + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration " + + "will be removed in 0.17.0.", ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]), DeprecationLevel.ERROR, ) @@ -44,7 +45,8 @@ public data class DiscordShard(val index: Int, val count: Int) { } @Deprecated( - "Renamed to 'Companion'.", + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will " + + "be removed in 0.17.0.", ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]), DeprecationLevel.ERROR, ) diff --git a/common/src/commonMain/kotlin/entity/Permissions.kt b/common/src/commonMain/kotlin/entity/Permissions.kt index 65e7af96c9a..8a6e3cefc2f 100644 --- a/common/src/commonMain/kotlin/entity/Permissions.kt +++ b/common/src/commonMain/kotlin/entity/Permissions.kt @@ -112,7 +112,8 @@ public val Permissions.Companion.ALL: Permissions get() = ALL_PERMISSIONS @Suppress("UnusedReceiverParameter", "DEPRECATION_ERROR") @Deprecated( - "'Permissions.NewCompanion' was renamed to 'Permissions.Companion'. Use 'Permissions.Companion.ALL' instead.", + "'Permissions.NewCompanion' was renamed to 'Permissions.Companion'. Use 'Permissions.Companion.ALL' instead. The " + + "deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.", ReplaceWith("Permissions.ALL", imports = ["dev.kord.common.entity.Permissions", "dev.kord.common.entity.ALL"]), DeprecationLevel.ERROR, ) diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index f116b1b2571..0ae5ec4fae1 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -39,7 +39,7 @@ import kotlin.contracts.contract import kotlin.coroutines.CoroutineContext import kotlinx.coroutines.channels.Channel as CoroutineChannel -@Deprecated("Use your own logger instead, this will be removed in the future.", level = DeprecationLevel.HIDDEN) +@Deprecated("Use your own logger instead. This declaration will be removed in 0.16.0.", level = DeprecationLevel.HIDDEN) public val kordLogger: mu.KLogger = mu.KotlinLogging.logger { } private val logger = KotlinLogging.logger { } diff --git a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandCreate.kt b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandCreate.kt index 60c296bb035..e44f876c6be 100644 --- a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandCreate.kt +++ b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandCreate.kt @@ -7,7 +7,8 @@ import dev.kord.core.event.Event @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public sealed interface ApplicationCommandCreateEvent : Event { @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandCreateEvent : Event { @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class ChatInputCommandCreateEvent( @@ -31,7 +33,8 @@ public class ChatInputCommandCreateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UserCommandCreateEvent( @@ -45,7 +48,8 @@ public class UserCommandCreateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class MessageCommandCreateEvent( @@ -59,7 +63,8 @@ public class MessageCommandCreateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UnknownApplicationCommandCreateEvent( diff --git a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandDelete.kt b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandDelete.kt index ba2f859353e..07da0c05680 100644 --- a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandDelete.kt +++ b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandDelete.kt @@ -7,7 +7,8 @@ import dev.kord.core.event.Event @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public sealed interface ApplicationCommandDeleteEvent : Event { @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandDeleteEvent : Event { @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class ChatInputCommandDeleteEvent( @@ -31,7 +33,8 @@ public class ChatInputCommandDeleteEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UserCommandDeleteEvent( @@ -45,7 +48,8 @@ public class UserCommandDeleteEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class MessageCommandDeleteEvent( @@ -59,7 +63,8 @@ public class MessageCommandDeleteEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UnknownApplicationCommandDeleteEvent( diff --git a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandUpdate.kt b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandUpdate.kt index daf181e4a5a..8bd152c4a7d 100644 --- a/core/src/commonMain/kotlin/event/interaction/ApplicationCommandUpdate.kt +++ b/core/src/commonMain/kotlin/event/interaction/ApplicationCommandUpdate.kt @@ -7,7 +7,8 @@ import dev.kord.core.event.Event @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public sealed interface ApplicationCommandUpdateEvent : Event { @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandUpdateEvent : Event { @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class ChatInputCommandUpdateEvent( @@ -31,7 +33,8 @@ public class ChatInputCommandUpdateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UserCommandUpdateEvent( @@ -45,7 +48,8 @@ public class UserCommandUpdateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class MessageCommandUpdateEvent( @@ -58,7 +62,8 @@ public class MessageCommandUpdateEvent( @Suppress("DEPRECATION_ERROR") @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public class UnknownApplicationCommandUpdateEvent( diff --git a/gateway/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/gateway/Intent.kt b/gateway/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/gateway/Intent.kt index b5f4c49f4ca..5d189d3cd0f 100644 --- a/gateway/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/gateway/Intent.kt +++ b/gateway/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/gateway/Intent.kt @@ -424,7 +424,7 @@ public class Intents internal constructor( @Deprecated( level = DeprecationLevel.HIDDEN, - message = "Binary compatibility, keep for some releases.", + message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.", ) public inline fun copy0(builder: Builder.() -> Unit): Intents { contract { callsInPlace(builder, EXACTLY_ONCE) } @@ -502,7 +502,7 @@ public inline fun Intents(builder: Intents.Builder.() -> Unit = {}): Intents { @Suppress(names = arrayOf("FunctionName")) @Deprecated( level = DeprecationLevel.HIDDEN, - message = "Binary compatibility, keep for some releases.", + message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.", ) public inline fun Intents0(builder: Intents.Builder.() -> Unit = {}): Intents { contract { callsInPlace(builder, EXACTLY_ONCE) } diff --git a/gateway/src/commonMain/kotlin/Event.kt b/gateway/src/commonMain/kotlin/Event.kt index bf7c4e5f93e..ac19a5dd5ce 100644 --- a/gateway/src/commonMain/kotlin/Event.kt +++ b/gateway/src/commonMain/kotlin/Event.kt @@ -302,23 +302,35 @@ public data class Heartbeat(val data: Long?) : Event() { override fun deserialize(decoder: Decoder) = Heartbeat(decoder.decodeSerializableValue(delegate)) } - @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) + @Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.18.0.", + level = DeprecationLevel.HIDDEN, + ) public constructor(data: Long) : this(data as Long?) @Suppress("PropertyName") - @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) + @Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.18.0.", + level = DeprecationLevel.HIDDEN, + ) @get:JvmName("getData") public val data_: Long get() = data ?: throw NullPointerException("This heartbeat request contains a null sequence number") @Suppress("FunctionName") - @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) + @Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.18.0.", + level = DeprecationLevel.HIDDEN, + ) @JvmName("component1") public fun component1_(): Long = component1() ?: throw NullPointerException("This heartbeat request contains a null sequence number") @Suppress("FunctionName") - @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) + @Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.18.0.", + level = DeprecationLevel.HIDDEN, + ) @JvmName("copy") public fun copy_( data: Long = this.data ?: throw NullPointerException("This heartbeat request contains a null sequence number"), @@ -327,7 +339,8 @@ public data class Heartbeat(val data: Long?) : Event() { public companion object { @Suppress("DEPRECATION_ERROR") @Deprecated( - "Renamed to 'Companion'.", + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration " + + "will be removed in 0.17.0.", ReplaceWith("Heartbeat.Companion", imports = ["dev.kord.gateway.Heartbeat"]), DeprecationLevel.ERROR, ) @@ -336,7 +349,8 @@ public data class Heartbeat(val data: Long?) : Event() { } @Deprecated( - "Renamed to 'Companion'.", + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will " + + "be removed in 0.17.0.", ReplaceWith("Heartbeat.Companion", imports = ["dev.kord.gateway.Heartbeat"]), DeprecationLevel.ERROR, ) @@ -535,7 +549,8 @@ public data class InteractionCreate(val interaction: DiscordInteraction, overrid @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public data class ApplicationCommandCreate(val application: DiscordApplicationCommand, override val sequence: Int?) : @@ -544,7 +559,8 @@ public data class ApplicationCommandCreate(val application: DiscordApplicationCo @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public data class ApplicationCommandUpdate(val application: DiscordApplicationCommand, override val sequence: Int?) : @@ -553,7 +569,8 @@ public data class ApplicationCommandUpdate(val application: DiscordApplicationCo @Deprecated( "This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " + - "details.", + "details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " + + "0.17.0.", level = DeprecationLevel.ERROR, ) public data class ApplicationCommandDelete(val application: DiscordApplicationCommand, override val sequence: Int?) : diff --git a/gateway/src/commonMain/kotlin/Gateway.kt b/gateway/src/commonMain/kotlin/Gateway.kt index 103a9ed59be..093791d17e6 100644 --- a/gateway/src/commonMain/kotlin/Gateway.kt +++ b/gateway/src/commonMain/kotlin/Gateway.kt @@ -140,7 +140,10 @@ public suspend inline fun Gateway.start(token: String, config: GatewayConfigurat } @Suppress("unused") -@Deprecated("Binary compatibility, remove after deprecation cycle.", level = DeprecationLevel.HIDDEN) +@Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.16.0.", + level = DeprecationLevel.HIDDEN, +) @PublishedApi internal val gatewayOnLogger: mu.KLogger = mu.KotlinLogging.logger("Gateway.on") diff --git a/gateway/src/commonMain/kotlin/Utils.kt b/gateway/src/commonMain/kotlin/Utils.kt index 4de4345af29..31ef79fd596 100644 --- a/gateway/src/commonMain/kotlin/Utils.kt +++ b/gateway/src/commonMain/kotlin/Utils.kt @@ -2,6 +2,9 @@ package dev.kord.gateway import mu.KLogger -@Deprecated("Binary compatibility, remove after deprecation cycle.", level = DeprecationLevel.HIDDEN) +@Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.16.0.", + level = DeprecationLevel.HIDDEN, +) @PublishedApi internal fun KLogger.error(throwable: Throwable): Unit = error(throwable) { "" } diff --git a/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt b/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt index d52f91c4a98..58681977b3f 100644 --- a/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt +++ b/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt @@ -26,7 +26,10 @@ public class LoginBuilder { this.intents = Intents(builder) } - @Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN) + @Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.17.0.", + level = DeprecationLevel.HIDDEN, + ) public inline fun intents0(builder: Intents.Builder.() -> Unit) { contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } intents(builder) diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt b/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt index 2ab53bcd710..629fc6ae5db 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/ContainsPlusMinusCopy.kt @@ -81,7 +81,12 @@ internal fun TypeSpec.Builder.addCopy() = addFunction("copy") { context(BitFlags, GenerationContext) internal fun TypeSpec.Builder.addCopy0() = addFunction("copy0") { @OptIn(DelicateKotlinPoetApi::class) - addAnnotation(Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN)) + addAnnotation( + Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.17.0.", + level = DeprecationLevel.HIDDEN, + ) + ) addModifiers(PUBLIC, INLINE) addParameter("builder", type = LambdaTypeName.get(receiver = builderCN, returnType = UNIT)) returns(collectionCN) diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt b/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt index d3e4c0608d5..9751b2e0187 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/DeprecatedNewCompanion.kt @@ -18,7 +18,8 @@ context(BitFlags, GenerationContext) internal fun TypeSpec.Builder.addDeprecatedNewCompanion() { val newCompanion = collectionCN.nestedClass("NewCompanion") val deprecated = Deprecated( - "Renamed to 'Companion'.", + "Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will " + + "be removed in 0.17.0.", ReplaceWith("${collectionCN.simpleName}.Companion", imports = arrayOf(collectionCN.canonicalName)), LEVEL, ) diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt b/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt index 796e02c2750..8d62c4af4e1 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/FactoryFunctions.kt @@ -34,7 +34,12 @@ internal fun FileSpec.Builder.addFactoryFunctions() { @OptIn(DelicateKotlinPoetApi::class) addFunction(factoryFunctionName + '0') { addAnnotation(Suppress("FunctionName")) - addAnnotation(Deprecated("Binary compatibility, keep for some releases.", level = DeprecationLevel.HIDDEN)) + addAnnotation( + Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.17.0.", + level = DeprecationLevel.HIDDEN, + ) + ) addModifiers(PUBLIC, INLINE) addParameter("builder", type = LambdaTypeName.get(receiver = builderCN, returnType = UNIT)) { defaultValue("{}") diff --git a/rest/src/commonMain/kotlin/route/DiscordCdn.kt b/rest/src/commonMain/kotlin/route/DiscordCdn.kt index 0ea69a8aade..994578eaad7 100644 --- a/rest/src/commonMain/kotlin/route/DiscordCdn.kt +++ b/rest/src/commonMain/kotlin/route/DiscordCdn.kt @@ -21,7 +21,8 @@ public object DiscordCdn { public fun userBanner(userId: Snowflake, hash: String): CdnUrl = CdnUrl("$BASE_URL/banners/$userId/$hash") @Deprecated( - "Renamed to 'defaultUserAvatar' to align name with documentation and overload taking Snowflake.", + "Renamed to 'defaultUserAvatar' to align name with documentation and overload taking Snowflake. This " + + "declaration will be removed in 0.16.0.", ReplaceWith("DiscordCdn.defaultUserAvatar(discriminator)", imports = ["dev.kord.rest.route.DiscordCdn"]), DeprecationLevel.HIDDEN, ) diff --git a/voice/src/main/kotlin/gateway/VoiceEvent.kt b/voice/src/main/kotlin/gateway/VoiceEvent.kt index 711f216c223..edce66dbd63 100644 --- a/voice/src/main/kotlin/gateway/VoiceEvent.kt +++ b/voice/src/main/kotlin/gateway/VoiceEvent.kt @@ -109,7 +109,8 @@ public data class Speaking( public object Resumed : VoiceEvent() { @Deprecated( "'Resumed' is no longer serializable, deserialize it with 'VoiceEvent.DeserializationStrategy' instead. " + - "Deprecated without a replacement.", + "Deprecated without a replacement. The deprecation level will be raised to HIDDEN in 0.16.0 and this " + + "declaration will be removed in 0.17.0.", level = DeprecationLevel.ERROR, ) public fun serializer(): KSerializer = Serializer diff --git a/voice/src/main/kotlin/gateway/VoiceGateway.kt b/voice/src/main/kotlin/gateway/VoiceGateway.kt index 8d331d3ae18..9e738a4e1eb 100644 --- a/voice/src/main/kotlin/gateway/VoiceGateway.kt +++ b/voice/src/main/kotlin/gateway/VoiceGateway.kt @@ -87,7 +87,10 @@ public interface VoiceGateway { @Suppress("unused") -@Deprecated("Binary compatibility, remove after deprecation cycle.", level = DeprecationLevel.HIDDEN) +@Deprecated( + "Kept for binary compatibility, this declaration will be removed in 0.16.0.", + level = DeprecationLevel.HIDDEN, +) @PublishedApi internal val voiceGatewayOnLogger: mu.KLogger = mu.KotlinLogging.logger("Gateway.on")