From 6e6cd50189fca99ee56523ed2b1e72549c9d240f Mon Sep 17 00:00:00 2001 From: lukellmann Date: Tue, 19 Sep 2023 13:27:07 +0200 Subject: [PATCH] Bump DeprecationLevels WARNING -> ERROR ERROR -> HIDDEN HIDDEN -> remove --- common/api/common.api | 32 ++--- .../dev/kord/common/entity/ActivityType.kt | 1 + .../kord/common/entity/AllowedMentionType.kt | 1 + .../entity/ApplicationCommandOptionType.kt | 1 + .../ApplicationCommandPermissionType.kt | 1 + .../common/entity/ApplicationCommandType.kt | 1 + .../dev/kord/common/entity/ApplicationFlag.kt | 32 +++-- .../ApplicationRoleConnectionMetadataType.kt | 1 + .../dev/kord/common/entity/AuditLogEvent.kt | 1 + .../common/entity/AutoModerationActionType.kt | 1 + .../entity/AutoModerationRuleEventType.kt | 1 + .../AutoModerationRuleKeywordPresetType.kt | 1 + .../entity/AutoModerationRuleTriggerType.kt | 1 + .../dev/kord/common/entity/ButtonStyle.kt | 1 + .../dev/kord/common/entity/ChannelFlag.kt | 30 ++-- .../dev/kord/common/entity/ChannelType.kt | 1 + .../dev/kord/common/entity/ComponentType.kt | 1 + .../entity/DefaultMessageNotificationLevel.kt | 1 + .../entity/DiscordConnectionVisibility.kt | 1 + .../dev/kord/common/entity/EmbedType.kt | 1 + .../common/entity/ExplicitContentFilter.kt | 1 + .../dev/kord/common/entity/ForumLayoutType.kt | 1 + .../dev/kord/common/entity/GuildFeature.kt | 1 + .../entity/GuildScheduledEventPrivacyLevel.kt | 1 + .../entity/GuildScheduledEventStatus.kt | 1 + .../entity/IntegrationExpireBehavior.kt | 1 + .../common/entity/InteractionResponseType.kt | 1 + .../dev/kord/common/entity/InteractionType.kt | 1 + .../kord/common/entity/InviteTargetType.kt | 1 + .../kotlin/dev/kord/common/entity/MFALevel.kt | 1 + .../kord/common/entity/MessageActivityType.kt | 1 + .../dev/kord/common/entity/MessageFlag.kt | 31 +++-- .../kord/common/entity/MessageStickerType.kt | 1 + .../dev/kord/common/entity/MessageType.kt | 1 + .../dev/kord/common/entity/NsfwLevel.kt | 1 + .../common/entity/OnboardingPromptType.kt | 1 + .../dev/kord/common/entity/OverwriteType.kt | 1 + .../dev/kord/common/entity/PremiumTier.kt | 1 + .../dev/kord/common/entity/PresenceStatus.kt | 1 + .../kord/common/entity/ScheduledEntityType.kt | 1 + .../dev/kord/common/entity/SortOrderType.kt | 1 + .../entity/StageInstancePrivacyLevel.kt | 1 + .../kord/common/entity/TeamMembershipState.kt | 1 + .../dev/kord/common/entity/TextInputStyle.kt | 1 + .../dev/kord/common/entity/UserPremium.kt | 1 + .../kord/common/entity/VerificationLevel.kt | 1 + .../kord/common/entity/VideoQualityMode.kt | 1 + .../dev/kord/common/entity/WebhookType.kt | 1 + .../commonMain/kotlin/entity/ActivityFlag.kt | 13 +- .../commonMain/kotlin/entity/DiscordShard.kt | 6 +- .../commonMain/kotlin/entity/DiscordUser.kt | 4 +- .../kotlin/entity/GuildMemberFlag.kt | 17 ++- .../commonMain/kotlin/entity/Interactions.kt | 6 +- .../commonMain/kotlin/entity/Permission.kt | 37 +++-- .../kotlin/entity/SystemChannelFlag.kt | 21 +-- .../src/commonMain/kotlin/entity/UserFlag.kt | 40 +++--- .../commonTest/kotlin/json/PermissionsTest.kt | 2 +- core/api/core.api | 105 +------------- core/src/commonMain/kotlin/Kord.kt | 3 +- core/src/commonMain/kotlin/Util.kt | 18 +-- .../kotlin/behavior/GuildBehavior.kt | 2 +- .../channel/TopGuildMessageChannelBehavior.kt | 22 +-- .../kotlin/cache/DataCacheExtensions.kt | 7 - core/src/commonMain/kotlin/entity/Emoji.kt | 7 - core/src/commonMain/kotlin/entity/Guild.kt | 103 ++------------ core/src/commonMain/kotlin/entity/Icon.kt | 68 ---------- .../commonMain/kotlin/entity/Integration.kt | 11 -- core/src/commonMain/kotlin/entity/Member.kt | 10 +- core/src/commonMain/kotlin/entity/Message.kt | 2 +- .../commonMain/kotlin/entity/PartialGuild.kt | 79 ----------- core/src/commonMain/kotlin/entity/Role.kt | 4 - core/src/commonMain/kotlin/entity/Team.kt | 8 +- core/src/commonMain/kotlin/entity/User.kt | 128 ------------------ .../entity/channel/thread/ThreadChannel.kt | 8 -- .../entity/component/SelectMenuComponent.kt | 2 +- .../channel/thread/ThreadListSyncEvent.kt | 6 - .../commonMain/kotlin/event/gateway/Events.kt | 7 - gateway/src/commonMain/kotlin/Event.kt | 6 +- gateway/src/commonMain/kotlin/Intent.kt | 29 ++-- gateway/src/commonMain/kotlin/OpCode.kt | 6 +- .../commonMain/kotlin/builder/LoginBuilder.kt | 4 +- .../generation/bitflags/BitFlagsGeneration.kt | 2 +- .../kotlin/generation/bitflags/Builder.kt | 2 +- .../generation/bitflags/DataClassArtifacts.kt | 2 +- .../generation/bitflags/EnumArtifacts.kt | 4 +- .../generation/kordenum/KordEnumGeneration.kt | 2 +- rest/api/rest.api | 14 +- .../AutoModerationRuleBuilder.kt | 2 +- .../AutoModerationRuleCreateBuilder.kt | 6 +- .../AutoModerationRuleModifyBuilder.kt | 2 +- .../builder/component/SelectMenuBuilder.kt | 2 +- .../builder/interaction/InputChatBuilders.kt | 15 -- .../json/request/InteractionsRequests.kt | 2 +- .../kotlin/service/AutoModerationService.kt | 2 +- .../kotlin/service/InteractionService.kt | 2 +- voice/api/voice.api | 4 +- .../kotlin/dev/kord/voice/EncryptionMode.kt | 1 + voice/src/main/kotlin/SpeakingFlag.kt | 12 +- 98 files changed, 283 insertions(+), 753 deletions(-) delete mode 100644 core/src/commonMain/kotlin/entity/Icon.kt diff --git a/common/api/common.api b/common/api/common.api index fa5813b7358b..919622cb1a23 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -195,7 +195,7 @@ public abstract class dev/kord/common/entity/ActivityFlag { public synthetic fun (ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun equals (Ljava/lang/Object;)Z public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun getValue ()I public final fun hashCode ()I @@ -211,7 +211,7 @@ public abstract class dev/kord/common/entity/ActivityFlag { public final class dev/kord/common/entity/ActivityFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/ActivityFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ActivityFlag; public fun values ()[Ldev/kord/common/entity/ActivityFlag; } @@ -640,7 +640,7 @@ public abstract class dev/kord/common/entity/ApplicationFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -663,7 +663,7 @@ public final class dev/kord/common/entity/ApplicationFlag$ApplicationCommandBadg public final class dev/kord/common/entity/ApplicationFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/ApplicationFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ApplicationFlag; public fun values ()[Ldev/kord/common/entity/ApplicationFlag; } @@ -1701,7 +1701,7 @@ public abstract class dev/kord/common/entity/ChannelFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -1716,7 +1716,7 @@ public abstract class dev/kord/common/entity/ChannelFlag { public final class dev/kord/common/entity/ChannelFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/ChannelFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ChannelFlag; public fun values ()[Ldev/kord/common/entity/ChannelFlag; } @@ -6918,7 +6918,7 @@ public abstract class dev/kord/common/entity/GuildMemberFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -6937,7 +6937,7 @@ public final class dev/kord/common/entity/GuildMemberFlag$BypassesVerification : public final class dev/kord/common/entity/GuildMemberFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/GuildMemberFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun serializer ()Lkotlinx/serialization/KSerializer; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/GuildMemberFlag; public fun values ()[Ldev/kord/common/entity/GuildMemberFlag; @@ -7500,7 +7500,7 @@ public abstract class dev/kord/common/entity/MessageFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -7515,7 +7515,7 @@ public abstract class dev/kord/common/entity/MessageFlag { public final class dev/kord/common/entity/MessageFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/MessageFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/MessageFlag; public fun values ()[Ldev/kord/common/entity/MessageFlag; } @@ -8114,10 +8114,6 @@ public final class dev/kord/common/entity/Permission$ManageChannels : dev/kord/c public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageChannels; } -public final class dev/kord/common/entity/Permission$ManageEmojisAndStickers : dev/kord/common/entity/Permission { - public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageEmojisAndStickers; -} - public final class dev/kord/common/entity/Permission$ManageEvents : dev/kord/common/entity/Permission { public static final field INSTANCE Ldev/kord/common/entity/Permission$ManageEvents; } @@ -8736,7 +8732,7 @@ public abstract class dev/kord/common/entity/SystemChannelFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -8751,7 +8747,7 @@ public abstract class dev/kord/common/entity/SystemChannelFlag { public final class dev/kord/common/entity/SystemChannelFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/SystemChannelFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/SystemChannelFlag; public fun values ()[Ldev/kord/common/entity/SystemChannelFlag; } @@ -8943,7 +8939,7 @@ public abstract class dev/kord/common/entity/UserFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -8974,7 +8970,7 @@ public final class dev/kord/common/entity/UserFlag$BugHunterLevel2 : dev/kord/co public final class dev/kord/common/entity/UserFlag$Companion { public final fun fromShift (I)Ldev/kord/common/entity/UserFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/UserFlag; public fun values ()[Ldev/kord/common/entity/UserFlag; } diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ActivityType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ActivityType.kt index a5fac93d4e08..72c14c510f73 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ActivityType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ActivityType.kt @@ -43,6 +43,7 @@ public sealed class ActivityType( unused: Nothing?, ) : ActivityType(code) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ActivityType.from()'.", replaceWith = ReplaceWith(expression = "ActivityType.from(code)", imports = arrayOf("dev.kord.common.entity.ActivityType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AllowedMentionType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AllowedMentionType.kt index 997fcf54c1ae..e4e02acd38f6 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AllowedMentionType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AllowedMentionType.kt @@ -44,6 +44,7 @@ public sealed class AllowedMentionType( unused: Nothing?, ) : AllowedMentionType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AllowedMentionType.from()'.", replaceWith = ReplaceWith(expression = "AllowedMentionType.from(value)", imports = arrayOf("dev.kord.common.entity.AllowedMentionType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandOptionType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandOptionType.kt index 04a8b6dc327e..60a8f3114ae1 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandOptionType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandOptionType.kt @@ -45,6 +45,7 @@ public sealed class ApplicationCommandOptionType( unused: Nothing?, ) : ApplicationCommandOptionType(type) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ApplicationCommandOptionType.from()'.", replaceWith = ReplaceWith(expression = "ApplicationCommandOptionType.from(type)", imports = arrayOf("dev.kord.common.entity.ApplicationCommandOptionType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandPermissionType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandPermissionType.kt index 45ea5e2a7fb2..c3f7d30aa641 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandPermissionType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandPermissionType.kt @@ -45,6 +45,7 @@ public sealed class ApplicationCommandPermissionType( unused: Nothing?, ) : ApplicationCommandPermissionType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ApplicationCommandPermissionType.from()'.", replaceWith = ReplaceWith(expression = "ApplicationCommandPermissionType.from(value)", imports = diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandType.kt index 8cd20a0f1355..381f674d87c5 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationCommandType.kt @@ -44,6 +44,7 @@ public sealed class ApplicationCommandType( unused: Nothing?, ) : ApplicationCommandType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ApplicationCommandType.from()'.", replaceWith = ReplaceWith(expression = "ApplicationCommandType.from(value)", imports = arrayOf("dev.kord.common.entity.ApplicationCommandType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationFlag.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationFlag.kt index 82a8d413dc42..34a14eb65957 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationFlag.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationFlag.kt @@ -69,16 +69,20 @@ public sealed class ApplicationFlag( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ApplicationFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun name(): String = this::class.simpleName!! /** * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ApplicationFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ApplicationFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun ordinal(): Int = when (this) { ApplicationAutoModerationRuleCreateBadge -> 0 GatewayPresence -> 1 @@ -97,6 +101,7 @@ public sealed class ApplicationFlag( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "ApplicationFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ApplicationFlag::class.java", imports = arrayOf("dev.kord.common.entity.ApplicationFlag")), @@ -289,8 +294,11 @@ public sealed class ApplicationFlag( * @suppress */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ApplicationFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = + "ApplicationFlag is no longer an enum class. Deprecated without a replacement.", + ) @JvmStatic public open fun valueOf(name: String): ApplicationFlag = when (name) { "ApplicationAutoModerationRuleCreateBadge" -> ApplicationAutoModerationRuleCreateBadge @@ -311,6 +319,7 @@ public sealed class ApplicationFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT")) @Deprecated( + level = DeprecationLevel.ERROR, message = "ApplicationFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ApplicationFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.ApplicationFlag")), @@ -323,7 +332,7 @@ public sealed class ApplicationFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "ApplicationFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ApplicationFlag.entries", imports = arrayOf("dev.kord.common.entity.ApplicationFlag")), @@ -433,6 +442,7 @@ public class ApplicationFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), ) @@ -498,6 +508,7 @@ public class ApplicationFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "ApplicationFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), ) @@ -507,8 +518,10 @@ public class ApplicationFlags internal constructor( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ApplicationFlags is no longer a data class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ApplicationFlags is no longer a data class. Deprecated without a replacement.", + ) public fun copy(code: Int = this.code): ApplicationFlags = ApplicationFlags(code) public class Builder( @@ -552,6 +565,7 @@ public class ApplicationFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "Renamed to 'build'", replaceWith = ReplaceWith(expression = "this.build()", imports = arrayOf()), ) diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt index 152bb45adf75..ae63dcacc6b6 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt @@ -50,6 +50,7 @@ public sealed class ApplicationRoleConnectionMetadataType( unused: Nothing?, ) : ApplicationRoleConnectionMetadataType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ApplicationRoleConnectionMetadataType.from()'.", replaceWith = ReplaceWith(expression = "ApplicationRoleConnectionMetadataType.from(value)", imports = diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AuditLogEvent.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AuditLogEvent.kt index 483744b2c3bc..f509907f1631 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AuditLogEvent.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AuditLogEvent.kt @@ -44,6 +44,7 @@ public sealed class AuditLogEvent( unused: Nothing?, ) : AuditLogEvent(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AuditLogEvent.from()'.", replaceWith = ReplaceWith(expression = "AuditLogEvent.from(value)", imports = arrayOf("dev.kord.common.entity.AuditLogEvent")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationActionType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationActionType.kt index ec446f87465d..fdce78153512 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationActionType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationActionType.kt @@ -47,6 +47,7 @@ public sealed class AutoModerationActionType( unused: Nothing?, ) : AutoModerationActionType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AutoModerationActionType.from()'.", replaceWith = ReplaceWith(expression = "AutoModerationActionType.from(value)", imports = arrayOf("dev.kord.common.entity.AutoModerationActionType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleEventType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleEventType.kt index a02a5567330a..5a8a730a86f8 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleEventType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleEventType.kt @@ -47,6 +47,7 @@ public sealed class AutoModerationRuleEventType( unused: Nothing?, ) : AutoModerationRuleEventType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AutoModerationRuleEventType.from()'.", replaceWith = ReplaceWith(expression = "AutoModerationRuleEventType.from(value)", imports = arrayOf("dev.kord.common.entity.AutoModerationRuleEventType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleKeywordPresetType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleKeywordPresetType.kt index 43814d201d31..8fdb39b305fa 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleKeywordPresetType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleKeywordPresetType.kt @@ -47,6 +47,7 @@ public sealed class AutoModerationRuleKeywordPresetType( unused: Nothing?, ) : AutoModerationRuleKeywordPresetType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AutoModerationRuleKeywordPresetType.from()'.", replaceWith = ReplaceWith(expression = "AutoModerationRuleKeywordPresetType.from(value)", imports = diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleTriggerType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleTriggerType.kt index 2999d023b91d..b0e7b08c1dcf 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleTriggerType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/AutoModerationRuleTriggerType.kt @@ -47,6 +47,7 @@ public sealed class AutoModerationRuleTriggerType( unused: Nothing?, ) : AutoModerationRuleTriggerType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'AutoModerationRuleTriggerType.from()'.", replaceWith = ReplaceWith(expression = "AutoModerationRuleTriggerType.from(value)", imports = arrayOf("dev.kord.common.entity.AutoModerationRuleTriggerType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ButtonStyle.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ButtonStyle.kt index f675ae5a3c24..15bad34a45f0 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ButtonStyle.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ButtonStyle.kt @@ -45,6 +45,7 @@ public sealed class ButtonStyle( unused: Nothing?, ) : ButtonStyle(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ButtonStyle.from()'.", replaceWith = ReplaceWith(expression = "ButtonStyle.from(value)", imports = arrayOf("dev.kord.common.entity.ButtonStyle")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelFlag.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelFlag.kt index 7c74296b3b49..5a4e384f629c 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelFlag.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelFlag.kt @@ -67,16 +67,20 @@ public sealed class ChannelFlag( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ChannelFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun name(): String = this::class.simpleName!! /** * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ChannelFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun ordinal(): Int = when (this) { Pinned -> 0 RequireTag -> 1 @@ -88,6 +92,7 @@ public sealed class ChannelFlag( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "ChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ChannelFlag::class.java", imports = arrayOf("dev.kord.common.entity.ChannelFlag")), @@ -165,8 +170,10 @@ public sealed class ChannelFlag( * @suppress */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ChannelFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ChannelFlag is no longer an enum class. Deprecated without a replacement.", + ) @JvmStatic public open fun valueOf(name: String): ChannelFlag = when (name) { "Pinned" -> Pinned @@ -180,6 +187,7 @@ public sealed class ChannelFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT")) @Deprecated( + level = DeprecationLevel.ERROR, message = "ChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ChannelFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.ChannelFlag")), @@ -192,7 +200,7 @@ public sealed class ChannelFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "ChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ChannelFlag.entries", imports = arrayOf("dev.kord.common.entity.ChannelFlag")), @@ -300,6 +308,7 @@ public class ChannelFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), ) @@ -363,6 +372,7 @@ public class ChannelFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "ChannelFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), ) @@ -372,8 +382,10 @@ public class ChannelFlags internal constructor( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "ChannelFlags is no longer a data class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "ChannelFlags is no longer a data class. Deprecated without a replacement.", + ) public fun copy(code: Int = this.code): ChannelFlags = ChannelFlags(code) public class Builder( diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelType.kt index 34efb7755ec7..09251c1f71f5 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ChannelType.kt @@ -43,6 +43,7 @@ public sealed class ChannelType( unused: Nothing?, ) : ChannelType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ChannelType.from()'.", replaceWith = ReplaceWith(expression = "ChannelType.from(value)", imports = arrayOf("dev.kord.common.entity.ChannelType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ComponentType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ComponentType.kt index 7f5e38fd1a12..5d51382e475e 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ComponentType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ComponentType.kt @@ -44,6 +44,7 @@ public sealed class ComponentType( unused: Nothing?, ) : ComponentType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ComponentType.from()'.", replaceWith = ReplaceWith(expression = "ComponentType.from(value)", imports = arrayOf("dev.kord.common.entity.ComponentType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DefaultMessageNotificationLevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DefaultMessageNotificationLevel.kt index 661b98088c13..8f77fad7db69 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DefaultMessageNotificationLevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DefaultMessageNotificationLevel.kt @@ -45,6 +45,7 @@ public sealed class DefaultMessageNotificationLevel( unused: Nothing?, ) : DefaultMessageNotificationLevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'DefaultMessageNotificationLevel.from()'.", replaceWith = ReplaceWith(expression = "DefaultMessageNotificationLevel.from(value)", imports = diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DiscordConnectionVisibility.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DiscordConnectionVisibility.kt index 5b1bb98749aa..87ee811b28f0 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DiscordConnectionVisibility.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/DiscordConnectionVisibility.kt @@ -45,6 +45,7 @@ public sealed class DiscordConnectionVisibility( unused: Nothing?, ) : DiscordConnectionVisibility(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'DiscordConnectionVisibility.from()'.", replaceWith = ReplaceWith(expression = "DiscordConnectionVisibility.from(value)", imports = arrayOf("dev.kord.common.entity.DiscordConnectionVisibility")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/EmbedType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/EmbedType.kt index cabd4c2f6206..df2e2d017053 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/EmbedType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/EmbedType.kt @@ -43,6 +43,7 @@ public sealed class EmbedType( unused: Nothing?, ) : EmbedType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'EmbedType.from()'.", replaceWith = ReplaceWith(expression = "EmbedType.from(value)", imports = arrayOf("dev.kord.common.entity.EmbedType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ExplicitContentFilter.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ExplicitContentFilter.kt index bac13ad188b0..58879effa7f5 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ExplicitContentFilter.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ExplicitContentFilter.kt @@ -44,6 +44,7 @@ public sealed class ExplicitContentFilter( unused: Nothing?, ) : ExplicitContentFilter(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ExplicitContentFilter.from()'.", replaceWith = ReplaceWith(expression = "ExplicitContentFilter.from(value)", imports = arrayOf("dev.kord.common.entity.ExplicitContentFilter")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ForumLayoutType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ForumLayoutType.kt index 7e4e9e800a1b..309d8987afc9 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ForumLayoutType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ForumLayoutType.kt @@ -44,6 +44,7 @@ public sealed class ForumLayoutType( unused: Nothing?, ) : ForumLayoutType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ForumLayoutType.from()'.", replaceWith = ReplaceWith(expression = "ForumLayoutType.from(value)", imports = arrayOf("dev.kord.common.entity.ForumLayoutType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildFeature.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildFeature.kt index a2490500c911..a170b01f0140 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildFeature.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildFeature.kt @@ -44,6 +44,7 @@ public sealed class GuildFeature( unused: Nothing?, ) : GuildFeature(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'GuildFeature.from()'.", replaceWith = ReplaceWith(expression = "GuildFeature.from(value)", imports = arrayOf("dev.kord.common.entity.GuildFeature")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventPrivacyLevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventPrivacyLevel.kt index d2fe6ed1e4e8..829877e11185 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventPrivacyLevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventPrivacyLevel.kt @@ -45,6 +45,7 @@ public sealed class GuildScheduledEventPrivacyLevel( unused: Nothing?, ) : GuildScheduledEventPrivacyLevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'GuildScheduledEventPrivacyLevel.from()'.", replaceWith = ReplaceWith(expression = "GuildScheduledEventPrivacyLevel.from(value)", imports = diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventStatus.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventStatus.kt index f30cde217be6..d4ba1e04cf2a 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventStatus.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/GuildScheduledEventStatus.kt @@ -45,6 +45,7 @@ public sealed class GuildScheduledEventStatus( unused: Nothing?, ) : GuildScheduledEventStatus(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'GuildScheduledEventStatus.from()'.", replaceWith = ReplaceWith(expression = "GuildScheduledEventStatus.from(value)", imports = arrayOf("dev.kord.common.entity.GuildScheduledEventStatus")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/IntegrationExpireBehavior.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/IntegrationExpireBehavior.kt index a088ef955437..1200abb581fb 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/IntegrationExpireBehavior.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/IntegrationExpireBehavior.kt @@ -45,6 +45,7 @@ public sealed class IntegrationExpireBehavior( unused: Nothing?, ) : IntegrationExpireBehavior(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'IntegrationExpireBehavior.from()'.", replaceWith = ReplaceWith(expression = "IntegrationExpireBehavior.from(value)", imports = arrayOf("dev.kord.common.entity.IntegrationExpireBehavior")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionResponseType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionResponseType.kt index f470bd477ebb..5f55e9302d5b 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionResponseType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionResponseType.kt @@ -45,6 +45,7 @@ public sealed class InteractionResponseType( unused: Nothing?, ) : InteractionResponseType(type) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'InteractionResponseType.from()'.", replaceWith = ReplaceWith(expression = "InteractionResponseType.from(type)", imports = arrayOf("dev.kord.common.entity.InteractionResponseType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionType.kt index a868d6772f7a..e74129248d1f 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InteractionType.kt @@ -44,6 +44,7 @@ public sealed class InteractionType( unused: Nothing?, ) : InteractionType(type) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'InteractionType.from()'.", replaceWith = ReplaceWith(expression = "InteractionType.from(type)", imports = arrayOf("dev.kord.common.entity.InteractionType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InviteTargetType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InviteTargetType.kt index 7f82eb6eb499..2bf9eb6387f0 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InviteTargetType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/InviteTargetType.kt @@ -44,6 +44,7 @@ public sealed class InviteTargetType( unused: Nothing?, ) : InviteTargetType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'InviteTargetType.from()'.", replaceWith = ReplaceWith(expression = "InviteTargetType.from(value)", imports = arrayOf("dev.kord.common.entity.InviteTargetType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MFALevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MFALevel.kt index cc6b5acc1788..af7fade1e2f1 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MFALevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MFALevel.kt @@ -43,6 +43,7 @@ public sealed class MFALevel( unused: Nothing?, ) : MFALevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'MFALevel.from()'.", replaceWith = ReplaceWith(expression = "MFALevel.from(value)", imports = arrayOf("dev.kord.common.entity.MFALevel")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageActivityType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageActivityType.kt index df7777cebf65..2b1084c07930 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageActivityType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageActivityType.kt @@ -44,6 +44,7 @@ public sealed class MessageActivityType( unused: Nothing?, ) : MessageActivityType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'MessageActivityType.from()'.", replaceWith = ReplaceWith(expression = "MessageActivityType.from(value)", imports = arrayOf("dev.kord.common.entity.MessageActivityType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageFlag.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageFlag.kt index 29f3816f0559..81fcc40b4c80 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageFlag.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageFlag.kt @@ -67,16 +67,20 @@ public sealed class MessageFlag( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "MessageFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "MessageFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun name(): String = this::class.simpleName!! /** * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "MessageFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "MessageFlag is no longer an enum class. Deprecated without a replacement.", + ) public fun ordinal(): Int = when (this) { CrossPosted -> 0 IsCrossPost -> 1 @@ -96,6 +100,7 @@ public sealed class MessageFlag( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "MessageFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "MessageFlag::class.java", imports = arrayOf("dev.kord.common.entity.MessageFlag")), @@ -289,8 +294,10 @@ public sealed class MessageFlag( * @suppress */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "MessageFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "MessageFlag is no longer an enum class. Deprecated without a replacement.", + ) @JvmStatic public open fun valueOf(name: String): MessageFlag = when (name) { "CrossPosted" -> CrossPosted @@ -312,6 +319,7 @@ public sealed class MessageFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT")) @Deprecated( + level = DeprecationLevel.ERROR, message = "MessageFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "MessageFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.MessageFlag")), @@ -324,7 +332,7 @@ public sealed class MessageFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "MessageFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "MessageFlag.entries", imports = arrayOf("dev.kord.common.entity.MessageFlag")), @@ -432,6 +440,7 @@ public class MessageFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), ) @@ -495,6 +504,7 @@ public class MessageFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "MessageFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), ) @@ -504,8 +514,10 @@ public class MessageFlags internal constructor( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = - "MessageFlags is no longer a data class. Deprecated without a replacement.") + @Deprecated( + level = DeprecationLevel.ERROR, + message = "MessageFlags is no longer a data class. Deprecated without a replacement.", + ) public fun copy(code: Int = this.code): MessageFlags = MessageFlags(code) public class Builder( @@ -549,6 +561,7 @@ public class MessageFlags internal constructor( * @suppress */ @Deprecated( + level = DeprecationLevel.ERROR, message = "Renamed to 'build'", replaceWith = ReplaceWith(expression = "this.build()", imports = arrayOf()), ) diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageStickerType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageStickerType.kt index a3c7db902a5e..2d2202873042 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageStickerType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageStickerType.kt @@ -44,6 +44,7 @@ public sealed class MessageStickerType( unused: Nothing?, ) : MessageStickerType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'MessageStickerType.from()'.", replaceWith = ReplaceWith(expression = "MessageStickerType.from(value)", imports = arrayOf("dev.kord.common.entity.MessageStickerType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageType.kt index 6420bd3ec125..a4006e5be3bf 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/MessageType.kt @@ -43,6 +43,7 @@ public sealed class MessageType( unused: Nothing?, ) : MessageType(code) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'MessageType.from()'.", replaceWith = ReplaceWith(expression = "MessageType.from(code)", imports = arrayOf("dev.kord.common.entity.MessageType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/NsfwLevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/NsfwLevel.kt index 95356c5e2237..3106b681aca2 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/NsfwLevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/NsfwLevel.kt @@ -43,6 +43,7 @@ public sealed class NsfwLevel( unused: Nothing?, ) : NsfwLevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'NsfwLevel.from()'.", replaceWith = ReplaceWith(expression = "NsfwLevel.from(value)", imports = arrayOf("dev.kord.common.entity.NsfwLevel")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OnboardingPromptType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OnboardingPromptType.kt index 0249bf6f15b0..ed9e03649dc0 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OnboardingPromptType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OnboardingPromptType.kt @@ -44,6 +44,7 @@ public sealed class OnboardingPromptType( unused: Nothing?, ) : OnboardingPromptType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'OnboardingPromptType.from()'.", replaceWith = ReplaceWith(expression = "OnboardingPromptType.from(value)", imports = arrayOf("dev.kord.common.entity.OnboardingPromptType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OverwriteType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OverwriteType.kt index b06593f87aab..a6ac283d83f7 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OverwriteType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/OverwriteType.kt @@ -44,6 +44,7 @@ public sealed class OverwriteType( unused: Nothing?, ) : OverwriteType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'OverwriteType.from()'.", replaceWith = ReplaceWith(expression = "OverwriteType.from(value)", imports = arrayOf("dev.kord.common.entity.OverwriteType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PremiumTier.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PremiumTier.kt index 791183bc1515..8c33a7f8588a 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PremiumTier.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PremiumTier.kt @@ -43,6 +43,7 @@ public sealed class PremiumTier( unused: Nothing?, ) : PremiumTier(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'PremiumTier.from()'.", replaceWith = ReplaceWith(expression = "PremiumTier.from(value)", imports = arrayOf("dev.kord.common.entity.PremiumTier")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PresenceStatus.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PresenceStatus.kt index c32a3ba26822..dafd67c6f891 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PresenceStatus.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/PresenceStatus.kt @@ -44,6 +44,7 @@ public sealed class PresenceStatus( unused: Nothing?, ) : PresenceStatus(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'PresenceStatus.from()'.", replaceWith = ReplaceWith(expression = "PresenceStatus.from(value)", imports = arrayOf("dev.kord.common.entity.PresenceStatus")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ScheduledEntityType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ScheduledEntityType.kt index 591985b19c9f..16598b6dfb31 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ScheduledEntityType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ScheduledEntityType.kt @@ -44,6 +44,7 @@ public sealed class ScheduledEntityType( unused: Nothing?, ) : ScheduledEntityType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'ScheduledEntityType.from()'.", replaceWith = ReplaceWith(expression = "ScheduledEntityType.from(value)", imports = arrayOf("dev.kord.common.entity.ScheduledEntityType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SortOrderType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SortOrderType.kt index 49f5270b6205..42b83e7b2208 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SortOrderType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/SortOrderType.kt @@ -44,6 +44,7 @@ public sealed class SortOrderType( unused: Nothing?, ) : SortOrderType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'SortOrderType.from()'.", replaceWith = ReplaceWith(expression = "SortOrderType.from(value)", imports = arrayOf("dev.kord.common.entity.SortOrderType")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/StageInstancePrivacyLevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/StageInstancePrivacyLevel.kt index c4b5c1f9c882..c87a1efa31ac 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/StageInstancePrivacyLevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/StageInstancePrivacyLevel.kt @@ -45,6 +45,7 @@ public sealed class StageInstancePrivacyLevel( unused: Nothing?, ) : StageInstancePrivacyLevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'StageInstancePrivacyLevel.from()'.", replaceWith = ReplaceWith(expression = "StageInstancePrivacyLevel.from(value)", imports = arrayOf("dev.kord.common.entity.StageInstancePrivacyLevel")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TeamMembershipState.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TeamMembershipState.kt index e4a2ef657562..1d60497e97fc 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TeamMembershipState.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TeamMembershipState.kt @@ -44,6 +44,7 @@ public sealed class TeamMembershipState( unused: Nothing?, ) : TeamMembershipState(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'TeamMembershipState.from()'.", replaceWith = ReplaceWith(expression = "TeamMembershipState.from(value)", imports = arrayOf("dev.kord.common.entity.TeamMembershipState")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TextInputStyle.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TextInputStyle.kt index faa2c6e80ff7..103242190a2a 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TextInputStyle.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/TextInputStyle.kt @@ -46,6 +46,7 @@ public sealed class TextInputStyle( unused: Nothing?, ) : TextInputStyle(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'TextInputStyle.from()'.", replaceWith = ReplaceWith(expression = "TextInputStyle.from(value)", imports = arrayOf("dev.kord.common.entity.TextInputStyle")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserPremium.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserPremium.kt index df20b22b508e..b13e780723d5 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserPremium.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/UserPremium.kt @@ -45,6 +45,7 @@ public sealed class UserPremium( unused: Nothing?, ) : UserPremium(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'UserPremium.from()'.", replaceWith = ReplaceWith(expression = "UserPremium.from(value)", imports = arrayOf("dev.kord.common.entity.UserPremium")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VerificationLevel.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VerificationLevel.kt index e349e5fe00e7..5bfe329e1c79 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VerificationLevel.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VerificationLevel.kt @@ -44,6 +44,7 @@ public sealed class VerificationLevel( unused: Nothing?, ) : VerificationLevel(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'VerificationLevel.from()'.", replaceWith = ReplaceWith(expression = "VerificationLevel.from(value)", imports = arrayOf("dev.kord.common.entity.VerificationLevel")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VideoQualityMode.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VideoQualityMode.kt index 0b8108613698..ad707e5de565 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VideoQualityMode.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/VideoQualityMode.kt @@ -44,6 +44,7 @@ public sealed class VideoQualityMode( unused: Nothing?, ) : VideoQualityMode(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'VideoQualityMode.from()'.", replaceWith = ReplaceWith(expression = "VideoQualityMode.from(value)", imports = arrayOf("dev.kord.common.entity.VideoQualityMode")), diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/WebhookType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/WebhookType.kt index be5ae6e9cf01..1a0cfd8a2ad5 100644 --- a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/WebhookType.kt +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/WebhookType.kt @@ -43,6 +43,7 @@ public sealed class WebhookType( unused: Nothing?, ) : WebhookType(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'WebhookType.from()'.", replaceWith = ReplaceWith(expression = "WebhookType.from(value)", imports = arrayOf("dev.kord.common.entity.WebhookType")), diff --git a/common/src/commonMain/kotlin/entity/ActivityFlag.kt b/common/src/commonMain/kotlin/entity/ActivityFlag.kt index 679dad399464..9f5a1fff4cbf 100644 --- a/common/src/commonMain/kotlin/entity/ActivityFlag.kt +++ b/common/src/commonMain/kotlin/entity/ActivityFlag.kt @@ -68,7 +68,7 @@ public sealed class ActivityFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "ActivityFlag is no longer an enum class. Deprecated without a replacement.") + "ActivityFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun name(): String = this::class.simpleName!! /** @@ -76,7 +76,7 @@ public sealed class ActivityFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "ActivityFlag is no longer an enum class. Deprecated without a replacement.") + "ActivityFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun ordinal(): Int = when (this) { Instance -> 0 Join -> 1 @@ -97,6 +97,7 @@ public sealed class ActivityFlag( message = "ActivityFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ActivityFlag::class.java", imports = arrayOf("dev.kord.common.entity.ActivityFlag")), + DeprecationLevel.ERROR, ) public fun getDeclaringClass(): Class = ActivityFlag::class.java @@ -212,7 +213,7 @@ public sealed class ActivityFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "ActivityFlag is no longer an enum class. Deprecated without a replacement.") + "ActivityFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) @JvmStatic public open fun valueOf(name: String): ActivityFlag = when (name) { "Instance" -> Instance @@ -235,6 +236,7 @@ public sealed class ActivityFlag( message = "ActivityFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ActivityFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.ActivityFlag")), + DeprecationLevel.ERROR, ) @JvmStatic public open fun values(): Array = entries.toTypedArray() @@ -244,7 +246,7 @@ public sealed class ActivityFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "ActivityFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "ActivityFlag.entries", imports = arrayOf("dev.kord.common.entity.ActivityFlag")), @@ -342,7 +344,7 @@ public class ActivityFlags internal constructor( "Don't construct an instance of 'ActivityFlags' from a raw value. Use the factory functions described in the " + "documentation instead.", ReplaceWith("ActivityFlags.Builder(value).build()", "dev.kord.common.entity.ActivityFlags"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(value: Int) : this(value, null) @@ -366,6 +368,7 @@ public class ActivityFlags internal constructor( @Deprecated( message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), + DeprecationLevel.ERROR, ) public val flags: Set get() = values diff --git a/common/src/commonMain/kotlin/entity/DiscordShard.kt b/common/src/commonMain/kotlin/entity/DiscordShard.kt index 2e47c9426750..54317f8125b8 100644 --- a/common/src/commonMain/kotlin/entity/DiscordShard.kt +++ b/common/src/commonMain/kotlin/entity/DiscordShard.kt @@ -33,11 +33,11 @@ public data class DiscordShard(val index: Int, val count: Int) { } public companion object NewCompanion { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("DiscordShard.serializer()", imports = ["dev.kord.common.entity.DiscordShard"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val Companion: Companion = Companion() @@ -46,7 +46,7 @@ public data class DiscordShard(val index: Int, val count: Int) { @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("DiscordShard.serializer()", imports = ["dev.kord.common.entity.DiscordShard"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class Companion internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this diff --git a/common/src/commonMain/kotlin/entity/DiscordUser.kt b/common/src/commonMain/kotlin/entity/DiscordUser.kt index a182df3b553e..2cd6295b0570 100644 --- a/common/src/commonMain/kotlin/entity/DiscordUser.kt +++ b/common/src/commonMain/kotlin/entity/DiscordUser.kt @@ -156,10 +156,10 @@ public data class DiscordOptionallyMemberUser( val member: Optional = Optional.Missing(), ) -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'UserFlags.UserFlagsBuilder' is deprecated, use 'UserFlags.Builder' instead.", - level = WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun UserFlags(builder: UserFlags.UserFlagsBuilder.() -> Unit): UserFlags { diff --git a/common/src/commonMain/kotlin/entity/GuildMemberFlag.kt b/common/src/commonMain/kotlin/entity/GuildMemberFlag.kt index a26d0a09a52d..30b49beb7b94 100644 --- a/common/src/commonMain/kotlin/entity/GuildMemberFlag.kt +++ b/common/src/commonMain/kotlin/entity/GuildMemberFlag.kt @@ -68,7 +68,7 @@ public sealed class GuildMemberFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.") + "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun name(): String = name private val name get() = this::class.simpleName!! @@ -77,7 +77,7 @@ public sealed class GuildMemberFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.") + "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun ordinal(): Int = when (this) { DidRejoin -> 0 CompletedOnboarding -> 1 @@ -93,6 +93,7 @@ public sealed class GuildMemberFlag( message = "GuildMemberFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "GuildMemberFlag::class.java", imports = arrayOf("dev.kord.common.entity.GuildMemberFlag")), + DeprecationLevel.ERROR, ) public fun getDeclaringClass(): Class = GuildMemberFlag::class.java @@ -143,7 +144,7 @@ public sealed class GuildMemberFlag( @Deprecated( "'GuildMemberFlag' is no longer serializable, serialize 'GuildMemberFlags' instead. Deprecated without a " + "replacement.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public fun serializer(): KSerializer = Serializer @@ -202,7 +203,7 @@ public sealed class GuildMemberFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.") + "GuildMemberFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) @JvmStatic public open fun valueOf(name: String): GuildMemberFlag = valueOf0(name) private fun valueOf0(name: String) = when (name) { @@ -221,6 +222,7 @@ public sealed class GuildMemberFlag( message = "GuildMemberFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "GuildMemberFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.GuildMemberFlag")), + DeprecationLevel.ERROR, ) @JvmStatic public open fun values(): Array = entries.toTypedArray() @@ -230,7 +232,7 @@ public sealed class GuildMemberFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "GuildMemberFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "GuildMemberFlag.entries", imports = arrayOf("dev.kord.common.entity.GuildMemberFlag")), @@ -331,7 +333,7 @@ public class GuildMemberFlags internal constructor( "Don't construct an instance of 'GuildMemberFlags' from a raw code. Use the factory functions described in " + "the documentation instead.", ReplaceWith("GuildMemberFlags.Builder(code).build()", "dev.kord.common.entity.GuildMemberFlags"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(code: Int) : this(code, null) @@ -410,6 +412,7 @@ public class GuildMemberFlags internal constructor( @Deprecated( message = "GuildMemberFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), + DeprecationLevel.ERROR, ) public operator fun component1(): Int = code @@ -418,7 +421,7 @@ public class GuildMemberFlags internal constructor( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "GuildMemberFlags is no longer a data class. Deprecated without a replacement.") + "GuildMemberFlags is no longer a data class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun copy(code: Int = this.code): GuildMemberFlags = GuildMemberFlags(code, null) public class Builder( diff --git a/common/src/commonMain/kotlin/entity/Interactions.kt b/common/src/commonMain/kotlin/entity/Interactions.kt index e23c89b5ed76..cc186b30b1c2 100644 --- a/common/src/commonMain/kotlin/entity/Interactions.kt +++ b/common/src/commonMain/kotlin/entity/Interactions.kt @@ -155,7 +155,7 @@ public data class ApplicationCommandOption( * e.g: `Choice<@Serializable(NotSerializable::class) Any?>` * The serialization is handled by [Choice] serializer instead where we don't care about the generic type. */ -@Deprecated("This is no longer used, deprecated without a replacement.", level = DeprecationLevel.WARNING) +@Deprecated("This is no longer used, deprecated without a replacement.", level = DeprecationLevel.ERROR) @KordExperimental public object NotSerializable : KSerializer { override fun deserialize(decoder: Decoder): Nothing = error("This operation is not supported.") @@ -244,7 +244,7 @@ public sealed class Choice { public companion object { @Suppress("UNUSED_PARAMETER") - @Deprecated("Choice is no longer generic", ReplaceWith("this.serializer()"), DeprecationLevel.WARNING) + @Deprecated("Choice is no longer generic", ReplaceWith("this.serializer()"), DeprecationLevel.ERROR) public fun serializer(typeSerial0: KSerializer): KSerializer = serializer() } } @@ -718,7 +718,7 @@ public data class DiscordAutoComplete( @Deprecated( "DiscordAutoComplete is no longer generic", ReplaceWith("this.serializer()"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public fun serializer(typeSerial0: KSerializer): KSerializer = serializer() } diff --git a/common/src/commonMain/kotlin/entity/Permission.kt b/common/src/commonMain/kotlin/entity/Permission.kt index 8e9e6523c5f8..488c5ef1b963 100644 --- a/common/src/commonMain/kotlin/entity/Permission.kt +++ b/common/src/commonMain/kotlin/entity/Permission.kt @@ -108,14 +108,14 @@ public sealed class Permission { @Deprecated( "Construct an unknown 'Permission' with 'Permission.fromShift()' instead.", ReplaceWith("Permission.fromShift(TODO())", imports = ["dev.kord.common.entity.Permission"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(code: DiscordBitSet) : super(code) @Deprecated( "Construct an unknown 'Permission' with 'Permission.fromShift()' instead.", ReplaceWith("Permission.fromShift(TODO())", imports = ["dev.kord.common.entity.Permission"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(vararg values: Long) : super(DiscordBitSet(values)) } @@ -273,12 +273,6 @@ public sealed class Permission { */ public object ManageWebhooks : Permission(29) - /** - * Allows management and editing of emojis and stickers. - */ - @Deprecated("Renamed by discord", ReplaceWith("ManageGuildExpressions"), DeprecationLevel.HIDDEN) - public object ManageEmojisAndStickers : Permission(30) - /** * Allows management and editing of emojis, stickers, and soundboard sounds. */ @@ -364,7 +358,7 @@ public sealed class Permission { @Deprecated( "'Permission.All' is not a proper 'Permission' instance. Replace with 'Permissions.ALL'.", ReplaceWith("Permissions.ALL", imports = ["dev.kord.common.entity.Permissions", "dev.kord.common.entity.ALL"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public object All : Permission(Permissions.ALL.code) @@ -427,7 +421,7 @@ public sealed class Permission { @Deprecated( "Renamed to 'entries'.", ReplaceWith("Permission.entries", imports = ["dev.kord.common.entity.Permission"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public val values: Set get() = entries.toSet() @@ -565,7 +559,7 @@ public class Permissions internal constructor( "Don't construct an instance of 'Permissions' from a raw code. Use the factory functions described in the " + "documentation instead.", ReplaceWith("Permissions.Builder(code).build()", "dev.kord.common.entity.Permissions"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(code: DiscordBitSet) : this(code, null) @@ -621,10 +615,10 @@ public class Permissions internal constructor( return Builder(code.copy()).apply(builder).build() } - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") + @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'Permissions.PermissionsBuilder' is deprecated, use 'Permissions.Builder' instead.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun copy(block: PermissionsBuilder.() -> Unit): Permissions { @@ -645,6 +639,7 @@ public class Permissions internal constructor( @Deprecated( message = "Permissions is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), + DeprecationLevel.ERROR, ) public operator fun component1(): DiscordBitSet = code @@ -653,13 +648,13 @@ public class Permissions internal constructor( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "Permissions is no longer a data class. Deprecated without a replacement.") + "Permissions is no longer a data class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun copy(code: DiscordBitSet = this.code): Permissions = Permissions(code, null) @Deprecated( "Renamed to 'Builder'.", ReplaceWith("Permissions.Builder", imports = ["dev.kord.common.entity.Permissions"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class PermissionsBuilder(code: DiscordBitSet) { private val delegate = Builder(code) @@ -725,11 +720,11 @@ public class Permissions internal constructor( public companion object NewCompanion { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("Permissions.serializer()", imports = ["dev.kord.common.entity.Permissions"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val Companion: Companion = Companion() @@ -738,7 +733,7 @@ public class Permissions internal constructor( @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("Permissions.serializer()", imports = ["dev.kord.common.entity.Permissions"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class Companion internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this @@ -754,10 +749,10 @@ public inline fun Permissions(builder: Permissions.Builder.() -> Unit = {}): Per return Permissions.Builder().apply(builder).build() } -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'Permissions.PermissionsBuilder' is deprecated, use 'Permissions.Builder' instead.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun Permissions(block: Permissions.PermissionsBuilder.() -> Unit = {}): Permissions { @@ -811,6 +806,6 @@ public fun PermissionWithIterable(flags: Iterable): Permissions = P "Permissions.Builder(DiscordBitSet(value)).build()", imports = ["dev.kord.common.entity.Permissions", "dev.kord.common.DiscordBitSet"], ), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public fun Permissions(value: String): Permissions = Permissions(DiscordBitSet(value), null) diff --git a/common/src/commonMain/kotlin/entity/SystemChannelFlag.kt b/common/src/commonMain/kotlin/entity/SystemChannelFlag.kt index 8470dd495b82..ce04932b9613 100644 --- a/common/src/commonMain/kotlin/entity/SystemChannelFlag.kt +++ b/common/src/commonMain/kotlin/entity/SystemChannelFlag.kt @@ -69,7 +69,7 @@ public sealed class SystemChannelFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.") + "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun name(): String = this::class.simpleName!! /** @@ -77,7 +77,7 @@ public sealed class SystemChannelFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.") + "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun ordinal(): Int = when (this) { SuppressJoinNotifications -> 0 SuppressPremiumSubscriptions -> 1 @@ -95,6 +95,7 @@ public sealed class SystemChannelFlag( message = "SystemChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SystemChannelFlag::class.java", imports = arrayOf("dev.kord.common.entity.SystemChannelFlag")), + DeprecationLevel.ERROR, ) public fun getDeclaringClass(): Class = SystemChannelFlag::class.java @@ -220,7 +221,7 @@ public sealed class SystemChannelFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.") + "SystemChannelFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) @JvmStatic public open fun valueOf(name: String): SystemChannelFlag = when (name) { "SuppressJoinNotifications" -> SuppressJoinNotifications @@ -240,6 +241,7 @@ public sealed class SystemChannelFlag( message = "SystemChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SystemChannelFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.SystemChannelFlag")), + DeprecationLevel.ERROR, ) @JvmStatic public open fun values(): Array = entries.toTypedArray() @@ -249,7 +251,7 @@ public sealed class SystemChannelFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "SystemChannelFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SystemChannelFlag.entries", imports = arrayOf("dev.kord.common.entity.SystemChannelFlag")), @@ -350,7 +352,7 @@ public class SystemChannelFlags internal constructor( "Don't construct an instance of 'SystemChannelFlags' from a raw code. Use the factory functions described in " + "the documentation instead.", ReplaceWith("SystemChannelFlags.Builder(code).build()", "dev.kord.common.entity.SystemChannelFlags"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(code: Int) : this(code, null) @@ -429,6 +431,7 @@ public class SystemChannelFlags internal constructor( @Deprecated( message = "SystemChannelFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), + DeprecationLevel.ERROR, ) public operator fun component1(): Int = code @@ -437,7 +440,7 @@ public class SystemChannelFlags internal constructor( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SystemChannelFlags is no longer a data class. Deprecated without a replacement.") + "SystemChannelFlags is no longer a data class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun copy(code: Int = this.code): SystemChannelFlags = SystemChannelFlags(code, null) public class Builder( @@ -494,11 +497,11 @@ public class SystemChannelFlags internal constructor( } public companion object NewCompanion { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("SystemChannelFlags.serializer()", imports = ["dev.kord.common.entity.SystemChannelFlags"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val Companion: Companion = Companion() @@ -507,7 +510,7 @@ public class SystemChannelFlags internal constructor( @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("SystemChannelFlags.serializer()", imports = ["dev.kord.common.entity.SystemChannelFlags"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class Companion internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this diff --git a/common/src/commonMain/kotlin/entity/UserFlag.kt b/common/src/commonMain/kotlin/entity/UserFlag.kt index c798d6e28242..5504ae40094b 100644 --- a/common/src/commonMain/kotlin/entity/UserFlag.kt +++ b/common/src/commonMain/kotlin/entity/UserFlag.kt @@ -63,14 +63,14 @@ public sealed class UserFlag( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = "UserFlag is no longer an enum class. Deprecated without a replacement.") + @Deprecated(message = "UserFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun name(): String = this::class.simpleName!! /** * @suppress */ - @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith", "DEPRECATION")) - @Deprecated(message = "UserFlag is no longer an enum class. Deprecated without a replacement.") + @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith", "DEPRECATION_ERROR")) + @Deprecated(message = "UserFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun ordinal(): Int = when (this) { DiscordEmployee -> 0 DiscordPartner -> 1 @@ -98,6 +98,7 @@ public sealed class UserFlag( message = "UserFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "UserFlag::class.java", imports = arrayOf("dev.kord.common.entity.UserFlag")), + DeprecationLevel.ERROR, ) public fun getDeclaringClass(): Class = UserFlag::class.java @@ -158,7 +159,7 @@ public sealed class UserFlag( @Deprecated( "'UserFlag.System' is no longer documented. You can still use it with 'UserFlag.fromShift(12)'.", ReplaceWith("UserFlag.fromShift(12)", imports = ["dev.kord.common.entity.UserFlag"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public object System : UserFlag(12) @@ -207,7 +208,7 @@ public sealed class UserFlag( HouseBalance, EarlySupporter, TeamUser, - @Suppress("DEPRECATION") System, + @Suppress("DEPRECATION_ERROR") System, BugHunterLevel2, VerifiedBot, VerifiedBotDeveloper, @@ -281,7 +282,7 @@ public sealed class UserFlag( @JvmField public val TeamUser: UserFlag = TeamUser - @Suppress(names = arrayOf("DEPRECATION")) + @Suppress(names = arrayOf("DEPRECATION_ERROR")) @Deprecated( level = DeprecationLevel.HIDDEN, message = "Binary compatibility", @@ -346,7 +347,7 @@ public sealed class UserFlag( 8 -> HouseBalance 9 -> EarlySupporter 10 -> TeamUser - 12 -> @Suppress("DEPRECATION") System + 12 -> @Suppress("DEPRECATION_ERROR") System 14 -> BugHunterLevel2 16 -> VerifiedBot 17 -> VerifiedBotDeveloper @@ -361,7 +362,7 @@ public sealed class UserFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "UserFlag is no longer an enum class. Deprecated without a replacement.") + "UserFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) @JvmStatic public open fun valueOf(name: String): UserFlag = when (name) { "DiscordEmployee" -> DiscordEmployee @@ -373,7 +374,7 @@ public sealed class UserFlag( "HouseBalance" -> HouseBalance "EarlySupporter" -> EarlySupporter "TeamUser" -> TeamUser - "System" -> @Suppress("DEPRECATION") System + "System" -> @Suppress("DEPRECATION_ERROR") System "BugHunterLevel2" -> BugHunterLevel2 "VerifiedBot" -> VerifiedBot "VerifiedBotDeveloper" -> VerifiedBotDeveloper @@ -391,6 +392,7 @@ public sealed class UserFlag( message = "UserFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "UserFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.common.entity.UserFlag")), + DeprecationLevel.ERROR, ) @JvmStatic public open fun values(): Array = entries.toTypedArray() @@ -400,7 +402,7 @@ public sealed class UserFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "UserFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "UserFlag.entries", imports = arrayOf("dev.kord.common.entity.UserFlag")), @@ -496,7 +498,7 @@ public class UserFlags internal constructor( "Don't construct an instance of 'UserFlags' from a raw code. Use the factory functions described in the " + "documentation instead.", ReplaceWith("UserFlags.Builder(code).build()", "dev.kord.common.entity.UserFlags"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public constructor(code: Int) : this(code, null) /** @@ -519,6 +521,7 @@ public class UserFlags internal constructor( @Deprecated( message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), + DeprecationLevel.ERROR, ) public val flags: List get() = values.toList() @@ -565,10 +568,10 @@ public class UserFlags internal constructor( return Builder(code).apply(builder).build() } - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") + @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'UserFlags.UserFlagsBuilder' is deprecated, use 'UserFlags.Builder' instead.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun copy(block: UserFlagsBuilder.() -> Unit): UserFlags { @@ -589,6 +592,7 @@ public class UserFlags internal constructor( @Deprecated( message = "UserFlags is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), + DeprecationLevel.ERROR, ) public operator fun component1(): Int = code @@ -596,13 +600,13 @@ public class UserFlags internal constructor( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = "UserFlags is no longer a data class. Deprecated without a replacement.") + @Deprecated(message = "UserFlags is no longer a data class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun copy(code: Int = this.code): UserFlags = UserFlags(code, null) @Deprecated( "Renamed to 'Builder'.", ReplaceWith("UserFlags.Builder", imports = ["dev.kord.common.entity.UserFlags"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class UserFlagsBuilder(code: Int = 0) { private val delegate = Builder(code) @@ -664,11 +668,11 @@ public class UserFlags internal constructor( } public companion object { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'Companion', which no longer implements 'KSerializer'.", ReplaceWith("UserFlags.serializer()", imports = ["dev.kord.common.entity.UserFlags"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val UserFlagsSerializer: UserFlagsSerializer = UserFlagsSerializer() @@ -677,7 +681,7 @@ public class UserFlags internal constructor( @Deprecated( "Renamed to 'Companion', which no longer implements 'KSerializer'.", ReplaceWith("UserFlags.serializer()", imports = ["dev.kord.common.entity.UserFlags"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class UserFlagsSerializer internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this diff --git a/common/src/commonTest/kotlin/json/PermissionsTest.kt b/common/src/commonTest/kotlin/json/PermissionsTest.kt index 0d5f67259149..b6491f7181a3 100644 --- a/common/src/commonTest/kotlin/json/PermissionsTest.kt +++ b/common/src/commonTest/kotlin/json/PermissionsTest.kt @@ -23,7 +23,7 @@ class PermissionsTest { @Test @JsName("test2") fun `Permission All does not swallow the universe`() { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") Permission.All //oh yeah, this is worthy of a test } diff --git a/core/api/core.api b/core/api/core.api index 1cff740c2fe6..d3c437381c6d 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -53,7 +53,7 @@ public final class dev/kord/core/Kord : kotlinx/coroutines/CoroutineScope { public static synthetic fun getGuildApplicationCommands$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ljava/lang/Boolean;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public final fun getGuildOrNull (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getGuildOrNull$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun getGuildOrThrow (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final synthetic fun getGuildOrThrow (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getGuildOrThrow$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun getGuildPreview (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getGuildPreview$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; @@ -399,7 +399,7 @@ public final class dev/kord/core/behavior/GuildBehaviorKt { public static synthetic fun createKeywordPresetAutoModerationRule$default (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun createMediaChannel (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createMediaChannel$default (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun createMentionSpamAutoModerationRule (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;ILkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun createMentionSpamAutoModerationRule (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;ILkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createMentionSpamAutoModerationRule (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createMentionSpamAutoModerationRule$default (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;ILkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun createMentionSpamAutoModerationRule$default (Ldev/kord/core/behavior/GuildBehavior;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; @@ -1529,11 +1529,6 @@ 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 final class dev/kord/core/behavior/channel/TopGuildMessageChannelBehaviorKt { - public static final synthetic fun createWebhook (Ldev/kord/core/behavior/channel/TopGuildMessageChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun createWebhook$default (Ldev/kord/core/behavior/channel/TopGuildMessageChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; -} - public abstract interface class dev/kord/core/behavior/channel/VoiceChannelBehavior : dev/kord/core/behavior/channel/BaseVoiceChannelBehavior, 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; @@ -2222,7 +2217,6 @@ public final class dev/kord/core/cache/CachingGateway : dev/kord/cache/api/DataC public final class dev/kord/core/cache/DataCacheExtensionsKt { public static final fun createView (Ldev/kord/cache/api/DataCache;)Ldev/kord/core/cache/DataCacheView; - public static final synthetic fun createView (Ldev/kord/cache/api/DataCache;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class dev/kord/core/cache/DataCacheView : dev/kord/cache/api/DataCache { @@ -6225,9 +6219,7 @@ public final class dev/kord/core/entity/Guild : dev/kord/core/behavior/GuildBeha public fun getBan (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getBanOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getBanner ()Ldev/kord/core/entity/Asset; - public final synthetic fun getBanner (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getBannerHash ()Ljava/lang/String; - public final synthetic fun getBannerUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public fun getBans ()Lkotlinx/coroutines/flow/Flow; public fun getCachedThreads ()Lkotlinx/coroutines/flow/Flow; public fun getChannel (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6240,9 +6232,7 @@ public final class dev/kord/core/entity/Guild : dev/kord/core/behavior/GuildBeha public final fun getDefaultMessageNotificationLevel ()Ldev/kord/common/entity/DefaultMessageNotificationLevel; public final fun getDescription ()Ljava/lang/String; public final fun getDiscoverySplash ()Ldev/kord/core/entity/Asset; - public final synthetic fun getDiscoverySplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getDiscoverySplashHash ()Ljava/lang/String; - public final synthetic fun getDiscoverySplashUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public final fun getEmbedChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getEmoji (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getEmojiIds ()Ljava/util/Set; @@ -6256,9 +6246,7 @@ public final class dev/kord/core/entity/Guild : dev/kord/core/behavior/GuildBeha public fun getGuildScheduledEvent (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getGuildScheduledEventOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getIcon ()Ldev/kord/core/entity/Asset; - public final synthetic fun getIcon (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getIconHash ()Ljava/lang/String; - public final synthetic fun getIconUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public fun getId ()Ldev/kord/common/entity/Snowflake; public fun getIntegrations ()Lkotlinx/coroutines/flow/Flow; public fun getInvite (Ljava/lang/String;ZZLdev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6310,9 +6298,7 @@ public final class dev/kord/core/entity/Guild : dev/kord/core/behavior/GuildBeha public final fun getSafetyAlertsChannelId ()Ldev/kord/common/entity/Snowflake; public fun getScheduledEvents ()Lkotlinx/coroutines/flow/Flow; public final fun getSplash ()Ldev/kord/core/entity/Asset; - public final synthetic fun getSplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getSplashHash ()Ljava/lang/String; - public final synthetic fun getSplashUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public final fun getStageInstances ()Ljava/util/Set; public fun getSticker (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getStickerOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6367,7 +6353,6 @@ public final class dev/kord/core/entity/GuildEmoji : dev/kord/core/entity/Emoji, public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public fun getId ()Ldev/kord/common/entity/Snowflake; public final fun getImage ()Ldev/kord/core/entity/Asset; - public final synthetic fun getImage ()Ldev/kord/core/entity/Icon; public fun getKord ()Ldev/kord/core/Kord; public final fun getMember ()Ldev/kord/core/behavior/MemberBehavior; public final fun getMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6550,40 +6535,6 @@ public final class dev/kord/core/entity/GuildWidget : dev/kord/core/KordObject, public synthetic fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Strategizable; } -public abstract class dev/kord/core/entity/Icon : dev/kord/core/KordObject { - public synthetic fun (Ldev/kord/rest/Image$Format;ZLdev/kord/rest/route/CdnUrl;Ldev/kord/core/Kord;Lkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun getAnimated ()Z - public final fun getCdnUrl ()Ldev/kord/rest/route/CdnUrl; - public final fun getFormat ()Ldev/kord/rest/Image$Format; - public final fun getImage (Ldev/kord/rest/Image$Format;Ldev/kord/rest/Image$Size;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Ldev/kord/rest/Image$Size;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun getKord ()Ldev/kord/core/Kord; - public final fun getUrl ()Ljava/lang/String; - public fun toString ()Ljava/lang/String; -} - -public final class dev/kord/core/entity/Icon$DefaultUserAvatar : dev/kord/core/entity/Icon { - public fun (ILdev/kord/core/Kord;)V -} - -public final class dev/kord/core/entity/Icon$EmojiIcon : dev/kord/core/entity/Icon { - public fun (ZLdev/kord/common/entity/Snowflake;Ldev/kord/core/Kord;)V -} - -public final class dev/kord/core/entity/Icon$MemberAvatar : dev/kord/core/entity/Icon { - public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/core/Kord;)V -} - -public final class dev/kord/core/entity/Icon$RoleIcon : dev/kord/core/entity/Icon { - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/core/Kord;)V -} - -public final class dev/kord/core/entity/Icon$UserAvatar : dev/kord/core/entity/Icon { - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/core/Kord;)V -} - public final class dev/kord/core/entity/Integration : dev/kord/core/entity/KordEntity, dev/kord/core/entity/Strategizable { public fun (Ldev/kord/core/cache/data/IntegrationData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;)V public synthetic fun (Ldev/kord/core/cache/data/IntegrationData;Ldev/kord/core/Kord;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -6596,7 +6547,6 @@ public final class dev/kord/core/entity/Integration : dev/kord/core/entity/KordE public final fun getEnablesEmoticons ()Z public final fun getExpireBehavior ()Ldev/kord/common/entity/IntegrationExpireBehavior; public final fun getExpireGracePeriod-FghU774 ()Lkotlin/time/Duration; - public final synthetic fun getExpireGracePeriod-UwyO8pc ()J public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; public final fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; @@ -6616,7 +6566,6 @@ public final class dev/kord/core/entity/Integration : dev/kord/core/entity/KordE public fun hashCode ()I public final fun isEnabled ()Z public final fun isSyncing ()Ljava/lang/Boolean; - public final synthetic fun isSyncing ()Z public final fun sync (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun toString ()Ljava/lang/String; public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/Integration; @@ -6694,7 +6643,7 @@ public final class dev/kord/core/entity/Member : dev/kord/core/entity/User, dev/ public fun fetchMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun fetchMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getCommunicationDisabledUntil ()Lkotlinx/datetime/Instant; - public final fun getDisplayName ()Ljava/lang/String; + public final synthetic fun getDisplayName ()Ljava/lang/String; public final fun getEffectiveName ()Ljava/lang/String; public final fun getFlags ()Ldev/kord/common/entity/GuildMemberFlags; public fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; @@ -6703,7 +6652,6 @@ public final class dev/kord/core/entity/Member : dev/kord/core/entity/User, dev/ public fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getJoinedAt ()Lkotlinx/datetime/Instant; public final fun getMemberAvatar ()Ldev/kord/core/entity/Asset; - public final synthetic fun getMemberAvatar ()Ldev/kord/core/entity/Icon; public final fun getMemberAvatarHash ()Ljava/lang/String; public final fun getMemberData ()Ldev/kord/core/cache/data/MemberData; public final fun getNickname ()Ljava/lang/String; @@ -6865,9 +6813,7 @@ public final class dev/kord/core/entity/PartialGuild : dev/kord/core/behavior/Gu public fun getBan (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getBanOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getBanner ()Ldev/kord/core/entity/Asset; - public final synthetic fun getBanner (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getBannerHash ()Ljava/lang/String; - public final synthetic fun getBannerUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public fun getBans ()Lkotlinx/coroutines/flow/Flow; public fun getCachedThreads ()Lkotlinx/coroutines/flow/Flow; public fun getChannel (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6875,8 +6821,6 @@ public final class dev/kord/core/entity/PartialGuild : dev/kord/core/behavior/Gu public fun getChannels ()Lkotlinx/coroutines/flow/Flow; public final fun getData ()Ldev/kord/core/cache/data/PartialGuildData; public final fun getDescription ()Ljava/lang/String; - public final synthetic fun getDiscoverySplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final synthetic fun getDiscoverySplashUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public fun getEmojis ()Lkotlinx/coroutines/flow/Flow; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6884,9 +6828,7 @@ public final class dev/kord/core/entity/PartialGuild : dev/kord/core/behavior/Gu public fun getGuildScheduledEvent (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getGuildScheduledEventOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getIcon ()Ldev/kord/core/entity/Asset; - public final synthetic fun getIcon (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getIconHash ()Ljava/lang/String; - public final synthetic fun getIconUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public fun getId ()Ldev/kord/common/entity/Snowflake; public fun getIntegrations ()Lkotlinx/coroutines/flow/Flow; public fun getInvite (Ljava/lang/String;ZZLdev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7096,7 +7038,6 @@ public final class dev/kord/core/entity/Role : dev/kord/core/behavior/RoleBehavi public fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getHoisted ()Z public final fun getIcon ()Ldev/kord/core/entity/Asset; - public final synthetic fun getIcon ()Ldev/kord/core/entity/Icon; public final fun getIconHash ()Ljava/lang/String; public fun getId ()Ldev/kord/common/entity/Snowflake; public fun getKord ()Ldev/kord/core/Kord; @@ -7234,7 +7175,6 @@ public final class dev/kord/core/entity/Team : dev/kord/core/entity/KordEntity, public synthetic fun compareTo (Ljava/lang/Object;)I public final fun getData ()Ldev/kord/core/cache/data/TeamData; public final fun getIcon ()Ldev/kord/core/entity/Asset; - public final synthetic fun getIcon ()Ljava/lang/String; public final fun getIconHash ()Ljava/lang/String; public fun getId ()Ldev/kord/common/entity/Snowflake; public fun getKord ()Ldev/kord/core/Kord; @@ -7297,16 +7237,13 @@ public class dev/kord/core/entity/User : dev/kord/core/behavior/UserBehavior { public fun fetchUserOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getAccentColor ()Ldev/kord/common/Color; public final fun getAvatar ()Ldev/kord/core/entity/Asset; - public final synthetic fun getAvatar ()Ldev/kord/core/entity/Icon; public final fun getAvatarDecoration ()Ldev/kord/core/entity/Asset; public final fun getAvatarDecorationHash ()Ljava/lang/String; public final fun getAvatarHash ()Ljava/lang/String; public final fun getBanner ()Ldev/kord/core/entity/Asset; public final fun getBannerHash ()Ljava/lang/String; - public final synthetic fun getBannerUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; public final fun getData ()Ldev/kord/core/cache/data/UserData; public final fun getDefaultAvatar ()Ldev/kord/core/entity/Asset; - public final synthetic fun getDefaultAvatar ()Ldev/kord/core/entity/Icon; public final fun getDiscriminator ()Ljava/lang/String; public fun getDmChannel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getDmChannelOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7326,32 +7263,6 @@ public class dev/kord/core/entity/User : dev/kord/core/behavior/UserBehavior { public fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/User; } -public final class dev/kord/core/entity/User$Avatar : dev/kord/core/KordObject { - public fun (Ldev/kord/core/cache/data/UserData;Ldev/kord/core/Kord;)V - public final fun component1 ()Ldev/kord/core/cache/data/UserData; - public final fun component2 ()Ldev/kord/core/Kord; - public final fun copy (Ldev/kord/core/cache/data/UserData;Ldev/kord/core/Kord;)Ldev/kord/core/entity/User$Avatar; - public static synthetic fun copy$default (Ldev/kord/core/entity/User$Avatar;Ldev/kord/core/cache/data/UserData;Ldev/kord/core/Kord;ILjava/lang/Object;)Ldev/kord/core/entity/User$Avatar; - public fun equals (Ljava/lang/Object;)Z - public final fun getData ()Ldev/kord/core/cache/data/UserData; - public final fun getDefaultImage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getDefaultUrl ()Ljava/lang/String; - public final fun getImage (Ldev/kord/rest/Image$Format;Ldev/kord/rest/Image$Size;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Ldev/kord/rest/Image$Size;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getImage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun getKord ()Ldev/kord/core/Kord; - public final fun getSupportedFormat ()Ldev/kord/rest/Image$Format; - public final fun getUrl ()Ljava/lang/String; - public final fun getUrl (Ldev/kord/rest/Image$Format;)Ljava/lang/String; - public final fun getUrl (Ldev/kord/rest/Image$Format;Ldev/kord/rest/Image$Size;)Ljava/lang/String; - public final fun getUrl (Ldev/kord/rest/Image$Size;)Ljava/lang/String; - public fun hashCode ()I - public final fun isAnimated ()Z - public final fun isCustom ()Z - public fun toString ()Ljava/lang/String; -} - public final class dev/kord/core/entity/UserKt { public static final fun getEffectiveName (Ldev/kord/core/entity/User;)Ljava/lang/String; } @@ -8922,13 +8833,11 @@ public final class dev/kord/core/entity/channel/thread/NewsChannelThread : dev/k public fun getLastMessageId ()Ldev/kord/common/entity/Snowflake; public fun getLastPinTimestamp ()Lkotlinx/datetime/Instant; public fun getMember ()Ldev/kord/core/entity/channel/thread/ThreadMember; - public synthetic fun getMemberCount ()Ldev/kord/common/entity/optional/OptionalInt; public fun getMemberCount ()Ljava/lang/Integer; public fun getMembers ()Lkotlinx/coroutines/flow/Flow; public fun getMention ()Ljava/lang/String; public fun getMessage ()Ldev/kord/core/entity/Message; public fun getMessage (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun getMessageCount ()Ldev/kord/common/entity/optional/OptionalInt; public fun getMessageCount ()Ljava/lang/Integer; public fun getMessageOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getMessages ()Lkotlinx/coroutines/flow/Flow; @@ -9002,13 +8911,11 @@ public final class dev/kord/core/entity/channel/thread/TextChannelThread : dev/k public fun getLastMessageId ()Ldev/kord/common/entity/Snowflake; public fun getLastPinTimestamp ()Lkotlinx/datetime/Instant; public fun getMember ()Ldev/kord/core/entity/channel/thread/ThreadMember; - public synthetic fun getMemberCount ()Ldev/kord/common/entity/optional/OptionalInt; public fun getMemberCount ()Ljava/lang/Integer; public fun getMembers ()Lkotlinx/coroutines/flow/Flow; public fun getMention ()Ljava/lang/String; public fun getMessage ()Ldev/kord/core/entity/Message; public fun getMessage (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun getMessageCount ()Ldev/kord/common/entity/optional/OptionalInt; public fun getMessageCount ()Ljava/lang/Integer; public fun getMessageOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getMessages ()Lkotlinx/coroutines/flow/Flow; @@ -9059,10 +8966,8 @@ public abstract interface class dev/kord/core/entity/channel/thread/ThreadChanne public abstract fun getCreateTimestamp ()Lkotlinx/datetime/Instant; public abstract fun getDefaultAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; public abstract fun getMember ()Ldev/kord/core/entity/channel/thread/ThreadMember; - public abstract synthetic fun getMemberCount ()Ldev/kord/common/entity/optional/OptionalInt; public abstract fun getMemberCount ()Ljava/lang/Integer; public abstract fun getMessage ()Ldev/kord/core/entity/Message; - public abstract synthetic fun getMessageCount ()Ldev/kord/common/entity/optional/OptionalInt; public abstract fun getMessageCount ()Ljava/lang/Integer; public abstract fun getOwner ()Ldev/kord/core/behavior/UserBehavior; public abstract fun getOwnerId ()Ldev/kord/common/entity/Snowflake; @@ -9102,13 +9007,11 @@ public final class dev/kord/core/entity/channel/thread/ThreadChannel$DefaultImpl public static fun getLastMessageId (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ldev/kord/common/entity/Snowflake; public static fun getLastPinTimestamp (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Lkotlinx/datetime/Instant; public static fun getMember (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ldev/kord/core/entity/channel/thread/ThreadMember; - public static synthetic fun getMemberCount (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ldev/kord/common/entity/optional/OptionalInt; public static fun getMemberCount (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ljava/lang/Integer; public static fun getMembers (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Lkotlinx/coroutines/flow/Flow; public static fun getMention (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ljava/lang/String; public static fun getMessage (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ldev/kord/core/entity/Message; public static fun getMessage (Ldev/kord/core/entity/channel/thread/ThreadChannel;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun getMessageCount (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ldev/kord/common/entity/optional/OptionalInt; public static fun getMessageCount (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Ljava/lang/Integer; public static fun getMessageOrNull (Ldev/kord/core/entity/channel/thread/ThreadChannel;Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun getMessages (Ldev/kord/core/entity/channel/thread/ThreadChannel;)Lkotlinx/coroutines/flow/Flow; @@ -11703,7 +11606,6 @@ public final class dev/kord/core/event/channel/thread/ThreadListSyncEvent : dev/ public final fun getChannelBehaviors ()Ljava/util/List; public final fun getChannelIds ()Ljava/util/List; public final fun getChannels ()Lkotlinx/coroutines/flow/Flow; - public final synthetic fun getChannels (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getCustomContext ()Ljava/lang/Object; public final fun getData ()Ldev/kord/core/cache/data/ThreadListSyncData; public fun getGateway ()Ldev/kord/gateway/Gateway; @@ -11876,7 +11778,6 @@ public final class dev/kord/core/event/gateway/ReadyEvent : dev/kord/core/event/ public final fun getGuildIds ()Ljava/util/Set; public final fun getGuilds ()Ljava/util/Set; public final fun getGuilds ()Lkotlinx/coroutines/flow/Flow; - public final synthetic fun getGuilds (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; public final fun getResumeGatewayUrl ()Ljava/lang/String; public final fun getSelf ()Ldev/kord/core/entity/User; diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index 60c217cd4479..9f42c3bf3c43 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -35,7 +35,6 @@ import kotlinx.coroutines.* import kotlinx.coroutines.flow.* import mu.KLogger import mu.KotlinLogging -import kotlin.DeprecationLevel.ERROR import kotlin.contracts.InvocationKind import kotlin.contracts.contract import kotlin.coroutines.CoroutineContext @@ -260,7 +259,7 @@ public class Kord( * @throws RequestException if something went wrong while retrieving the guild. * @throws EntityNotFoundException if the guild is null. */ - @Deprecated("Renamed to getGuild", ReplaceWith("this.getGuild(id, strategy)"), level = ERROR) + @Deprecated("Renamed to getGuild", ReplaceWith("this.getGuild(id, strategy)"), level = DeprecationLevel.HIDDEN) public suspend fun getGuildOrThrow( id: Snowflake, strategy: EntitySupplyStrategy<*> = resources.defaultStrategy, diff --git a/core/src/commonMain/kotlin/Util.kt b/core/src/commonMain/kotlin/Util.kt index 2522113c50ff..13b84ca1dbf5 100644 --- a/core/src/commonMain/kotlin/Util.kt +++ b/core/src/commonMain/kotlin/Util.kt @@ -244,8 +244,8 @@ internal fun paginateThreads( */ public inline fun Intents.Builder.enableEvent(): Unit = enableEvent(T::class) -@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith") -@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.WARNING) +@Suppress("DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith") +@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.ERROR) public inline fun Intents.IntentsBuilder.enableEvent(): Unit = enableEvent0(T::class) /** @@ -261,8 +261,8 @@ public inline fun Intents.IntentsBuilder.enableEvent(): Unit public fun Intents.Builder.enableEvents(events: Iterable>): Unit = events.forEach { enableEvent(it) } -@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith") -@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.WARNING) +@Suppress("DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith") +@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.ERROR) public fun Intents.IntentsBuilder.enableEvents(events: Iterable>): Unit = events.forEach { enableEvent0(it) } @@ -279,8 +279,8 @@ public fun Intents.IntentsBuilder.enableEvents(events: Iterable): Unit = events.forEach { enableEvent(it) } -@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith") -@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.WARNING) +@Suppress("DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith") +@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.ERROR) public fun Intents.IntentsBuilder.enableEvents(vararg events: KClass): Unit = events.forEach { enableEvent0(it) } @@ -461,13 +461,13 @@ public fun Intents.Builder.enableEvent(event: KClass): Unit = when (e else -> Unit } -@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith") -@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.WARNING) +@Suppress("DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith") +@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.ERROR) public fun Intents.IntentsBuilder.enableEvent(event: KClass) { enableEvent0(event) } -@Suppress("DEPRECATION") +@Suppress("DEPRECATION_ERROR") @PublishedApi @KordInternal internal fun Intents.IntentsBuilder.enableEvent0(event: KClass) { diff --git a/core/src/commonMain/kotlin/behavior/GuildBehavior.kt b/core/src/commonMain/kotlin/behavior/GuildBehavior.kt index a56370e6ebd3..4943b58dac5f 100644 --- a/core/src/commonMain/kotlin/behavior/GuildBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/GuildBehavior.kt @@ -1133,7 +1133,7 @@ public suspend inline fun GuildBehavior.createMentionSpamAutoModerationRule( "this.createMentionSpamAutoModerationRule(name, eventType) { this@createMentionSpamAutoModerationRule" + ".mentionLimit = mentionLimit\nbuilder() }" ), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public suspend inline fun GuildBehavior.createMentionSpamAutoModerationRule( name: String, diff --git a/core/src/commonMain/kotlin/behavior/channel/TopGuildMessageChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/TopGuildMessageChannelBehavior.kt index 106b2173185b..37feefa191e6 100644 --- a/core/src/commonMain/kotlin/behavior/channel/TopGuildMessageChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/TopGuildMessageChannelBehavior.kt @@ -3,16 +3,11 @@ package dev.kord.core.behavior.channel import dev.kord.common.entity.Snowflake import dev.kord.common.exception.RequestException import dev.kord.core.Kord -import dev.kord.core.entity.Webhook import dev.kord.core.entity.channel.TopGuildMessageChannel 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.rest.builder.webhook.WebhookCreateBuilder -import kotlin.DeprecationLevel.HIDDEN -import dev.kord.core.hash -import kotlin.contracts.InvocationKind -import kotlin.contracts.contract /** * The behavior of a non-thread Discord message channel associated to a [guild]. @@ -90,18 +85,3 @@ internal fun TopGuildMessageChannelBehavior( return "TopGuildMessageChannelBehavior(id=$id, guildId=$guildId, kord=$kord, supplier=$supplier)" } } - - -@Deprecated( - "Binary compatibility, this is now available on the CategorizableChannelBehavior supertype. Keep for some releases.", - level = HIDDEN, -) -public suspend inline fun TopGuildMessageChannelBehavior.createWebhook( - name: String, - builder: WebhookCreateBuilder.() -> Unit = {} -): Webhook { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - return (this as CategorizableChannelBehavior).createWebhook(name, builder) -} diff --git a/core/src/commonMain/kotlin/cache/DataCacheExtensions.kt b/core/src/commonMain/kotlin/cache/DataCacheExtensions.kt index cfa661b3c879..e5f7a83a052e 100644 --- a/core/src/commonMain/kotlin/cache/DataCacheExtensions.kt +++ b/core/src/commonMain/kotlin/cache/DataCacheExtensions.kt @@ -4,8 +4,6 @@ import dev.kord.cache.api.DataCache import dev.kord.cache.api.query import dev.kord.common.annotation.KordInternal import dev.kord.core.cache.data.* -import kotlin.DeprecationLevel.HIDDEN -import kotlin.jvm.JvmName /** * Registers all Kord data classes for this cache @@ -59,8 +57,3 @@ internal suspend fun DataCache.removeKordData() { * directly to this instance. */ public fun DataCache.createView(): DataCacheView = DataCacheView(this) - -@Suppress("RedundantSuspendModifier") -@Deprecated("Binary compatibility, keep for some releases.", level = HIDDEN) -@JvmName("createView") -public suspend fun DataCache.createView0(): DataCacheView = createView() diff --git a/core/src/commonMain/kotlin/entity/Emoji.kt b/core/src/commonMain/kotlin/entity/Emoji.kt index 20eb022102df..fe8b21eeb95e 100644 --- a/core/src/commonMain/kotlin/entity/Emoji.kt +++ b/core/src/commonMain/kotlin/entity/Emoji.kt @@ -132,13 +132,6 @@ public class GuildEmoji( */ public val user: UserBehavior? get() = userId?.let { UserBehavior(it, kord) } - /** - * The image as [Icon] object for the emoji - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getImage(): Icon = Icon.EmojiIcon(data.animated.discordBoolean, data.id, kord) - /** The image of this emoji as an [Asset]. */ public val image: Asset get() = Asset.emoji(id, isAnimated, kord) diff --git a/core/src/commonMain/kotlin/entity/Guild.kt b/core/src/commonMain/kotlin/entity/Guild.kt index b9443cc00684..7716fb18527c 100644 --- a/core/src/commonMain/kotlin/entity/Guild.kt +++ b/core/src/commonMain/kotlin/entity/Guild.kt @@ -2,7 +2,10 @@ package dev.kord.core.entity import dev.kord.common.Locale import dev.kord.common.entity.* -import dev.kord.common.entity.optional.* +import dev.kord.common.entity.optional.orElse +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.exception.RequestException import dev.kord.core.Kord import dev.kord.core.behavior.GuildBehavior @@ -13,19 +16,19 @@ import dev.kord.core.behavior.channel.TopGuildChannelBehavior import dev.kord.core.behavior.channel.TopGuildMessageChannelBehavior import dev.kord.core.behavior.channel.VoiceChannelBehavior import dev.kord.core.cache.data.GuildData -import dev.kord.core.entity.channel.* +import dev.kord.core.entity.channel.TextChannel +import dev.kord.core.entity.channel.TopGuildChannel +import dev.kord.core.entity.channel.TopGuildMessageChannel +import dev.kord.core.entity.channel.VoiceChannel 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.getChannelOfOrNull import dev.kord.core.switchIfEmpty -import dev.kord.rest.Image -import dev.kord.rest.service.RestClient import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.HIDDEN import kotlin.time.Duration /** @@ -364,27 +367,6 @@ public class Guild( */ public suspend fun getAfkChannel(): VoiceChannel? = afkChannelId?.let { supplier.getChannelOfOrNull(it) } - /** - * Gets the banner url in the specified format. - */ - @Deprecated("Old method", ReplaceWith("this.banner?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = HIDDEN) - public fun getBannerUrl(format: Image.Format): String? = - getBannerUrl0(format) - - private fun getBannerUrl0(format: Image.Format) = - data.banner?.let { "https://cdn.discordapp.com/banners/$id/$it.${format.extension}" } - - /** - * Requests to get the banner image in the specified [format], if present. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.banner?.getImage(format)"), level = HIDDEN) - public suspend fun getBanner(format: Image.Format): Image? { - val url = getBannerUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - /** * Requests to get the [TopGuildChannel] represented by the [widgetChannelId], * returns null if the [TopGuildChannel] isn't present or [widgetChannelId] is null. @@ -428,54 +410,6 @@ public class Guild( */ public suspend fun getEveryoneRoleOrNull(): Role? = supplier.getRoleOrNull(id, id) - /** - * Gets the discovery splash url in the specified [format], if present. - */ - @Deprecated( - "Old method", - ReplaceWith("this.discoverySplash?.cdnUrl?.toUrl { this@toUrl.format = format }"), - level = HIDDEN, - ) - public fun getDiscoverySplashUrl(format: Image.Format): String? = - getDiscoverySplashUrl0(format) - - private fun getDiscoverySplashUrl0(format: Image.Format) = - splashHash?.let { "discovery-splashes/$id/${it}.${format.extension}" } - - /** - * Requests to get the splash image in the specified [format], if present. - * - * This property is not resolvable through cache and will always use the [RestClient] instead. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.discoverySplash?.getImage(format)"), level = HIDDEN) - public suspend fun getDiscoverySplash(format: Image.Format): Image? { - val url = getDiscoverySplashUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - - /** - * Gets the icon url, if present. - */ - @Deprecated("Old method", ReplaceWith("this.icon?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = HIDDEN) - public fun getIconUrl(format: Image.Format): String? = - getIconUrl0(format) - - private fun getIconUrl0(format: Image.Format) = - data.icon?.let { "https://cdn.discordapp.com/icons/$id/$it.${format.extension}" } - - /** - * Requests to get the icon image in the specified [format], if present. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.icon?.getImage(format)"), level = HIDDEN) - public suspend fun getIcon(format: Image.Format): Image? { - val url = getIconUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - /** * Requests to get the owner of this guild as a [Member]. * @@ -505,27 +439,6 @@ public class Guild( */ public suspend fun getRulesChannel(): TopGuildMessageChannel? = rulesChannel?.asChannel() - /** - * Gets the splash url in the specified [format], if present. - */ - @Deprecated("Old method", ReplaceWith("this.splash?.cdnUrl?.toUrl { this@toUrl.format = format }"), HIDDEN) - public fun getSplashUrl(format: Image.Format): String? = - getSplashUrl0(format) - - private fun getSplashUrl0(format: Image.Format) = - data.splash.value?.let { "https://cdn.discordapp.com/splashes/$id/$it.${format.extension}" } - - /** - * Requests to get the splash image in the specified [format], if present. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.splash?.getImage(format)"), HIDDEN) - public suspend fun getSplash(format: Image.Format): Image? { - val url = getSplashUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - /** * Requests to get the channel where system messages (member joins, server boosts, etc.) are sent, * returns null if the [TextChannel] isn't present or the [systemChannelId] is null. diff --git a/core/src/commonMain/kotlin/entity/Icon.kt b/core/src/commonMain/kotlin/entity/Icon.kt deleted file mode 100644 index 82669894d54f..000000000000 --- a/core/src/commonMain/kotlin/entity/Icon.kt +++ /dev/null @@ -1,68 +0,0 @@ -package dev.kord.core.entity - -import dev.kord.common.entity.Snowflake -import dev.kord.core.Kord -import dev.kord.core.KordObject -import dev.kord.rest.Image -import dev.kord.rest.route.CdnUrl -import dev.kord.rest.route.DiscordCdn - -@Suppress("DEPRECATION_ERROR") -@Deprecated( - "Icon class does not cover all cdn endpoints and has some inconsistencies.", - ReplaceWith("Asset", "dev.kord.core.entity.Asset"), - DeprecationLevel.HIDDEN -) -public sealed class Icon( - public val format: Image.Format, - public val animated: Boolean, - public val cdnUrl: CdnUrl, - override val kord: Kord -) : KordObject { - public val url: String - get() = cdnUrl.toUrl { - this.format = this@Icon.format - } - - public suspend fun getImage(): Image = Image.fromUrl(kord.resources.httpClient, cdnUrl.toUrl()) - - public suspend fun getImage(size: Image.Size): Image = - Image.fromUrl(kord.resources.httpClient, cdnUrl.toUrl { - this.size = size - }) - - public suspend fun getImage(format: Image.Format): Image = - Image.fromUrl(kord.resources.httpClient, cdnUrl.toUrl { - this.format = format - }) - - public suspend fun getImage(format: Image.Format, size: Image.Size): Image = - Image.fromUrl(kord.resources.httpClient, cdnUrl.toUrl { - this.format = format - this.size = size - }) - - override fun toString(): String { - return "Icon(type=${this::class.simpleName},format=$format,animated=$animated,cdnUrl=$cdnUrl,kord=$kord)" - } - - public class EmojiIcon(animated: Boolean, emojiId: Snowflake, kord: Kord) : - Icon(if (animated) Image.Format.GIF else Image.Format.WEBP, animated, DiscordCdn.emoji(emojiId), kord) - - public class DefaultUserAvatar private constructor(cdnUrl: CdnUrl, kord: Kord) : - Icon(Image.Format.PNG /* Discord Default Avatars only support PNG */, false, cdnUrl, kord) { - @Suppress("DEPRECATION") - public constructor(discriminator: Int, kord: Kord) : this(DiscordCdn.defaultAvatar(discriminator), kord) - internal constructor(userId: Snowflake, kord: Kord) : this(DiscordCdn.defaultUserAvatar(userId), kord) - } - - public class UserAvatar(userId: Snowflake, avatarHash: String, kord: Kord) : - Icon(if (avatarHash.startsWith("a_")) Image.Format.GIF else Image.Format.WEBP, avatarHash.startsWith("a_"), DiscordCdn.userAvatar(userId, avatarHash), kord) - - public class MemberAvatar(guildId: Snowflake, userId: Snowflake, avatarHash: String, kord: Kord) : - Icon(if (avatarHash.startsWith("a_")) Image.Format.GIF else Image.Format.WEBP, avatarHash.startsWith("a_"), DiscordCdn.memberAvatar(guildId, userId, avatarHash), kord) - - public class RoleIcon(roleId: Snowflake, iconHash: String, kord: Kord) : - Icon(if (iconHash.startsWith("a_")) Image.Format.GIF else Image.Format.WEBP, iconHash.startsWith("a_"), DiscordCdn.roleIcon(roleId, iconHash), kord) - -} diff --git a/core/src/commonMain/kotlin/entity/Integration.kt b/core/src/commonMain/kotlin/entity/Integration.kt index 182b8a6fe803..3eef0926bf86 100644 --- a/core/src/commonMain/kotlin/entity/Integration.kt +++ b/core/src/commonMain/kotlin/entity/Integration.kt @@ -16,11 +16,8 @@ import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.rest.builder.integration.IntegrationModifyBuilder import dev.kord.rest.request.RestRequestException import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract -import kotlin.js.JsName -import kotlin.jvm.JvmName import kotlin.time.Duration /** @@ -53,10 +50,6 @@ public class Integration( public val isEnabled: Boolean get() = data.enabled - @Deprecated("Binary compatibility, was non-nullable before. Keep for some releases.", level = HIDDEN) - @JsName("_isSyncing") // binary compatibility with js doesn't matter as this is the first JS release - public fun isSyncing(): Boolean = isSyncing!! - /** * Whether this integrations is syncing. */ @@ -100,10 +93,6 @@ public class Integration( public val expireBehavior: IntegrationExpireBehavior? get() = data.expireBehavior.value - @Deprecated("Binary compatibility, was non-nullable before. Keep for some releases.", level = HIDDEN) - @JvmName("getExpireGracePeriod-UwyO8pc") - public fun expireGracePeriod0(): Duration = expireGracePeriod!! - /** * The grace period before expiring subscribers. */ diff --git a/core/src/commonMain/kotlin/entity/Member.kt b/core/src/commonMain/kotlin/entity/Member.kt index 64c2c4a59692..54e053f6d5b3 100644 --- a/core/src/commonMain/kotlin/entity/Member.kt +++ b/core/src/commonMain/kotlin/entity/Member.kt @@ -37,7 +37,7 @@ public class Member( "This was renamed to 'effectiveName' to avoid confusion with 'User.globalName' which is also called display " + "name.", ReplaceWith("this.effectiveName"), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public val displayName: String get() = effectiveName @@ -46,14 +46,6 @@ public class Member( */ public val effectiveName: String get() = nickname ?: (this as User).effectiveName - /** - * The members guild avatar as [Icon] object - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getMemberAvatar(): Icon? = - memberData.avatar.value?.let { Icon.MemberAvatar(memberData.guildId, id, it, kord) } - public val memberAvatarHash: String? get() = memberData.avatar.value /** The guild avatar of this member as an [Asset]. */ diff --git a/core/src/commonMain/kotlin/entity/Message.kt b/core/src/commonMain/kotlin/entity/Message.kt index 3943efcb0c2b..bc92071d25a7 100644 --- a/core/src/commonMain/kotlin/entity/Message.kt +++ b/core/src/commonMain/kotlin/entity/Message.kt @@ -305,7 +305,7 @@ public class Message( */ override suspend fun asMessage(): Message = this - @Deprecated("Renamed to 'getAuthorAsMember'.", ReplaceWith("this.getAuthorAsMember()"), DeprecationLevel.WARNING) + @Deprecated("Renamed to 'getAuthorAsMember'.", ReplaceWith("this.getAuthorAsMember()"), DeprecationLevel.ERROR) public suspend fun getAuthorAsMemberOrThrow(): Member = getAuthorAsMember() /** diff --git a/core/src/commonMain/kotlin/entity/PartialGuild.kt b/core/src/commonMain/kotlin/entity/PartialGuild.kt index d228f031e84b..616eedbadb4c 100644 --- a/core/src/commonMain/kotlin/entity/PartialGuild.kt +++ b/core/src/commonMain/kotlin/entity/PartialGuild.kt @@ -14,9 +14,6 @@ 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.rest.Image -import dev.kord.rest.service.RestClient -import kotlin.DeprecationLevel.HIDDEN public class PartialGuild( public val data: PartialGuildData, @@ -108,82 +105,6 @@ public class PartialGuild( */ public val approximatePresenceCount: Int? get() = data.approximatePresenceCount.value - /** - * Gets the discovery splash url in the specified [format], if present. - */ - @Deprecated( - "This method uses the wrong hash.", - ReplaceWith("this.splash?.cdnUrl?.toUrl { this@toUrl.format = format }"), - level = HIDDEN, - ) - public fun getDiscoverySplashUrl(format: Image.Format): String? = - getDiscoverySplashUrl0(format) - - private fun getDiscoverySplashUrl0(format: Image.Format) = - splashHash?.let { "discovery-splashes/$id/${it}.${format.extension}" } - - /** - * Requests to get the splash image in the specified [format], if present. - * - * This property is not resolvable through cache and will always use the [RestClient] instead. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated( - "This method uses the wrong hash.", - ReplaceWith("this.splash?.getImage(format)"), - level = HIDDEN, - ) - public suspend fun getDiscoverySplash(format: Image.Format): Image? { - val url = getDiscoverySplashUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - - - /** - * Gets the icon url, if present. - */ - @Deprecated("Old method", ReplaceWith("this.icon?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = HIDDEN) - public fun getIconUrl(format: Image.Format): String? = - getIconUrl0(format) - - private fun getIconUrl0(format: Image.Format): String? = - iconHash?.let { "https://cdn.discordapp.com/icons/$id/$it.${format.extension}" } - - - /** - * Requests to get the icon image in the specified [format], if present. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.icon?.getImage(format)"), level = HIDDEN) - public suspend fun getIcon(format: Image.Format): Image? { - val url = getIconUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - - - /** - * Gets the banner url in the specified format. - */ - @Deprecated("Old method", ReplaceWith("this.banner?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = HIDDEN) - public fun getBannerUrl(format: Image.Format): String? = - getBannerUrl0(format) - - private fun getBannerUrl0(format: Image.Format) = - data.banner.value?.let { "https://cdn.discordapp.com/banners/$id/$it.${format.extension}" } - - /** - * Requests to get the banner image in the specified [format], if present. - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.banner?.getImage(format)"), level = HIDDEN) - public suspend fun getBanner(format: Image.Format): Image? { - val url = getBannerUrl0(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - /** * Requests to get the full [Guild] entity for this [PartialGuild]. diff --git a/core/src/commonMain/kotlin/entity/Role.kt b/core/src/commonMain/kotlin/entity/Role.kt index ceccb661ba58..7ba49e4d5133 100644 --- a/core/src/commonMain/kotlin/entity/Role.kt +++ b/core/src/commonMain/kotlin/entity/Role.kt @@ -28,10 +28,6 @@ public data class Role( public val hoisted: Boolean get() = data.hoisted - @Suppress("DEPRECATION_ERROR") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getIcon(): Icon? = data.icon.value?.let { Icon.RoleIcon(data.id, it, kord) } - val iconHash: String? get() = data.icon.value val icon: Asset? get() = iconHash?.let { Asset.roleIcon(id, it, kord) } diff --git a/core/src/commonMain/kotlin/entity/Team.kt b/core/src/commonMain/kotlin/entity/Team.kt index 0e0c9ec956e7..c582b0c1e85d 100644 --- a/core/src/commonMain/kotlin/entity/Team.kt +++ b/core/src/commonMain/kotlin/entity/Team.kt @@ -21,12 +21,6 @@ public class Team( ) : KordEntity, Strategizable { override val id: Snowflake get() = data.id - /** - * The hash of this team's icon. - */ - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getIcon(): String? = data.icon - /** The hash of this team's icon. */ public val iconHash: String? get() = data.icon @@ -90,7 +84,7 @@ public class TeamMember(public val data: TeamMemberData, public val kord: Kord) @Deprecated( "'permissions' was never different from `[\"*\"]`. It is now replaced by 'role'.", ReplaceWith("this.role"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public val permissions: List get() = listOf("*") diff --git a/core/src/commonMain/kotlin/entity/User.kt b/core/src/commonMain/kotlin/entity/User.kt index 5c5f0a7adce8..b76e08c56bbc 100644 --- a/core/src/commonMain/kotlin/entity/User.kt +++ b/core/src/commonMain/kotlin/entity/User.kt @@ -4,12 +4,10 @@ import dev.kord.common.Color import dev.kord.common.entity.Snowflake import dev.kord.common.entity.UserFlags import dev.kord.core.Kord -import dev.kord.core.KordObject import dev.kord.core.behavior.UserBehavior import dev.kord.core.cache.data.UserData import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy -import dev.kord.rest.Image import kotlin.DeprecationLevel.WARNING /** @@ -40,24 +38,11 @@ public open class User( override val id: Snowflake get() = data.id - /** - * The users avatar as [Icon] object - */ - @Suppress("DEPRECATION_ERROR") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getAvatar(): Icon? = data.avatar?.let { Icon.UserAvatar(data.id, it, kord) } - public val avatarHash: String? get() = data.avatar /** The avatar of this user as an [Asset]. */ public val avatar: Asset? get() = avatarHash?.let { Asset.userAvatar(data.id, it, kord) } - @Suppress("DEPRECATION", "DEPRECATION_ERROR") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - public fun getDefaultAvatar(): Icon = - if (migratedToNewUsernameSystem) Icon.DefaultUserAvatar(userId = id, kord) - else Icon.DefaultUserAvatar(discriminator.toInt(), kord) - public val defaultAvatar: Asset get() = if (migratedToNewUsernameSystem) Asset.defaultUserAvatar(userId = id, kord) @@ -129,10 +114,6 @@ public open class User( public val accentColor: Color? get() = data.accentColor?.let { Color(it) } - @Deprecated("Old method", ReplaceWith("this.banner?.cdnUrl?.toUrl { this@toUrl.format = format }"), DeprecationLevel.HIDDEN) - public fun getBannerUrl(format: Image.Format): String? = - data.banner?.let { "https://cdn.discordapp.com/banners/$id/$it.${format.extension}" } - public val bannerHash: String? get() = data.banner public val banner: Asset? get() = bannerHash?.let { Asset.userBanner(id, it, kord) } @@ -152,113 +133,4 @@ public open class User( override fun toString(): String { return "User(data=$data, kord=$kord, supplier=$supplier)" } - - @Deprecated("Old class", ReplaceWith("Asset", "dev.kord.core.entity.Asset"), level = DeprecationLevel.HIDDEN) - public data class Avatar(val data: UserData, override val kord: Kord) : KordObject { - - /** - * The default avatar url for this user. Discord uses this for users who don't have a custom avatar set. - */ - val defaultUrl: String - get() = "https://cdn.discordapp.com/embed/avatars/${ - when (@Suppress("DEPRECATION") val discriminator = data.discriminator.value) { - null, "0" -> (data.id.value shr 22) % 6u - else -> discriminator.toInt() % 5 - } - }.png" - - /** - * Whether the user has set their avatar. - */ - val isCustom: Boolean get() = data.avatar != null - - /** - * Whether the user has an animated avatar. - */ - val isAnimated: Boolean get() = data.avatar?.startsWith("a_") ?: false - - /** - * A supported format, prioritizing [Image.Format.GIF] for animated avatars and [Image.Format.PNG] for others. - */ - val supportedFormat: Image.Format - get() = when { - isAnimated -> Image.Format.GIF - else -> Image.Format.PNG - } - - /** - * Gets the avatar url in a supported format (defined by [supportedFormat]) and default size. - */ - val url: String - get() = getUrl(supportedFormat) ?: defaultUrl - - /** - * Gets the avatar url in given [format], or returns null if the [format] is not supported. - */ - public fun getUrl(format: Image.Format): String? { - val hash = data.avatar ?: return defaultUrl - if (!isAnimated && format == Image.Format.GIF) return null - - return "https://cdn.discordapp.com/avatars/${data.id.value}/$hash.${format.extension}" - } - - /** - * Gets the avatar url in a supported format and given [size]. - */ - public fun getUrl(size: Image.Size): String { - return getUrl(supportedFormat, size)!! - } - - /** - * Gets the avatar url in given [format] and [size], or returns null if the [format] is not supported. - */ - public fun getUrl(format: Image.Format, size: Image.Size): String? { - val hash = data.avatar ?: return defaultUrl - if (!isAnimated && format == Image.Format.GIF) return null - - return "https://cdn.discordapp.com/avatars/${data.id.value}/$hash.${format.extension}?size=${size.maxRes}" - } - - /** - * Requests to get the [defaultUrl] as an [Image]. - */ - public suspend fun getDefaultImage(): Image = Image.fromUrl(kord.resources.httpClient, defaultUrl) - - /** - * Requests to get the avatar of the user as an [Image], prioritizing gif for animated avatars and png for others. - */ - public suspend fun getImage(): Image = Image.fromUrl(kord.resources.httpClient, url) - - /** - * Requests to get the avatar of the user as an [Image] given [format], or returns null if the format is not supported. - */ - public suspend fun getImage(format: Image.Format): Image? { - val url = getUrl(format) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - - /** - * Requests to get the avatar of the user as an [Image] in given [size]. - */ - public suspend fun getImage(size: Image.Size): Image { - return Image.fromUrl(kord.resources.httpClient, getUrl(size)) - } - - /** - * Requests to get the avatar of the user as an [Image] given [format] and [size], or returns null if the - * [format] is not supported. - */ - public suspend fun getImage(format: Image.Format, size: Image.Size): Image? { - val url = getUrl(format, size) ?: return null - - return Image.fromUrl(kord.resources.httpClient, url) - } - - override fun toString(): String { - return "Avatar(data=$data, kord=$kord)" - } - - } - } diff --git a/core/src/commonMain/kotlin/entity/channel/thread/ThreadChannel.kt b/core/src/commonMain/kotlin/entity/channel/thread/ThreadChannel.kt index decba0cb73fb..77fed89350c0 100644 --- a/core/src/commonMain/kotlin/entity/channel/thread/ThreadChannel.kt +++ b/core/src/commonMain/kotlin/entity/channel/thread/ThreadChannel.kt @@ -4,7 +4,6 @@ import dev.kord.common.entity.ArchiveDuration import dev.kord.common.entity.Permission.ManageChannels import dev.kord.common.entity.Permission.ManageMessages import dev.kord.common.entity.Snowflake -import dev.kord.common.entity.optional.OptionalInt import dev.kord.common.entity.optional.unwrap import dev.kord.common.entity.optional.value import dev.kord.core.Kord @@ -18,7 +17,6 @@ import dev.kord.core.entity.channel.MediaChannel import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.HIDDEN import kotlin.time.Duration public interface ThreadChannel : GuildMessageChannel, ThreadChannelBehavior { @@ -81,15 +79,9 @@ public interface ThreadChannel : GuildMessageChannel, ThreadChannelBehavior { */ public val rateLimitPerUser: Duration? get() = data.rateLimitPerUser.value - @Deprecated("Binary compatibility, had different return type before. Keep for some releases.", level = HIDDEN) - public fun getMemberCount(): OptionalInt = data.memberCount - /** An approximate count of users in this thread, stops counting at 50. */ public val memberCount: Int? get() = data.memberCount.value - @Deprecated("Binary compatibility, had different return type before. Keep for some releases.", level = HIDDEN) - public fun getMessageCount(): OptionalInt = data.messageCount - /** * Number of messages (not including the initial message or deleted messages) in this thread. * diff --git a/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt b/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt index f01d42bf6ba5..d2796074319c 100644 --- a/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt +++ b/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt @@ -62,7 +62,7 @@ public class StringSelectComponent(data: ComponentData) : SelectMenuComponent(da /** The possible options to choose from. */ @Suppress("EXTENSION_SHADOWED_BY_MEMBER") -@Deprecated("Replaced by member in StringSelectComponent.", ReplaceWith("this.options"), DeprecationLevel.WARNING) +@Deprecated("Replaced by member in StringSelectComponent.", ReplaceWith("this.options"), DeprecationLevel.ERROR) public val StringSelectComponent.options: List get() = options public class UserSelectComponent(data: ComponentData) : SelectMenuComponent(data) { diff --git a/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt b/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt index ca32f7a8cbbf..7040ed3c6d99 100644 --- a/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt +++ b/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt @@ -67,12 +67,6 @@ public class ThreadListSyncEvent( public val channels: Flow get() = supplier.getGuildChannels(guildId).filter { it.id in channelIds } - @Suppress("RedundantSuspendModifier") - @Deprecated("Replaced by 'channels' property.", ReplaceWith("this.channels"), DeprecationLevel.HIDDEN) - public suspend fun getChannels(): Flow { - return channels - } - override fun withStrategy(strategy: EntitySupplyStrategy<*>): ThreadListSyncEvent = ThreadListSyncEvent(data, kord, shard, customContext, strategy.supply(kord)) } diff --git a/core/src/commonMain/kotlin/event/gateway/Events.kt b/core/src/commonMain/kotlin/event/gateway/Events.kt index ca51c3418158..a1aa4be72303 100644 --- a/core/src/commonMain/kotlin/event/gateway/Events.kt +++ b/core/src/commonMain/kotlin/event/gateway/Events.kt @@ -14,8 +14,6 @@ import dev.kord.gateway.Gateway import dev.kord.gateway.GatewayCloseCode import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filter -import kotlin.DeprecationLevel.HIDDEN -import kotlin.jvm.JvmName public sealed class GatewayEvent : Event @@ -155,11 +153,6 @@ public class ReadyEvent( public fun getGuilds(): Flow = supplier.guilds.filter { it.id in guildIds } - @Suppress("RedundantSuspendModifier") - @Deprecated("Binary compatibility, keep for some releases.", level = HIDDEN) - @JvmName("getGuilds") - public suspend fun getGuilds0(): Flow = getGuilds() - override fun withStrategy(strategy: EntitySupplyStrategy<*>): ReadyEvent = ReadyEvent(gatewayVersion, guildIds, self, sessionId, resumeGatewayUrl, kord, shard, customContext, strategy.supply(kord)) diff --git a/gateway/src/commonMain/kotlin/Event.kt b/gateway/src/commonMain/kotlin/Event.kt index 7f223ca355a0..cbdd5f807f0b 100644 --- a/gateway/src/commonMain/kotlin/Event.kt +++ b/gateway/src/commonMain/kotlin/Event.kt @@ -592,11 +592,11 @@ public data class Heartbeat(val data: Long) : Event() { } public companion object NewCompanion { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("Heartbeat.serializer()", imports = ["dev.kord.gateway.Heartbeat"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val Companion: Companion = Companion() @@ -605,7 +605,7 @@ public data class Heartbeat(val data: Long) : Event() { @Deprecated( "Renamed to 'NewCompanion', which no longer implements 'KSerializer'.", ReplaceWith("Heartbeat.serializer()", imports = ["dev.kord.gateway.Heartbeat"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class Companion internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this diff --git a/gateway/src/commonMain/kotlin/Intent.kt b/gateway/src/commonMain/kotlin/Intent.kt index e5daddb1dcfa..72b3d2b5284b 100644 --- a/gateway/src/commonMain/kotlin/Intent.kt +++ b/gateway/src/commonMain/kotlin/Intent.kt @@ -102,7 +102,7 @@ public sealed class Intent( @Deprecated( "Renamed to 'GuildModeration'.", ReplaceWith("Intent.GuildModeration", imports = ["dev.kord.gateway.Intent"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public object GuildBans : Intent(2) @@ -283,7 +283,7 @@ public sealed class Intent( @Deprecated( "Renamed to 'entries'.", ReplaceWith("Intent.entries", imports = ["dev.kord.gateway.Intent"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public val values: Set get() = entries.toSet() @@ -438,10 +438,10 @@ public class Intents internal constructor( return Builder(code.copy()).apply(builder).build() } - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") + @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun copy(block: IntentsBuilder.() -> Unit): Intents { @@ -462,6 +462,7 @@ public class Intents internal constructor( @Deprecated( message = "Intents is no longer a data class.", replaceWith = ReplaceWith(expression = "this.code", imports = arrayOf()), + DeprecationLevel.ERROR, ) public operator fun component1(): DiscordBitSet = code @@ -469,13 +470,13 @@ public class Intents internal constructor( * @suppress */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) - @Deprecated(message = "Intents is no longer a data class. Deprecated without a replacement.") + @Deprecated(message = "Intents is no longer a data class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun copy(code: DiscordBitSet = this.code): Intents = Intents(code) @Deprecated( "Renamed to 'Builder'.", ReplaceWith("Intents.Builder", imports = ["dev.kord.gateway.Intents"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class IntentsBuilder(code: DiscordBitSet = EmptyBitSet()) { private val delegate = Builder(code) @@ -542,7 +543,7 @@ public class Intents internal constructor( @Deprecated( "Renamed to 'ALL'", ReplaceWith("Intents.ALL", imports = [" dev.kord.gateway.Intents", " dev.kord.gateway.ALL"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @PrivilegedIntent public val all: Intents get() = ALL @@ -550,7 +551,7 @@ public class Intents internal constructor( @Deprecated( "Renamed to 'PRIVILEGED'", ReplaceWith("Intents.PRIVILEGED", imports = [" dev.kord.gateway.Intents", " dev.kord.gateway.PRIVILEGED"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @PrivilegedIntent public val privileged: Intents get() = PRIVILEGED @@ -561,14 +562,14 @@ public class Intents internal constructor( "Intents.NON_PRIVILEGED", imports = [" dev.kord.gateway.Intents", " dev.kord.gateway.NON_PRIVILEGED"], ), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public val nonPrivileged: Intents get() = NON_PRIVILEGED @Deprecated( "Renamed to 'NONE'", ReplaceWith("Intents.NONE", imports = [" dev.kord.gateway.Intents", " dev.kord.gateway.NONE"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public val none: Intents get() = NONE } @@ -577,7 +578,7 @@ public class Intents internal constructor( @Deprecated( "Replaced by 'Intents.serializer()'.", ReplaceWith("Intents.serializer()", imports = ["dev.kord.gateway.Intents"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public object IntentsSerializer : KSerializer by Intents.Serializer @@ -590,8 +591,8 @@ public inline fun Intents(builder: Intents.Builder.() -> Unit = {}): Intents { return Intents.Builder().apply(builder).build() } -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") -@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.WARNING) +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") +@Deprecated("'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", level = DeprecationLevel.ERROR) @kotlin.internal.LowPriorityInOverloadResolution public inline fun Intents(builder: Intents.IntentsBuilder.() -> Unit = {}): Intents { contract { callsInPlace(builder, EXACTLY_ONCE) } @@ -639,6 +640,6 @@ public fun IntentsWithIterable(flags: Iterable): Intents = Intents(flag "Intents.Builder(DiscordBitSet(value)).build()", imports = ["dev.kord.gateway.Intents", "dev.kord.common.DiscordBitSet"], ), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public fun Intents(value: String): Intents = Intents(DiscordBitSet(value)) diff --git a/gateway/src/commonMain/kotlin/OpCode.kt b/gateway/src/commonMain/kotlin/OpCode.kt index 232b830e8e71..cdc911e6bd04 100644 --- a/gateway/src/commonMain/kotlin/OpCode.kt +++ b/gateway/src/commonMain/kotlin/OpCode.kt @@ -76,11 +76,11 @@ public enum class OpCode(public val code: Int) { } public companion object { - @Suppress("DEPRECATION") + @Suppress("DEPRECATION_ERROR") @Deprecated( "Renamed to 'Companion', which no longer implements 'KSerializer'.", ReplaceWith("OpCode.serializer()", imports = ["dev.kord.gateway.OpCode"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) @JvmField public val OpCodeSerializer: OpCodeSerializer = OpCodeSerializer() @@ -89,7 +89,7 @@ public enum class OpCode(public val code: Int) { @Deprecated( "Renamed to 'Companion', which no longer implements 'KSerializer'.", ReplaceWith("OpCode.serializer()", imports = ["dev.kord.gateway.OpCode"]), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public class OpCodeSerializer internal constructor() : KSerializer by Serializer { public fun serializer(): KSerializer = this diff --git a/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt b/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt index ab5138fe8fbe..3ddf8b437066 100644 --- a/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt +++ b/gateway/src/commonMain/kotlin/builder/LoginBuilder.kt @@ -22,10 +22,10 @@ public class LoginBuilder { this.presence = PresenceBuilder().apply(builder).toPresence() } - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION") + @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR") @Deprecated( "'Intents.IntentsBuilder' is deprecated, use 'Intents.Builder' instead.", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) @kotlin.internal.LowPriorityInOverloadResolution public inline fun intents(builder: Intents.IntentsBuilder.() -> Unit) { diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt b/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt index 19593a3ddb3a..efc9b85a225a 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/BitFlagsGeneration.kt @@ -131,7 +131,7 @@ internal fun BitFlags.generateFileSpec(originatingFile: KSFile) = fileSpecForGen Deprecated( "Renamed to 'values'.", ReplaceWith("this.values", imports = emptyArray()), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) ) getter { diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt b/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt index f753300b1e83..5d15f02b16e0 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/Builder.kt @@ -55,7 +55,7 @@ internal fun TypeSpec.Builder.addBuilder() = addClass(builderCN) { Deprecated( "Renamed to 'build'", ReplaceWith("this.build()", imports = emptyArray()), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) ) returns(collectionCN) diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/DataClassArtifacts.kt b/ksp-processors/src/main/kotlin/generation/bitflags/DataClassArtifacts.kt index e1b297e9714a..9ff4e8f86eba 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/DataClassArtifacts.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/DataClassArtifacts.kt @@ -11,7 +11,7 @@ import dev.kord.ksp.generation.GenerationEntity.BitFlags import dev.kord.ksp.generation.shared.GenerationContext // TODO bump LEVEL and remove this file eventually -private val LEVEL = DeprecationLevel.WARNING +private val LEVEL = DeprecationLevel.ERROR context(BitFlags, GenerationContext) @OptIn(DelicateKotlinPoetApi::class) diff --git a/ksp-processors/src/main/kotlin/generation/bitflags/EnumArtifacts.kt b/ksp-processors/src/main/kotlin/generation/bitflags/EnumArtifacts.kt index 460ce8e28104..22e9434421d6 100644 --- a/ksp-processors/src/main/kotlin/generation/bitflags/EnumArtifacts.kt +++ b/ksp-processors/src/main/kotlin/generation/bitflags/EnumArtifacts.kt @@ -13,8 +13,8 @@ import kotlin.DeprecationLevel.HIDDEN import kotlin.enums.EnumEntries // TODO bump LEVEL and ENUM_ENTRIES_LEVEL and remove this file eventually -private val LEVEL = DeprecationLevel.WARNING -private val ENUM_ENTRIES_LEVEL = DeprecationLevel.ERROR // deprecated before released, only present in snapshots +private val LEVEL = DeprecationLevel.ERROR +private val ENUM_ENTRIES_LEVEL = HIDDEN // deprecated before released, only present in snapshots private val CLASS = ClassName("dev.kord.common", "Class") private val JAVA = MemberName("dev.kord.common", "java") diff --git a/ksp-processors/src/main/kotlin/generation/kordenum/KordEnumGeneration.kt b/ksp-processors/src/main/kotlin/generation/kordenum/KordEnumGeneration.kt index 9751dfc29cbf..8babde45cdd0 100644 --- a/ksp-processors/src/main/kotlin/generation/kordenum/KordEnumGeneration.kt +++ b/ksp-processors/src/main/kotlin/generation/kordenum/KordEnumGeneration.kt @@ -46,7 +46,7 @@ internal fun KordEnum.generateFileSpec(originatingFile: KSFile) = fileSpecForGen Deprecated( "Replaced by '$entityName.from()'.", ReplaceWith("$entityName.from($valueName)", entityCN.canonicalName), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) ) addModifiers(PUBLIC) diff --git a/rest/api/rest.api b/rest/api/rest.api index c97a969bb8bd..d78ea3fd1456 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -304,7 +304,7 @@ public final class dev/kord/rest/builder/automoderation/KeywordPresetAutoModerat } public abstract interface class dev/kord/rest/builder/automoderation/MentionSpamAutoModerationRuleBuilder : dev/kord/rest/builder/automoderation/TimeoutAutoModerationRuleBuilder { - public abstract fun assignMentionLimit (I)V + public abstract synthetic fun assignMentionLimit (I)V public abstract fun getMentionLimit ()Ljava/lang/Integer; public abstract fun getMentionRaidProtectionEnabled ()Ljava/lang/Boolean; public abstract fun getTriggerType ()Ldev/kord/common/entity/AutoModerationRuleTriggerType$MentionSpam; @@ -318,21 +318,21 @@ public final class dev/kord/rest/builder/automoderation/MentionSpamAutoModeratio public final class dev/kord/rest/builder/automoderation/MentionSpamAutoModerationRuleCreateBuilder : dev/kord/rest/builder/automoderation/AutoModerationRuleCreateBuilder, dev/kord/rest/builder/automoderation/MentionSpamAutoModerationRuleBuilder { public fun (Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;)V - public fun (Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;I)V - public fun assignMentionLimit (I)V + public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;I)V + public synthetic fun assignMentionLimit (I)V public synthetic fun buildTriggerMetadata ()Ldev/kord/common/entity/optional/Optional; public fun getMentionLimit ()Ljava/lang/Integer; public fun getMentionRaidProtectionEnabled ()Ljava/lang/Boolean; public fun getTriggerType ()Ldev/kord/common/entity/AutoModerationRuleTriggerType$MentionSpam; public synthetic fun getTriggerType ()Ldev/kord/common/entity/AutoModerationRuleTriggerType; - public fun setMentionLimit (I)V + public synthetic fun setMentionLimit (I)V public fun setMentionLimit (Ljava/lang/Integer;)V public fun setMentionRaidProtectionEnabled (Ljava/lang/Boolean;)V } public final class dev/kord/rest/builder/automoderation/MentionSpamAutoModerationRuleModifyBuilder : dev/kord/rest/builder/automoderation/AutoModerationRuleModifyBuilder, dev/kord/rest/builder/automoderation/MentionSpamAutoModerationRuleBuilder { public fun ()V - public fun assignMentionLimit (I)V + public synthetic fun assignMentionLimit (I)V public fun getMentionLimit ()Ljava/lang/Integer; public fun getMentionRaidProtectionEnabled ()Ljava/lang/Boolean; public fun getTriggerType ()Ldev/kord/common/entity/AutoModerationRuleTriggerType$MentionSpam; @@ -1662,8 +1662,6 @@ public final class dev/kord/rest/builder/interaction/InputChatBuildersKt { public static synthetic fun channel$default (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public static final fun group (Ldev/kord/rest/builder/interaction/RootInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun group$default (Ldev/kord/rest/builder/interaction/RootInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V - public static final synthetic fun int (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V - public static synthetic fun int$default (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public static final fun integer (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun integer$default (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public static final fun mentionable (Ldev/kord/rest/builder/interaction/BaseInputChatBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V @@ -7352,7 +7350,7 @@ public final class dev/kord/rest/service/AutoModerationService : dev/kord/rest/s public static synthetic fun createAutoModerationRule$default (Ldev/kord/rest/service/AutoModerationService;Ldev/kord/common/entity/Snowflake;Ldev/kord/rest/json/request/AutoModerationRuleCreateRequest;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun createKeywordAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun createKeywordPresetAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun createMentionSpamAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;ILkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final synthetic fun createMentionSpamAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;ILkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun createMentionSpamAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun createSpamAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/AutoModerationRuleEventType;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun deleteAutoModerationRule (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt index d66678677fb7..ebe5869a8440 100644 --- a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt @@ -313,7 +313,7 @@ public sealed interface MentionSpamAutoModerationRuleBuilder : TimeoutAutoModera @Deprecated( "This can be replaced with 'mentionLimit', it is now a 'var'.", ReplaceWith("this.run { this@run.mentionLimit = mentionLimit }"), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public fun assignMentionLimit(mentionLimit: Int) diff --git a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleCreateBuilder.kt b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleCreateBuilder.kt index 8ccd01b8fd6a..c52dfd44f489 100644 --- a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleCreateBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleCreateBuilder.kt @@ -126,7 +126,7 @@ public class MentionSpamAutoModerationRuleCreateBuilder( "MentionSpamAutoModerationRuleCreateBuilder(name, eventType).apply { this@apply.mentionLimit = mentionLimit }", imports = ["dev.kord.rest.builder.automoderation.MentionSpamAutoModerationRuleCreateBuilder"], ), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public constructor(name: String, eventType: AutoModerationRuleEventType, mentionLimit: Int) : this( name, @@ -139,7 +139,7 @@ public class MentionSpamAutoModerationRuleCreateBuilder( @Deprecated( "This can be replaced with 'mentionLimit', it is now a 'var'.", ReplaceWith("this.run { this@run.mentionLimit = mentionLimit }"), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) override fun assignMentionLimit(mentionLimit: Int) { this.mentionLimit = mentionLimit @@ -150,7 +150,7 @@ public class MentionSpamAutoModerationRuleCreateBuilder( @Deprecated( "This can be replaced with 'mentionLimit', it is now a 'var'.", ReplaceWith("this.run { this@run.mentionLimit = mentionLimit }"), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public open fun setMentionLimit(mentionLimit: Int) { this.mentionLimit = mentionLimit diff --git a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleModifyBuilder.kt b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleModifyBuilder.kt index bff4145e37d3..56cde798723f 100644 --- a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleModifyBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleModifyBuilder.kt @@ -151,7 +151,7 @@ public class MentionSpamAutoModerationRuleModifyBuilder : @Deprecated( "This can be replaced with 'mentionLimit', it is now a 'var'.", ReplaceWith("this.run { this@run.mentionLimit = mentionLimit }"), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) override fun assignMentionLimit(mentionLimit: Int) { this.mentionLimit = mentionLimit diff --git a/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt b/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt index ebd0fe46c88d..016ebb10a1cf 100644 --- a/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt @@ -65,7 +65,7 @@ public class StringSelectBuilder(customId: String) : SelectMenuBuilder(customId) /** The choices in the select, max 25. */ @Suppress("EXTENSION_SHADOWED_BY_MEMBER") -@Deprecated("Replaced by member in StringSelectBuilder.", ReplaceWith("this.options"), DeprecationLevel.WARNING) +@Deprecated("Replaced by member in StringSelectBuilder.", ReplaceWith("this.options"), DeprecationLevel.ERROR) public var StringSelectBuilder.options: MutableList get() = options set(value) { diff --git a/rest/src/commonMain/kotlin/builder/interaction/InputChatBuilders.kt b/rest/src/commonMain/kotlin/builder/interaction/InputChatBuilders.kt index 3c4449a4fa3e..dbd3c150f5ce 100644 --- a/rest/src/commonMain/kotlin/builder/interaction/InputChatBuilders.kt +++ b/rest/src/commonMain/kotlin/builder/interaction/InputChatBuilders.kt @@ -9,7 +9,6 @@ import dev.kord.common.entity.optional.delegate.delegate import dev.kord.common.entity.optional.mapList import dev.kord.rest.json.request.ApplicationCommandCreateRequest import dev.kord.rest.json.request.ApplicationCommandModifyRequest -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -83,20 +82,6 @@ public inline fun BaseInputChatBuilder.string( options!!.add(StringChoiceBuilder(name, description).apply(builder)) } -@Deprecated( - "Renamed to 'integer'.", - ReplaceWith("this.integer(name, description) { builder() }", "dev.kord.rest.builder.interaction.integer"), - level = HIDDEN, -) -public inline fun BaseInputChatBuilder.int( - name: String, - description: String, - builder: IntegerOptionBuilder.() -> Unit = {}, -) { - contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } - integer(name, description, builder) -} - public inline fun BaseInputChatBuilder.integer( name: String, description: String, diff --git a/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt b/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt index a6e9fa79e066..7ad774cb0ae2 100644 --- a/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt +++ b/rest/src/commonMain/kotlin/json/request/InteractionsRequests.kt @@ -80,7 +80,7 @@ public data class AutoCompleteResponseCreateRequest( @Deprecated( "AutoCompleteResponseCreateRequest is no longer generic", ReplaceWith("this.serializer()"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public fun serializer(typeSerial0: KSerializer): KSerializer = serializer() diff --git a/rest/src/commonMain/kotlin/service/AutoModerationService.kt b/rest/src/commonMain/kotlin/service/AutoModerationService.kt index f21b24effa1d..d3b59a114afe 100644 --- a/rest/src/commonMain/kotlin/service/AutoModerationService.kt +++ b/rest/src/commonMain/kotlin/service/AutoModerationService.kt @@ -85,7 +85,7 @@ public class AutoModerationService(requestHandler: RequestHandler) : RestService "this.createMentionSpamAutoModerationRule(guildId, name, eventType) { " + "this@createMentionSpamAutoModerationRule.mentionLimit = mentionLimit\nbuilder() }" ), - DeprecationLevel.ERROR, + DeprecationLevel.HIDDEN, ) public suspend inline fun createMentionSpamAutoModerationRule( guildId: Snowflake, diff --git a/rest/src/commonMain/kotlin/service/InteractionService.kt b/rest/src/commonMain/kotlin/service/InteractionService.kt index 8a29df266fad..ef943b80f0a5 100644 --- a/rest/src/commonMain/kotlin/service/InteractionService.kt +++ b/rest/src/commonMain/kotlin/service/InteractionService.kt @@ -127,7 +127,7 @@ public class InteractionService(requestHandler: RequestHandler) : RestService(re @Deprecated( "DiscordAutoComplete is no longer generic and the typeSerializer argument is no longer needed.", ReplaceWith("this.createAutoCompleteInteractionResponse(interactionId, interactionToken, autoComplete)"), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public suspend inline fun createAutoCompleteInteractionResponse( interactionId: Snowflake, diff --git a/voice/api/voice.api b/voice/api/voice.api index c09bcaaf70d0..8d67d7ca5657 100644 --- a/voice/api/voice.api +++ b/voice/api/voice.api @@ -254,7 +254,7 @@ public abstract class dev/kord/voice/SpeakingFlag { public final fun equals (Ljava/lang/Object;)Z public final fun getCode ()I public final fun getDeclaringClass ()Ljava/lang/Class; - public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getShift ()I public final fun hashCode ()I public final fun name ()Ljava/lang/String; @@ -269,7 +269,7 @@ public abstract class dev/kord/voice/SpeakingFlag { public final class dev/kord/voice/SpeakingFlag$Companion { public final fun fromShift (I)Ldev/kord/voice/SpeakingFlag; public final fun getEntries ()Ljava/util/List; - public fun getEntries ()Lkotlin/enums/EnumEntries; + public synthetic fun getEntries ()Lkotlin/enums/EnumEntries; public fun valueOf (Ljava/lang/String;)Ldev/kord/voice/SpeakingFlag; public fun values ()[Ldev/kord/voice/SpeakingFlag; } diff --git a/voice/build/generated/ksp/main/kotlin/dev/kord/voice/EncryptionMode.kt b/voice/build/generated/ksp/main/kotlin/dev/kord/voice/EncryptionMode.kt index 9de731e7a3b4..8af4ff9f1a3c 100644 --- a/voice/build/generated/ksp/main/kotlin/dev/kord/voice/EncryptionMode.kt +++ b/voice/build/generated/ksp/main/kotlin/dev/kord/voice/EncryptionMode.kt @@ -44,6 +44,7 @@ public sealed class EncryptionMode( unused: Nothing?, ) : EncryptionMode(value) { @Deprecated( + level = DeprecationLevel.ERROR, message = "Replaced by 'EncryptionMode.from()'.", replaceWith = ReplaceWith(expression = "EncryptionMode.from(value)", imports = arrayOf("dev.kord.voice.EncryptionMode")), diff --git a/voice/src/main/kotlin/SpeakingFlag.kt b/voice/src/main/kotlin/SpeakingFlag.kt index 73abd32646a3..fc24599355c7 100644 --- a/voice/src/main/kotlin/SpeakingFlag.kt +++ b/voice/src/main/kotlin/SpeakingFlag.kt @@ -83,7 +83,7 @@ public sealed class SpeakingFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SpeakingFlag is no longer an enum class. Deprecated without a replacement.") + "SpeakingFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun name(): String = this::class.simpleName!! /** @@ -91,7 +91,7 @@ public sealed class SpeakingFlag( */ @Suppress(names = arrayOf("DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SpeakingFlag is no longer an enum class. Deprecated without a replacement.") + "SpeakingFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) public fun ordinal(): Int = when (this) { Microphone -> 0 Soundshare -> 1 @@ -106,6 +106,7 @@ public sealed class SpeakingFlag( message = "SpeakingFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SpeakingFlag::class.java", imports = arrayOf("dev.kord.voice.SpeakingFlag")), + DeprecationLevel.ERROR, ) public fun getDeclaringClass(): Class = SpeakingFlag::class.java @@ -185,7 +186,7 @@ public sealed class SpeakingFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "DeprecatedCallableAddReplaceWith")) @Deprecated(message = - "SpeakingFlag is no longer an enum class. Deprecated without a replacement.") + "SpeakingFlag is no longer an enum class. Deprecated without a replacement.", level = DeprecationLevel.ERROR) @JvmStatic public open fun valueOf(name: String): SpeakingFlag = when (name) { "Microphone" -> Microphone @@ -202,6 +203,7 @@ public sealed class SpeakingFlag( message = "SpeakingFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SpeakingFlag.entries.toTypedArray()", imports = arrayOf("dev.kord.voice.SpeakingFlag")), + DeprecationLevel.ERROR, ) @JvmStatic public open fun values(): Array = entries.toTypedArray() @@ -211,7 +213,7 @@ public sealed class SpeakingFlag( */ @Suppress(names = arrayOf("NON_FINAL_MEMBER_IN_OBJECT", "UPPER_BOUND_VIOLATED")) @Deprecated( - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, message = "SpeakingFlag is no longer an enum class.", replaceWith = ReplaceWith(expression = "SpeakingFlag.entries", imports = arrayOf("dev.kord.voice.SpeakingFlag")), @@ -323,6 +325,7 @@ public class SpeakingFlags internal constructor( @Deprecated( message = "Renamed to 'values'.", replaceWith = ReplaceWith(expression = "this.values", imports = arrayOf()), + DeprecationLevel.ERROR, ) public val flags: List get() = values.toList() @@ -424,6 +427,7 @@ public class SpeakingFlags internal constructor( @Deprecated( message = "Renamed to 'build'", replaceWith = ReplaceWith(expression = "this.build()", imports = arrayOf()), + DeprecationLevel.ERROR, ) public fun flags(): SpeakingFlags = build() }