From 16f41661afc5d99dff095d86d032fb1cd0c8b572 Mon Sep 17 00:00:00 2001 From: lukellmann Date: Fri, 7 Jul 2023 23:02:51 +0200 Subject: [PATCH] Bump DeprecationLevels WARNING -> ERROR ERROR -> HIDDEN HIDDEN -> remove --- common/api/common.api | 47 ----------- .../dev/kord/common/entity/ComponentType.kt | 14 ---- .../dev/kord/common/entity/GuildFeature.kt | 27 ------- common/src/commonMain/kotlin/KordConstants.kt | 19 ----- .../kotlin/entity/DiscordComponent.kt | 8 -- .../commonMain/kotlin/entity/DiscordGuild.kt | 15 ---- .../commonMain/kotlin/entity/DiscordNull.kt | 40 ---------- .../commonMain/kotlin/entity/Interactions.kt | 55 ------------- .../commonMain/kotlin/entity/Permission.kt | 2 +- core/api/core.api | 69 +++++----------- core/src/commonMain/kotlin/Kord.kt | 4 +- .../kotlin/behavior/GuildBehavior.kt | 2 +- .../behavior/channel/NewsChannelBehavior.kt | 35 -------- .../behavior/channel/TextChannelBehavior.kt | 51 ------------ .../AutoCompleteInteractionBehavior.kt | 11 --- core/src/commonMain/kotlin/entity/Guild.kt | 38 ++++++--- core/src/commonMain/kotlin/entity/Icon.kt | 2 +- core/src/commonMain/kotlin/entity/Member.kt | 2 +- core/src/commonMain/kotlin/entity/Message.kt | 22 ++---- .../commonMain/kotlin/entity/PartialGuild.kt | 29 ++++--- core/src/commonMain/kotlin/entity/User.kt | 5 +- .../kotlin/entity/component/Component.kt | 3 +- .../entity/component/SelectMenuComponent.kt | 47 ++--------- .../interaction/ComponentInteraction.kt | 3 +- .../kotlin/event/channel/TypingStartEvent.kt | 13 --- .../channel/thread/ThreadListSyncEvent.kt | 2 +- .../event/message/MessageBulkDeleteEvent.kt | 7 -- .../event/message/MessageCreateEvent.kt | 13 --- .../event/message/MessageDeleteEvent.kt | 7 -- .../kotlin/event/message/ReactionAddEvent.kt | 7 -- .../event/message/ReactionRemoveAllEvent.kt | 7 -- .../event/message/ReactionRemoveEvent.kt | 7 -- rest/api/rest.api | 15 ++-- .../AutoModerationRuleBuilder.kt | 12 +-- .../AutoModerationRuleCreateBuilder.kt | 6 +- .../AutoModerationRuleModifyBuilder.kt | 2 +- .../channel/thread/StartThreadBuilder.kt | 12 --- .../thread/StartThreadWithMessageBuilder.kt | 12 --- .../builder/component/ActionRowBuilder.kt | 18 ----- .../builder/component/SelectMenuBuilder.kt | 79 +++---------------- .../kotlin/service/AutoModerationService.kt | 2 +- 41 files changed, 109 insertions(+), 662 deletions(-) delete mode 100644 common/src/commonMain/kotlin/entity/DiscordNull.kt diff --git a/common/api/common.api b/common/api/common.api index fd97a5c870d3..a39ed69fd3ca 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -89,10 +89,6 @@ public final class dev/kord/common/KordConstants { public static final field INSTANCE Ldev/kord/common/KordConstants; public final fun getCOMMIT_HASH ()Ljava/lang/String; public final fun getGITHUB_URL ()Ljava/lang/String; - public final synthetic fun getKORD_COMMIT_HASH ()Ljava/lang/String; - public final synthetic fun getKORD_GITHUB_URL ()Ljava/lang/String; - public final synthetic fun getKORD_SHORT_COMMIT_HASH ()Ljava/lang/String; - public final synthetic fun getKORD_VERSION ()Ljava/lang/String; public final fun getSHORT_COMMIT_HASH ()Ljava/lang/String; public final fun getUSER_AGENT ()Ljava/lang/String; public final fun getVERSION ()Ljava/lang/String; @@ -1569,22 +1565,6 @@ public final class dev/kord/common/entity/Choice$Companion { public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer; } -public final class dev/kord/common/entity/Choice$IntChoice : dev/kord/common/entity/Choice { - public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;J)V - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ldev/kord/common/entity/optional/Optional; - public final fun component3 ()J - public final fun copy (Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;J)Ldev/kord/common/entity/Choice$IntChoice; - public static synthetic fun copy$default (Ldev/kord/common/entity/Choice$IntChoice;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;JILjava/lang/Object;)Ldev/kord/common/entity/Choice$IntChoice; - public fun equals (Ljava/lang/Object;)Z - public fun getName ()Ljava/lang/String; - public fun getNameLocalizations ()Ldev/kord/common/entity/optional/Optional; - public fun getValue ()Ljava/lang/Long; - public synthetic fun getValue ()Ljava/lang/Object; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - public final class dev/kord/common/entity/Choice$IntegerChoice : dev/kord/common/entity/Choice { public fun (Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;J)V public final fun component1 ()Ljava/lang/String; @@ -1872,10 +1852,6 @@ public final class dev/kord/common/entity/ComponentType$RoleSelect : dev/kord/co public static final field INSTANCE Ldev/kord/common/entity/ComponentType$RoleSelect; } -public final class dev/kord/common/entity/ComponentType$SelectMenu : dev/kord/common/entity/ComponentType { - public static final field INSTANCE Ldev/kord/common/entity/ComponentType$SelectMenu; -} - public final class dev/kord/common/entity/ComponentType$StringSelect : dev/kord/common/entity/ComponentType { public static final field INSTANCE Ldev/kord/common/entity/ComponentType$StringSelect; } @@ -4709,14 +4685,6 @@ public final class dev/kord/common/entity/DiscordModal$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/kord/common/entity/DiscordNull { - public static final field Companion Ldev/kord/common/entity/DiscordNull$Companion; -} - -public final class dev/kord/common/entity/DiscordNull$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - public final class dev/kord/common/entity/DiscordOnboardingPrompt { public static final field Companion Ldev/kord/common/entity/DiscordOnboardingPrompt$Companion; public synthetic fun (ILdev/kord/common/entity/Snowflake;Ldev/kord/common/entity/OnboardingPromptType;Ljava/util/List;Ljava/lang/String;ZZZLkotlinx/serialization/internal/SerializationConstructorMarker;)V @@ -6549,10 +6517,6 @@ public final class dev/kord/common/entity/GuildFeature$MemberVerificationGateEna public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$MemberVerificationGateEnabled; } -public final class dev/kord/common/entity/GuildFeature$MonetizationEnabled : dev/kord/common/entity/GuildFeature { - public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$MonetizationEnabled; -} - public final class dev/kord/common/entity/GuildFeature$MoreStickers : dev/kord/common/entity/GuildFeature { public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$MoreStickers; } @@ -6569,10 +6533,6 @@ public final class dev/kord/common/entity/GuildFeature$PreviewEnabled : dev/kord public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$PreviewEnabled; } -public final class dev/kord/common/entity/GuildFeature$PrivateThreads : dev/kord/common/entity/GuildFeature { - public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$PrivateThreads; -} - public final class dev/kord/common/entity/GuildFeature$RaidAlertsDisabled : dev/kord/common/entity/GuildFeature { public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$RaidAlertsDisabled; } @@ -6962,13 +6922,6 @@ public final class dev/kord/common/entity/InteractionType$Unknown : dev/kord/com public fun (I)V } -public final class dev/kord/common/entity/InteractionsKt { - public static final synthetic fun boolean (Ldev/kord/common/entity/CommandArgument;)Z - public static final synthetic fun int (Ldev/kord/common/entity/CommandArgument;)J - public static final synthetic fun snowflake (Ldev/kord/common/entity/CommandArgument;)Ldev/kord/common/entity/Snowflake; - public static final synthetic fun string (Ldev/kord/common/entity/CommandArgument;)Ljava/lang/String; -} - public abstract class dev/kord/common/entity/InviteTargetType { public static final field Companion Ldev/kord/common/entity/InviteTargetType$Companion; public synthetic fun (ILkotlin/jvm/internal/DefaultConstructorMarker;)V 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 a087d810bfc8..d1782398456a 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 @@ -6,11 +6,8 @@ package dev.kord.common.entity import kotlin.Any import kotlin.Boolean -import kotlin.Deprecated -import kotlin.DeprecationLevel import kotlin.Int import kotlin.LazyThreadSafetyMode.PUBLICATION -import kotlin.ReplaceWith import kotlin.String import kotlin.Suppress import kotlin.collections.List @@ -90,17 +87,6 @@ public sealed class ComponentType( */ public object ChannelSelect : ComponentType(8) - /** - * A select menu for picking from choices. - */ - @Deprecated( - level = DeprecationLevel.HIDDEN, - message = "Renamed by discord", - replaceWith = ReplaceWith(expression = "StringSelect", imports = - arrayOf("dev.kord.common.entity.ComponentType.StringSelect")), - ) - public object SelectMenu : ComponentType(3) - internal object Serializer : KSerializer { public override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("dev.kord.common.entity.ComponentType", PrimitiveKind.INT) 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 df34be3335b0..1807d0081fee 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 @@ -6,11 +6,8 @@ package dev.kord.common.entity import kotlin.Any import kotlin.Boolean -import kotlin.Deprecated -import kotlin.DeprecationLevel import kotlin.Int import kotlin.LazyThreadSafetyMode.PUBLICATION -import kotlin.ReplaceWith import kotlin.String import kotlin.Suppress import kotlin.collections.List @@ -122,17 +119,6 @@ public sealed class GuildFeature( */ public object MemberVerificationGateEnabled : GuildFeature("MEMBER_VERIFICATION_GATE_ENABLED") - /** - * Guild has enabled monetization. - */ - @Deprecated( - level = DeprecationLevel.HIDDEN, - message = "Replaced by CreatorMonetizableProvisional.", - replaceWith = ReplaceWith(expression = "GuildFeature.CreatorMonetizableProvisional", imports - = arrayOf("dev.kord.common.entitiy.GuildFeature")), - ) - public object MonetizationEnabled : GuildFeature("MONETIZATION_ENABLED") - /** * Guild has increased custom sticker slots. */ @@ -153,15 +139,6 @@ public sealed class GuildFeature( */ public object PreviewEnabled : GuildFeature("PREVIEW_ENABLED") - /** - * Guild has access to create private threads - */ - @Deprecated( - level = DeprecationLevel.HIDDEN, - message = "Creating a private thread no longer requires the server to be boosted.", - ) - public object PrivateThreads : GuildFeature("PRIVATE_THREADS") - /** * Guild has disabled alerts for join raids in the configured safety alerts channel. */ @@ -232,12 +209,10 @@ public sealed class GuildFeature( "INVITES_DISABLED" -> InvitesDisabled "INVITE_SPLASH" -> InviteSplash "MEMBER_VERIFICATION_GATE_ENABLED" -> MemberVerificationGateEnabled - "MONETIZATION_ENABLED" -> @Suppress("DEPRECATION_ERROR") MonetizationEnabled "MORE_STICKERS" -> MoreStickers "NEWS" -> News "PARTNERED" -> Partnered "PREVIEW_ENABLED" -> PreviewEnabled - "PRIVATE_THREADS" -> @Suppress("DEPRECATION_ERROR") PrivateThreads "RAID_ALERTS_DISABLED" -> RaidAlertsDisabled "ROLE_ICONS" -> RoleIcons "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" -> RoleSubscriptionsAvailableForPurchase @@ -271,12 +246,10 @@ public sealed class GuildFeature( InvitesDisabled, InviteSplash, MemberVerificationGateEnabled, - @Suppress("DEPRECATION_ERROR") MonetizationEnabled, MoreStickers, News, Partnered, PreviewEnabled, - @Suppress("DEPRECATION_ERROR") PrivateThreads, RaidAlertsDisabled, RoleIcons, RoleSubscriptionsAvailableForPurchase, diff --git a/common/src/commonMain/kotlin/KordConstants.kt b/common/src/commonMain/kotlin/KordConstants.kt index 55b34bfa000e..e19cacdc293f 100644 --- a/common/src/commonMain/kotlin/KordConstants.kt +++ b/common/src/commonMain/kotlin/KordConstants.kt @@ -3,9 +3,6 @@ package dev.kord.common -import dev.kord.common.annotation.KordExperimental -import kotlin.DeprecationLevel.HIDDEN - public object KordConstants { /** Kord's version. */ @@ -22,20 +19,4 @@ public object KordConstants { /** Kord's value for the [User Agent header](https://discord.com/developers/docs/reference#user-agent). */ public val USER_AGENT: String = "DiscordBot ($GITHUB_URL, $VERSION)" - - @Deprecated("Renamed to 'VERSION'.", ReplaceWith("KordConstants.VERSION"), level = HIDDEN) - @KordExperimental - public val KORD_VERSION: String get() = VERSION - - @Deprecated("Renamed to 'COMMIT_HASH'.", ReplaceWith("KordConstants.COMMIT_HASH"), level = HIDDEN) - @KordExperimental - public val KORD_COMMIT_HASH: String get() = COMMIT_HASH - - @Deprecated("Renamed to 'SHORT_COMMIT_HASH'.", ReplaceWith("KordConstants.SHORT_COMMIT_HASH"), level = HIDDEN) - @KordExperimental - public val KORD_SHORT_COMMIT_HASH: String get() = SHORT_COMMIT_HASH - - @Deprecated("Renamed to 'GITHUB_URL'.", ReplaceWith("KordConstants.GITHUB_URL"), level = HIDDEN) - @KordExperimental - public val KORD_GITHUB_URL: String get() = GITHUB_URL } diff --git a/common/src/commonMain/kotlin/entity/DiscordComponent.kt b/common/src/commonMain/kotlin/entity/DiscordComponent.kt index 607eb1d62c2b..0aa3813f5f5d 100644 --- a/common/src/commonMain/kotlin/entity/DiscordComponent.kt +++ b/common/src/commonMain/kotlin/entity/DiscordComponent.kt @@ -10,14 +10,6 @@ Entry("RoleSelect", intValue = 6, kDoc = "Select menu for roles."), Entry("MentionableSelect", intValue = 7, kDoc = "Select menu for mentionables (users and roles)."), Entry("ChannelSelect", intValue = 8, kDoc = "Select menu for channels."), - Entry( - "SelectMenu", intValue = 3, kDoc = "A select menu for picking from choices.", - deprecated = Deprecated( - "Renamed by discord", - ReplaceWith("StringSelect", "dev.kord.common.entity.ComponentType.StringSelect"), - DeprecationLevel.HIDDEN - ), - ), ], ) diff --git a/common/src/commonMain/kotlin/entity/DiscordGuild.kt b/common/src/commonMain/kotlin/entity/DiscordGuild.kt index 0672c33b8b95..53589d6b425c 100644 --- a/common/src/commonMain/kotlin/entity/DiscordGuild.kt +++ b/common/src/commonMain/kotlin/entity/DiscordGuild.kt @@ -115,14 +115,6 @@ "MemberVerificationGateEnabled", stringValue = "MEMBER_VERIFICATION_GATE_ENABLED", kDoc = "Guild has enabled Membership Screening.", ), - Entry( - "MonetizationEnabled", stringValue = "MONETIZATION_ENABLED", kDoc = "Guild has enabled monetization.", - deprecated = Deprecated( - "Replaced by CreatorMonetizableProvisional.", - ReplaceWith("GuildFeature.CreatorMonetizableProvisional", "dev.kord.common.entitiy.GuildFeature"), - level = HIDDEN, - ), - ), Entry("MoreStickers", stringValue = "MORE_STICKERS", kDoc = "Guild has increased custom sticker slots."), Entry("News", stringValue = "NEWS", kDoc = "Guild has access to create announcement channels."), Entry("Partnered", stringValue = "PARTNERED", kDoc = "Guild is partnered."), @@ -130,12 +122,6 @@ "PreviewEnabled", stringValue = "PREVIEW_ENABLED", kDoc = "Guild can be previewed before joining via Membership Screening or the directory.", ), - Entry( - "PrivateThreads", stringValue = "PRIVATE_THREADS", kDoc = "Guild has access to create private threads", - deprecated = Deprecated( - "Creating a private thread no longer requires the server to be boosted.", level = HIDDEN, - ), - ), Entry( "RaidAlertsDisabled", stringValue = "RAID_ALERTS_DISABLED", kDoc = "Guild has disabled alerts for join raids in the configured safety alerts channel.", @@ -184,7 +170,6 @@ import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -import kotlin.DeprecationLevel.HIDDEN /** * A partial representation of a [DiscordGuild] that may be [unavailable]. diff --git a/common/src/commonMain/kotlin/entity/DiscordNull.kt b/common/src/commonMain/kotlin/entity/DiscordNull.kt deleted file mode 100644 index f345b63f7fa1..000000000000 --- a/common/src/commonMain/kotlin/entity/DiscordNull.kt +++ /dev/null @@ -1,40 +0,0 @@ -package dev.kord.common.entity - -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerializationException -import kotlinx.serialization.descriptors.SerialDescriptor -import kotlinx.serialization.descriptors.buildClassSerialDescriptor -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder -import kotlin.DeprecationLevel.HIDDEN - -/** - * Type to represent a Discord value that can only be null. This class cannot be instantiated. - */ -@Suppress("DEPRECATION_ERROR") -@Deprecated( - "This class is similar to 'Nothing' as it has no instances. The only reason it existed was to have a " + - "@Serializable version of 'Nothing'. However, since Kotlin 1.8.0 and kotlinx.serialization 1.5.0-RC " + - "'Nothing' is a serializable class. This means 'DiscordNull' isn't needed anymore and should be replaced " + - "with 'Nothing'.", - ReplaceWith("Nothing", imports = ["kotlin.Nothing"]), - level = HIDDEN, -) -@Serializable(with = DiscordNull.Serializer::class) -public class DiscordNull private constructor() { - - internal object Serializer : KSerializer { - - override val descriptor: SerialDescriptor - get() = buildClassSerialDescriptor("Kord.DiscordNull") - - override fun deserialize(decoder: Decoder): DiscordNull { - throw SerializationException("DiscordNull cannot have an instance.") - } - - override fun serialize(encoder: Encoder, value: DiscordNull) { - throw SerializationException("DiscordNull cannot be encoded.") - } - } -} diff --git a/common/src/commonMain/kotlin/entity/Interactions.kt b/common/src/commonMain/kotlin/entity/Interactions.kt index bc3ce107cead..0f8afecc4615 100644 --- a/common/src/commonMain/kotlin/entity/Interactions.kt +++ b/common/src/commonMain/kotlin/entity/Interactions.kt @@ -91,7 +91,6 @@ import kotlinx.serialization.builtins.serializer import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* import kotlinx.serialization.json.* -import kotlin.DeprecationLevel.HIDDEN @Serializable public data class DiscordApplicationCommand( @@ -172,18 +171,6 @@ public sealed class Choice { public abstract val nameLocalizations: Optional?> public abstract val value: T - @Deprecated("Renamed to 'IntegerChoice'.", level = HIDDEN) - public data class IntChoice - @Deprecated( - "Renamed to 'IntegerChoice'.", - ReplaceWith("IntegerChoice(name, nameLocalizations, value)", "dev.kord.common.entity.Choice.IntegerChoice"), - level = HIDDEN, - ) public constructor( - override val name: String, - override val nameLocalizations: Optional?>, - override val value: Long - ) : Choice() - public data class IntegerChoice( override val name: String, override val nameLocalizations: Optional?>, @@ -240,7 +227,6 @@ public sealed class Choice { encodeStringElement(descriptor, 0, value.name) when (value) { - is @Suppress("DEPRECATION_ERROR") IntChoice -> encodeLongElement(descriptor, 1, value.value) is IntegerChoice -> encodeLongElement(descriptor, 1, value.value) is NumberChoice -> encodeDoubleElement(descriptor, 1, value.value) is StringChoice -> encodeStringElement(descriptor, 1, value.value) @@ -695,47 +681,6 @@ public data class CommandGroup( get() = ApplicationCommandOptionType.SubCommandGroup } -@Deprecated( - "Use an is-check or cast instead.", - ReplaceWith("(this as CommandArgument.IntegerArgument).value", "dev.kord.common.entity.CommandArgument"), - level = HIDDEN, -) -public fun CommandArgument<*>.int(): Long { - return value as? Long ?: error("$value wasn't an int.") -} - - -@Deprecated( - "This function calls value.toString() which might be unexpected. Use an explicit value.toString() instead.", - ReplaceWith("this.value.toString()"), - level = HIDDEN, -) -public fun CommandArgument<*>.string(): String { - return value.toString() -} - - -@Deprecated( - "Use an is-check or cast instead.", - ReplaceWith("(this as CommandArgument.BooleanArgument).value", "dev.kord.common.entity.CommandArgument"), - level = HIDDEN, -) -public fun CommandArgument<*>.boolean(): Boolean { - return value as? Boolean ?: error("$value wasn't a Boolean.") -} - - -@Deprecated( - "This function calls value.toString() which might be unexpected. Use an explicit value.toString() instead.", - ReplaceWith("Snowflake(this.value.toString())", "dev.kord.common.entity.Snowflake"), - level = HIDDEN, -) -public fun CommandArgument<*>.snowflake(): Snowflake { - val id = value.toString().toULongOrNull() ?: error("$value wasn't a Snowflake") - return Snowflake(id) -} - - @Serializable public data class DiscordGuildApplicationCommandPermissions( val id: Snowflake, diff --git a/common/src/commonMain/kotlin/entity/Permission.kt b/common/src/commonMain/kotlin/entity/Permission.kt index ff4ef26c75b8..fdfc52c830e4 100644 --- a/common/src/commonMain/kotlin/entity/Permission.kt +++ b/common/src/commonMain/kotlin/entity/Permission.kt @@ -244,7 +244,7 @@ public sealed class Permission(public val code: DiscordBitSet) { public object ManageWebhooks : Permission(1L shl 29) /** Allows management and editing of emojis and stickers. */ - @Deprecated("Renamed by discord", ReplaceWith("ManageGuildExpressions"), DeprecationLevel.ERROR) + @Deprecated("Renamed by discord", ReplaceWith("ManageGuildExpressions"), DeprecationLevel.HIDDEN) public object ManageEmojisAndStickers : Permission(1L shl 30) /** Allows management and editing of emojis, stickers and soundboard sounds. */ diff --git a/core/api/core.api b/core/api/core.api index 4d29a73e401b..b68ed6467238 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -1258,9 +1258,7 @@ public abstract interface class dev/kord/core/behavior/channel/NewsChannelBehavi public abstract fun follow (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun getActiveThreads ()Lkotlinx/coroutines/flow/Flow; public abstract fun getPublicArchivedThreads (Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; - public abstract synthetic fun startPublicThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun startPublicThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract synthetic fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/channel/NewsChannelBehavior; } @@ -1293,13 +1291,9 @@ public final class dev/kord/core/behavior/channel/NewsChannelBehavior$DefaultImp public static fun getPosition (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun getPublicArchivedThreads (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; public static fun getWebhooks (Ldev/kord/core/behavior/channel/NewsChannelBehavior;)Lkotlinx/coroutines/flow/Flow; - public static synthetic fun startPublicThread (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun startPublicThread (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun startPublicThread$default (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun startPublicThread$default (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun startPublicThreadWithMessage (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun startPublicThreadWithMessage (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun startPublicThreadWithMessage$default (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun startPublicThreadWithMessage$default (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static fun type (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun typeUntil (Ldev/kord/core/behavior/channel/NewsChannelBehavior;Lkotlin/time/TimeMark;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1372,11 +1366,8 @@ public abstract interface class dev/kord/core/behavior/channel/TextChannelBehavi public abstract fun getJoinedPrivateArchivedThreads (Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; public abstract fun getPrivateArchivedThreads (Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; public abstract fun getPublicArchivedThreads (Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; - public abstract synthetic fun startPrivateThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun startPrivateThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract synthetic fun startPublicThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun startPublicThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract synthetic fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/behavior/channel/TextChannelBehavior; } @@ -1410,17 +1401,11 @@ public final class dev/kord/core/behavior/channel/TextChannelBehavior$DefaultImp public static fun getPrivateArchivedThreads (Ldev/kord/core/behavior/channel/TextChannelBehavior;Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; public static fun getPublicArchivedThreads (Ldev/kord/core/behavior/channel/TextChannelBehavior;Lkotlinx/datetime/Instant;Ljava/lang/Integer;)Lkotlinx/coroutines/flow/Flow; public static fun getWebhooks (Ldev/kord/core/behavior/channel/TextChannelBehavior;)Lkotlinx/coroutines/flow/Flow; - public static synthetic fun startPrivateThread (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun startPrivateThread (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun startPrivateThread$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun startPrivateThread$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun startPublicThread (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun startPublicThread (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun startPublicThread$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun startPublicThread$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun startPublicThreadWithMessage (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun startPublicThreadWithMessage (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun startPublicThreadWithMessage$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun startPublicThreadWithMessage$default (Ldev/kord/core/behavior/channel/TextChannelBehavior;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static fun type (Ldev/kord/core/behavior/channel/TextChannelBehavior;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun typeUntil (Ldev/kord/core/behavior/channel/TextChannelBehavior;Lkotlin/time/TimeMark;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1730,7 +1715,6 @@ public final class dev/kord/core/behavior/interaction/AutoCompleteInteractionBeh } public final class dev/kord/core/behavior/interaction/AutoCompleteInteractionBehaviorKt { - public static final synthetic fun suggestInt (Ldev/kord/core/behavior/interaction/AutoCompleteInteractionBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun suggestInteger (Ldev/kord/core/behavior/interaction/AutoCompleteInteractionBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun suggestNumber (Ldev/kord/core/behavior/interaction/AutoCompleteInteractionBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun suggestString (Ldev/kord/core/behavior/interaction/AutoCompleteInteractionBehavior;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -6145,9 +6129,9 @@ 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 fun getBanner (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getBannerUrl (Ldev/kord/rest/Image$Format;)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; @@ -6160,9 +6144,9 @@ 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 fun getDiscoverySplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getDiscoverySplashUrl (Ldev/kord/rest/Image$Format;)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; @@ -6176,9 +6160,9 @@ 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 fun getIcon (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getIconUrl (Ldev/kord/rest/Image$Format;)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; @@ -6230,9 +6214,9 @@ 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 fun getSplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getSplashUrl (Ldev/kord/rest/Image$Format;)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; @@ -6669,7 +6653,7 @@ public final class dev/kord/core/entity/Message : dev/kord/core/behavior/Message public final fun getApplicationId ()Ldev/kord/common/entity/Snowflake; public final fun getAttachments ()Ljava/util/Set; public final fun getAuthor ()Ldev/kord/core/entity/User; - public final synthetic fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun getAuthorAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getAuthorAsMemberOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getAuthorAsMemberOrThrow (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getChannel ()Ldev/kord/core/behavior/channel/MessageChannelBehavior; @@ -6781,9 +6765,9 @@ 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 fun getBanner (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getBannerUrl (Ldev/kord/rest/Image$Format;)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; @@ -6791,8 +6775,8 @@ 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 fun getDiscoverySplash (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getDiscoverySplashUrl (Ldev/kord/rest/Image$Format;)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; @@ -6800,9 +6784,9 @@ 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 fun getIcon (Ldev/kord/rest/Image$Format;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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 fun getIconUrl (Ldev/kord/rest/Image$Format;)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; @@ -7214,7 +7198,7 @@ public class dev/kord/core/entity/User : dev/kord/core/behavior/UserBehavior { 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 fun getBannerUrl (Ldev/kord/rest/Image$Format;)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; @@ -8214,9 +8198,7 @@ public final class dev/kord/core/entity/channel/NewsChannel : dev/kord/core/beha public fun getType ()Ldev/kord/common/entity/ChannelType; public fun getWebhooks ()Lkotlinx/coroutines/flow/Flow; public fun hashCode ()I - public synthetic fun startPublicThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun startPublicThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun toString ()Ljava/lang/String; public fun type (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -8404,11 +8386,8 @@ public final class dev/kord/core/entity/channel/TextChannel : dev/kord/core/beha public fun getWebhooks ()Lkotlinx/coroutines/flow/Flow; public fun hashCode ()I public final fun isNsfw ()Z - public synthetic fun startPrivateThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun startPrivateThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun startPublicThread (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun startPublicThread (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun startPublicThreadWithMessage (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun toString ()Ljava/lang/String; public fun type (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -9017,17 +8996,15 @@ public final class dev/kord/core/entity/component/RoleSelectComponent : dev/kord public synthetic fun getType ()Ldev/kord/common/entity/ComponentType; } -public class dev/kord/core/entity/component/SelectMenuComponent : dev/kord/core/entity/component/Component { - public fun (Ldev/kord/core/cache/data/ComponentData;)V +public abstract class dev/kord/core/entity/component/SelectMenuComponent : dev/kord/core/entity/component/Component { + public synthetic fun (Ldev/kord/core/cache/data/ComponentData;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public fun equals (Ljava/lang/Object;)Z public final fun getCustomId ()Ljava/lang/String; public fun getData ()Ldev/kord/core/cache/data/ComponentData; public final fun getDisabled ()Z public final fun getMaxValues ()I public final fun getMinValues ()I - public final synthetic fun getOptions ()Ljava/util/List; public final fun getPlaceholder ()Ljava/lang/String; - public synthetic fun getType ()Ldev/kord/common/entity/ComponentType$SelectMenu; public fun getType ()Ldev/kord/common/entity/ComponentType; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -9052,6 +9029,7 @@ public final class dev/kord/core/entity/component/SelectOption { public final class dev/kord/core/entity/component/StringSelectComponent : dev/kord/core/entity/component/SelectMenuComponent { public fun (Ldev/kord/core/cache/data/ComponentData;)V + public final fun getOptions ()Ljava/util/List; public fun getType ()Ldev/kord/common/entity/ComponentType$StringSelect; public synthetic fun getType ()Ldev/kord/common/entity/ComponentType; } @@ -11201,7 +11179,6 @@ public final class dev/kord/core/event/channel/TypingStartEvent : dev/kord/core/ public final fun getData ()Ldev/kord/core/event/channel/data/TypingStartEventData; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -11459,7 +11436,7 @@ 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 fun getChannels (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + 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; @@ -12694,7 +12671,6 @@ public final class dev/kord/core/event/message/MessageBulkDeleteEvent : dev/kord public fun getCustomContext ()Ljava/lang/Object; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -12712,7 +12688,6 @@ public final class dev/kord/core/event/message/MessageCreateEvent : dev/kord/cor public synthetic fun (Ldev/kord/core/entity/Message;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/entity/Member;ILjava/lang/Object;Ldev/kord/core/supplier/EntitySupplier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun getCustomContext ()Ljava/lang/Object; public fun getGateway ()Ldev/kord/gateway/Gateway; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -12735,7 +12710,6 @@ public final class dev/kord/core/event/message/MessageDeleteEvent : dev/kord/cor public fun getCustomContext ()Ljava/lang/Object; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -12780,7 +12754,6 @@ public final class dev/kord/core/event/message/ReactionAddEvent : dev/kord/core/ public final fun getEmoji ()Ldev/kord/core/entity/ReactionEmoji; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -12811,7 +12784,6 @@ public final class dev/kord/core/event/message/ReactionRemoveAllEvent : dev/kord public fun getCustomContext ()Ljava/lang/Object; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; @@ -12864,7 +12836,6 @@ public final class dev/kord/core/event/message/ReactionRemoveEvent : dev/kord/co public final fun getEmoji ()Ldev/kord/core/entity/ReactionEmoji; public fun getGateway ()Ldev/kord/gateway/Gateway; public final fun getGuild ()Ldev/kord/core/behavior/GuildBehavior; - public final synthetic fun getGuild (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGuildId ()Ldev/kord/common/entity/Snowflake; public final fun getGuildOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun getKord ()Ldev/kord/core/Kord; diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index 0ca44fd11850..60c217cd4479 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -35,7 +35,7 @@ import kotlinx.coroutines.* import kotlinx.coroutines.flow.* import mu.KLogger import mu.KotlinLogging -import kotlin.DeprecationLevel.WARNING +import kotlin.DeprecationLevel.ERROR import kotlin.contracts.InvocationKind import kotlin.contracts.contract import kotlin.coroutines.CoroutineContext @@ -260,7 +260,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 = WARNING) + @Deprecated("Renamed to getGuild", ReplaceWith("this.getGuild(id, strategy)"), level = ERROR) public suspend fun getGuildOrThrow( id: Snowflake, strategy: EntitySupplyStrategy<*> = resources.defaultStrategy, diff --git a/core/src/commonMain/kotlin/behavior/GuildBehavior.kt b/core/src/commonMain/kotlin/behavior/GuildBehavior.kt index e04f3693bc79..d22531417050 100644 --- a/core/src/commonMain/kotlin/behavior/GuildBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/GuildBehavior.kt @@ -1087,7 +1087,7 @@ public suspend inline fun GuildBehavior.createMentionSpamAutoModerationRule( "this.createMentionSpamAutoModerationRule(name, eventType) { this@createMentionSpamAutoModerationRule" + ".mentionLimit = mentionLimit\nbuilder() }" ), - DeprecationLevel.WARNING, + DeprecationLevel.ERROR, ) public suspend inline fun GuildBehavior.createMentionSpamAutoModerationRule( name: String, diff --git a/core/src/commonMain/kotlin/behavior/channel/NewsChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/NewsChannelBehavior.kt index d9c8a209cc2e..800896a6058d 100644 --- a/core/src/commonMain/kotlin/behavior/channel/NewsChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/NewsChannelBehavior.kt @@ -1,6 +1,5 @@ package dev.kord.core.behavior.channel -import dev.kord.common.entity.ArchiveDuration import dev.kord.common.entity.ChannelType import dev.kord.common.entity.Permission import dev.kord.common.entity.Snowflake @@ -26,7 +25,6 @@ import dev.kord.rest.service.patchNewsChannel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filterIsInstance import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -84,22 +82,6 @@ public interface NewsChannelBehavior : TopGuildMessageChannelBehavior, ThreadPar kord.rest.channel.followNewsChannel(id, ChannelFollowRequest(webhookChannelId = target)) } - @Deprecated( - "Replaced by builder overload", - ReplaceWith("this.startPublicThread(name) {\nautoArchiveDuration = archiveDuration\nthis@startPublicThread.reason = reason\n}"), - level = HIDDEN, - ) - public suspend fun startPublicThread( - name: String, - archiveDuration: ArchiveDuration = ArchiveDuration.Day, - reason: String? = null - ): NewsChannelThread { - return startPublicThread(name) { - this.reason = reason - this.autoArchiveDuration = archiveDuration - } - } - public suspend fun startPublicThread( name: String, builder: StartThreadBuilder.() -> Unit = {}, @@ -107,23 +89,6 @@ public interface NewsChannelBehavior : TopGuildMessageChannelBehavior, ThreadPar return unsafeStartThread(name, type = ChannelType.PublicNewsThread, builder) as NewsChannelThread } - @Deprecated( - "Replaced by builder overload", - ReplaceWith("this.startPublicThreadWithMessage(messageId, name) {\nautoArchiveDuration = archiveDuration\nthis@startPublicThreadWithMessage.reason = reason\n}"), - level = HIDDEN, - ) - public suspend fun startPublicThreadWithMessage( - messageId: Snowflake, - name: String, - archiveDuration: ArchiveDuration = ArchiveDuration.Day, - reason: String? = null - ): NewsChannelThread { - return startPublicThreadWithMessage(messageId, name) { - this.reason = reason - this.autoArchiveDuration = archiveDuration - } - } - public suspend fun startPublicThreadWithMessage( messageId: Snowflake, name: String, diff --git a/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt b/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt index 71ea8a0bf4de..63d15d744c2d 100644 --- a/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/channel/TextChannelBehavior.kt @@ -1,6 +1,5 @@ package dev.kord.core.behavior.channel -import dev.kord.common.entity.ArchiveDuration import dev.kord.common.entity.ChannelType import dev.kord.common.entity.Snowflake import dev.kord.common.exception.RequestException @@ -24,7 +23,6 @@ import dev.kord.rest.service.patchTextChannel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filterIsInstance import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -67,22 +65,6 @@ public interface TextChannelBehavior : TopGuildMessageChannelBehavior, PrivateTh */ override suspend fun fetchChannelOrNull(): TextChannel? = super.fetchChannelOrNull() as? TextChannel - @Deprecated( - "Replaced by overload with autoArchiveDuration in builder lambda", - ReplaceWith("this.startPublicThread(name) {\nautoArchiveDuration = archiveDuration\nbuilder()\n}"), - level = HIDDEN, - ) - public suspend fun startPublicThread( - name: String, - archiveDuration: ArchiveDuration = ArchiveDuration.Day, - builder: StartThreadBuilder.() -> Unit = {} - ): TextChannelThread { - return startPublicThread(name) { - this.autoArchiveDuration = archiveDuration - builder() - } - } - public suspend fun startPublicThread( name: String, builder: StartThreadBuilder.() -> Unit = {}, @@ -90,22 +72,6 @@ public interface TextChannelBehavior : TopGuildMessageChannelBehavior, PrivateTh return unsafeStartThread(name, type = ChannelType.PublicGuildThread, builder) as TextChannelThread } - @Deprecated( - "Replaced by overload with autoArchiveDuration in builder lambda", - ReplaceWith("this.startPrivateThread(name) {\nautoArchiveDuration = archiveDuration\nbuilder()\n}"), - level = HIDDEN, - ) - public suspend fun startPrivateThread( - name: String, - archiveDuration: ArchiveDuration = ArchiveDuration.Day, - builder: StartThreadBuilder.() -> Unit = {} - ): TextChannelThread { - return startPrivateThread(name) { - this.autoArchiveDuration = archiveDuration - builder() - } - } - public suspend fun startPrivateThread( name: String, builder: StartThreadBuilder.() -> Unit = {}, @@ -113,23 +79,6 @@ public interface TextChannelBehavior : TopGuildMessageChannelBehavior, PrivateTh return unsafeStartThread(name, type = ChannelType.PrivateThread, builder) as TextChannelThread } - @Deprecated( - "Replaced by builder overload", - ReplaceWith("this.startPublicThreadWithMessage(messageId, name) {\nautoArchiveDuration = archiveDuration\nthis@startPublicThreadWithMessage.reason = reason\n}"), - level = HIDDEN, - ) - public suspend fun startPublicThreadWithMessage( - messageId: Snowflake, - name: String, - archiveDuration: ArchiveDuration = ArchiveDuration.Day, - reason: String? = null - ): TextChannelThread { - return startPublicThreadWithMessage(messageId, name) { - this.autoArchiveDuration = archiveDuration - this.reason = reason - } - } - public suspend fun startPublicThreadWithMessage( messageId: Snowflake, name: String, diff --git a/core/src/commonMain/kotlin/behavior/interaction/AutoCompleteInteractionBehavior.kt b/core/src/commonMain/kotlin/behavior/interaction/AutoCompleteInteractionBehavior.kt index 18051e8c460e..e2b9f2c8b32f 100644 --- a/core/src/commonMain/kotlin/behavior/interaction/AutoCompleteInteractionBehavior.kt +++ b/core/src/commonMain/kotlin/behavior/interaction/AutoCompleteInteractionBehavior.kt @@ -7,7 +7,6 @@ import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.rest.builder.interaction.IntegerOptionBuilder import dev.kord.rest.builder.interaction.NumberOptionBuilder import dev.kord.rest.builder.interaction.StringChoiceBuilder -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -24,16 +23,6 @@ public interface AutoCompleteInteractionBehavior : DataInteractionBehavior { override fun withStrategy(strategy: EntitySupplyStrategy<*>): AutoCompleteInteractionBehavior } -@Deprecated( - "Renamed to 'suggestInteger'.", - ReplaceWith("this.suggestInteger { builder() }", "dev.kord.core.behavior.interaction.suggestInteger"), - level = HIDDEN, -) -public suspend inline fun AutoCompleteInteractionBehavior.suggestInt(builder: IntegerOptionBuilder.() -> Unit) { - contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } - suggestInteger(builder) -} - /** * Responds to the interaction with the integer choices specified by [builder]. * diff --git a/core/src/commonMain/kotlin/entity/Guild.kt b/core/src/commonMain/kotlin/entity/Guild.kt index 8e35cc4f8fd3..b9443cc00684 100644 --- a/core/src/commonMain/kotlin/entity/Guild.kt +++ b/core/src/commonMain/kotlin/entity/Guild.kt @@ -25,7 +25,7 @@ import dev.kord.rest.service.RestClient import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlinx.datetime.Instant -import kotlin.DeprecationLevel.ERROR +import kotlin.DeprecationLevel.HIDDEN import kotlin.time.Duration /** @@ -367,17 +367,20 @@ public class Guild( /** * Gets the banner url in the specified format. */ - @Deprecated("Old method", ReplaceWith("this.banner?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = ERROR) + @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 = ERROR) + @Deprecated("Old method", ReplaceWith("this.banner?.getImage(format)"), level = HIDDEN) public suspend fun getBanner(format: Image.Format): Image? { - val url = getBannerUrl(format) ?: return null + val url = getBannerUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } @@ -431,9 +434,12 @@ public class Guild( @Deprecated( "Old method", ReplaceWith("this.discoverySplash?.cdnUrl?.toUrl { this@toUrl.format = format }"), - level = ERROR, + 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}" } /** @@ -442,9 +448,9 @@ public class Guild( * 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 = ERROR) + @Deprecated("Old method", ReplaceWith("this.discoverySplash?.getImage(format)"), level = HIDDEN) public suspend fun getDiscoverySplash(format: Image.Format): Image? { - val url = getDiscoverySplashUrl(format) ?: return null + val url = getDiscoverySplashUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } @@ -452,17 +458,20 @@ public class Guild( /** * Gets the icon url, if present. */ - @Deprecated("Old method", ReplaceWith("this.icon?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = ERROR) + @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 = ERROR) + @Deprecated("Old method", ReplaceWith("this.icon?.getImage(format)"), level = HIDDEN) public suspend fun getIcon(format: Image.Format): Image? { - val url = getIconUrl(format) ?: return null + val url = getIconUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } @@ -499,17 +508,20 @@ public class Guild( /** * Gets the splash url in the specified [format], if present. */ - @Deprecated("Old method", ReplaceWith("this.splash?.cdnUrl?.toUrl { this@toUrl.format = format }"), ERROR) + @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)"), ERROR) + @Deprecated("Old method", ReplaceWith("this.splash?.getImage(format)"), HIDDEN) public suspend fun getSplash(format: Image.Format): Image? { - val url = getSplashUrl(format) ?: return null + val url = getSplashUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } diff --git a/core/src/commonMain/kotlin/entity/Icon.kt b/core/src/commonMain/kotlin/entity/Icon.kt index f7691b0ae480..82669894d54f 100644 --- a/core/src/commonMain/kotlin/entity/Icon.kt +++ b/core/src/commonMain/kotlin/entity/Icon.kt @@ -11,7 +11,7 @@ import dev.kord.rest.route.DiscordCdn @Deprecated( "Icon class does not cover all cdn endpoints and has some inconsistencies.", ReplaceWith("Asset", "dev.kord.core.entity.Asset"), - DeprecationLevel.ERROR + DeprecationLevel.HIDDEN ) public sealed class Icon( public val format: Image.Format, diff --git a/core/src/commonMain/kotlin/entity/Member.kt b/core/src/commonMain/kotlin/entity/Member.kt index 7913b1f7041d..c1c3289d82b9 100644 --- a/core/src/commonMain/kotlin/entity/Member.kt +++ b/core/src/commonMain/kotlin/entity/Member.kt @@ -36,7 +36,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.WARNING, + DeprecationLevel.ERROR, ) public val displayName: String get() = effectiveName diff --git a/core/src/commonMain/kotlin/entity/Message.kt b/core/src/commonMain/kotlin/entity/Message.kt index da554929667b..3943efcb0c2b 100644 --- a/core/src/commonMain/kotlin/entity/Message.kt +++ b/core/src/commonMain/kotlin/entity/Message.kt @@ -305,29 +305,17 @@ public class Message( */ override suspend fun asMessage(): Message = this - /** - * Requests to get the [author] as a member. - * - * Returns null if the message was not send in a [TopGuildMessageChannel], or if the [author] is not a [User]. - */ - @Deprecated( - "Deprecated in favour of getAuthorAsMemberOrNull(), as it more accurately describes function", - ReplaceWith("getAuthorAsMemberOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getAuthorAsMember(): Member? { - val author = author ?: return null - val guildId = getGuildOrNull()?.id ?: return null - return author.asMember(guildId) - } + @Deprecated("Renamed to 'getAuthorAsMember'.", ReplaceWith("this.getAuthorAsMember()"), DeprecationLevel.WARNING) + public suspend fun getAuthorAsMemberOrThrow(): Member = getAuthorAsMember() /** * Requests to get the [author] as a member. * + * @throws RequestException if anything went wrong during the request. * @throws EntityNotFoundException if the message was not sent in a [TopGuildMessageChannel], if the member was not found * or if the guild was null, or if the author is not a user */ - public suspend fun getAuthorAsMemberOrThrow(): Member { + public suspend fun getAuthorAsMember(): Member { val author = author ?: throw EntityNotFoundException("Author is not a Discord User") val guildId = getGuild().id return author.asMember(guildId) @@ -338,6 +326,8 @@ public class Message( * * Returns null if the message was not sent in a [TopGuildMessageChannel], if the [author] is not a [User], or if * the [author] as a member is `null`. + * + * @throws RequestException if anything went wrong during the request. */ public suspend fun getAuthorAsMemberOrNull(): Member? { val author = author ?: return null diff --git a/core/src/commonMain/kotlin/entity/PartialGuild.kt b/core/src/commonMain/kotlin/entity/PartialGuild.kt index 2143c48a5e42..5f82bf553d2d 100644 --- a/core/src/commonMain/kotlin/entity/PartialGuild.kt +++ b/core/src/commonMain/kotlin/entity/PartialGuild.kt @@ -16,7 +16,7 @@ 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.ERROR +import kotlin.DeprecationLevel.HIDDEN public class PartialGuild( public val data: PartialGuildData, @@ -100,9 +100,12 @@ public class PartialGuild( @Deprecated( "This method uses the wrong hash.", ReplaceWith("this.splash?.cdnUrl?.toUrl { this@toUrl.format = format }"), - level = ERROR, + 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}" } /** @@ -114,10 +117,10 @@ public class PartialGuild( @Deprecated( "This method uses the wrong hash.", ReplaceWith("this.splash?.getImage(format)"), - level = ERROR, + level = HIDDEN, ) public suspend fun getDiscoverySplash(format: Image.Format): Image? { - val url = getDiscoverySplashUrl(format) ?: return null + val url = getDiscoverySplashUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } @@ -126,8 +129,11 @@ public class PartialGuild( /** * Gets the icon url, if present. */ - @Deprecated("Old method", ReplaceWith("this.icon?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = ERROR) + @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}" } @@ -135,9 +141,9 @@ public class PartialGuild( * Requests to get the icon image in the specified [format], if present. */ @Suppress("DEPRECATION_ERROR") - @Deprecated("Old method", ReplaceWith("this.icon?.getImage(format)"), level = ERROR) + @Deprecated("Old method", ReplaceWith("this.icon?.getImage(format)"), level = HIDDEN) public suspend fun getIcon(format: Image.Format): Image? { - val url = getIconUrl(format) ?: return null + val url = getIconUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } @@ -146,17 +152,20 @@ public class PartialGuild( /** * Gets the banner url in the specified format. */ - @Deprecated("Old method", ReplaceWith("this.banner?.cdnUrl?.toUrl { this@toUrl.format = format }"), level = ERROR) + @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 = ERROR) + @Deprecated("Old method", ReplaceWith("this.banner?.getImage(format)"), level = HIDDEN) public suspend fun getBanner(format: Image.Format): Image? { - val url = getBannerUrl(format) ?: return null + val url = getBannerUrl0(format) ?: return null return Image.fromUrl(kord.resources.httpClient, url) } diff --git a/core/src/commonMain/kotlin/entity/User.kt b/core/src/commonMain/kotlin/entity/User.kt index 9be16b7383a0..2283e9e72406 100644 --- a/core/src/commonMain/kotlin/entity/User.kt +++ b/core/src/commonMain/kotlin/entity/User.kt @@ -10,7 +10,6 @@ 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.ERROR import kotlin.DeprecationLevel.WARNING /** @@ -126,7 +125,7 @@ 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 }"), level = ERROR) + @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}" } @@ -150,7 +149,7 @@ public open class User( return "User(data=$data, kord=$kord, supplier=$supplier)" } - @Deprecated("Old class", ReplaceWith("Asset", "dev.kord.core.entity.Asset"), level = ERROR) + @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 { /** diff --git a/core/src/commonMain/kotlin/entity/component/Component.kt b/core/src/commonMain/kotlin/entity/component/Component.kt index b3ab770b2b6d..6fe548fbb663 100644 --- a/core/src/commonMain/kotlin/entity/component/Component.kt +++ b/core/src/commonMain/kotlin/entity/component/Component.kt @@ -31,11 +31,10 @@ public sealed interface Component { * @see SelectMenuComponent * @see UnknownComponent */ -@Suppress("DEPRECATION_ERROR") public fun Component(data: ComponentData): Component = when (data.type) { ComponentType.ActionRow -> ActionRowComponent(data) ComponentType.Button -> ButtonComponent(data as ChatComponentData) - ComponentType.StringSelect, ComponentType.SelectMenu -> StringSelectComponent(data) + ComponentType.StringSelect -> StringSelectComponent(data) ComponentType.UserSelect -> UserSelectComponent(data) ComponentType.RoleSelect -> RoleSelectComponent(data) ComponentType.MentionableSelect -> MentionableSelectComponent(data) diff --git a/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt b/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt index 191dfa2983f5..f01d42bf6ba5 100644 --- a/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt +++ b/core/src/commonMain/kotlin/entity/component/SelectMenuComponent.kt @@ -1,5 +1,3 @@ -@file:Suppress("DEPRECATION_ERROR") - package dev.kord.core.entity.component import dev.kord.common.entity.ChannelType @@ -10,26 +8,11 @@ import dev.kord.core.cache.data.ComponentData import dev.kord.core.cache.data.SelectOptionData import dev.kord.core.entity.Message import dev.kord.core.entity.interaction.SelectMenuInteraction -import kotlin.jvm.JvmName /** - * An interactive dropdown menu rendered on a [Message] that consists of multiple [options]. + * An interactive dropdown menu rendered on a [Message]. */ - -public open class SelectMenuComponent -// actually: -//@Deprecated( -// "This will be made a sealed class in the future, please stop using this constructor. You can instead use the " + -// "constructor of one of the subtypes.", -// ReplaceWith("StringSelectComponent(data)", "dev.kord.core.entity.component.StringSelectComponent"), -// level = DeprecationLevel.HIDDEN, -//) -@PublishedApi internal constructor(override val data: ComponentData) : Component { - - @Suppress("INAPPLICABLE_JVM_NAME") - @Deprecated("Binary compatibility", level = DeprecationLevel.HIDDEN) - @get:JvmName("getType") - public open val type0: ComponentType.SelectMenu get() = ComponentType.SelectMenu +public sealed class SelectMenuComponent(override val data: ComponentData) : Component { /** * The custom identifier for any [ComponentInteractions][SelectMenuInteraction] @@ -42,25 +25,6 @@ public open class SelectMenuComponent */ public val placeholder: String? get() = data.placeholder.value - /** - * The possible options to choose from. - */ - @Deprecated( - "This is only available for 'ComponentType.StringSelect' (in the 'StringSelectComponent' subclass).", - ReplaceWith( - "(this as? StringSelectComponent)?.options ?: emptyList()", - "dev.kord.core.entity.component.StringSelectComponent", - "dev.kord.core.entity.component.options", - ), - level = DeprecationLevel.HIDDEN, - ) - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - @kotlin.internal.LowPriorityInOverloadResolution - public val options: List get() = _options - - @Suppress("PropertyName") - internal val _options get() = data.options.orEmpty().map { SelectOption(it) } - /** * The minimum amount of options that can be chosen, default `1`. */ @@ -91,12 +55,15 @@ public open class SelectMenuComponent public class StringSelectComponent(data: ComponentData) : SelectMenuComponent(data) { override val type: ComponentType.StringSelect get() = ComponentType.StringSelect + + /** The possible options to choose from. */ + public val options: List get() = data.options.orEmpty().map { SelectOption(it) } } -// TODO replace with member in StringSelectComponent when SelectMenuComponent.options is removed /** The possible options to choose from. */ @Suppress("EXTENSION_SHADOWED_BY_MEMBER") -public val StringSelectComponent.options: List get() = _options +@Deprecated("Replaced by member in StringSelectComponent.", ReplaceWith("this.options"), DeprecationLevel.WARNING) +public val StringSelectComponent.options: List get() = options public class UserSelectComponent(data: ComponentData) : SelectMenuComponent(data) { override val type: ComponentType.UserSelect get() = ComponentType.UserSelect diff --git a/core/src/commonMain/kotlin/entity/interaction/ComponentInteraction.kt b/core/src/commonMain/kotlin/entity/interaction/ComponentInteraction.kt index c2a6de86c70d..eb8b56485dc1 100644 --- a/core/src/commonMain/kotlin/entity/interaction/ComponentInteraction.kt +++ b/core/src/commonMain/kotlin/entity/interaction/ComponentInteraction.kt @@ -59,7 +59,6 @@ public sealed interface GuildComponentInteraction : ComponentInteraction, GuildI * * @throws Exception if the interaction is not from a [ButtonComponent] or a [SelectMenuComponent]. */ -@Suppress("DEPRECATION_ERROR") public fun ComponentInteraction( data: InteractionData, kord: Kord, @@ -74,7 +73,7 @@ public fun ComponentInteraction( } ComponentType.StringSelect, ComponentType.UserSelect, ComponentType.MentionableSelect, ComponentType.ChannelSelect, - ComponentType.RoleSelect, ComponentType.SelectMenu -> when { + ComponentType.RoleSelect -> when { inGuild -> GuildSelectMenuInteraction(data, kord, supplier) else -> GlobalSelectMenuInteraction(data, kord, supplier) } diff --git a/core/src/commonMain/kotlin/event/channel/TypingStartEvent.kt b/core/src/commonMain/kotlin/event/channel/TypingStartEvent.kt index e0bc71a6f823..62c1680dce00 100644 --- a/core/src/commonMain/kotlin/event/channel/TypingStartEvent.kt +++ b/core/src/commonMain/kotlin/event/channel/TypingStartEvent.kt @@ -73,19 +73,6 @@ public class TypingStartEvent( */ public suspend fun getUserOrNull(): User? = supplier.getUserOrNull(userId) - /** - * Requests to get the guild this event was triggered in, - * returns null if the [Guild] isn't present. - * - * @throws [RequestException] if anything went wrong during the request. - */ - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - /** * Requests to get the guild this event was triggered in, * returns null if the [Guild] isn't present. diff --git a/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt b/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt index 21b0170f0d41..ca32f7a8cbbf 100644 --- a/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt +++ b/core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt @@ -68,7 +68,7 @@ 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.ERROR) + @Deprecated("Replaced by 'channels' property.", ReplaceWith("this.channels"), DeprecationLevel.HIDDEN) public suspend fun getChannels(): Flow { return channels } diff --git a/core/src/commonMain/kotlin/event/message/MessageBulkDeleteEvent.kt b/core/src/commonMain/kotlin/event/message/MessageBulkDeleteEvent.kt index f06e0c8b5018..e907b884cf4e 100644 --- a/core/src/commonMain/kotlin/event/message/MessageBulkDeleteEvent.kt +++ b/core/src/commonMain/kotlin/event/message/MessageBulkDeleteEvent.kt @@ -33,13 +33,6 @@ public class MessageBulkDeleteEvent( public suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - public suspend fun getGuildOrNull(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } override fun withStrategy(strategy: EntitySupplyStrategy<*>): MessageBulkDeleteEvent = diff --git a/core/src/commonMain/kotlin/event/message/MessageCreateEvent.kt b/core/src/commonMain/kotlin/event/message/MessageCreateEvent.kt index dbaf8e17e8a4..f56f643a4e23 100644 --- a/core/src/commonMain/kotlin/event/message/MessageCreateEvent.kt +++ b/core/src/commonMain/kotlin/event/message/MessageCreateEvent.kt @@ -22,19 +22,6 @@ public class MessageCreateEvent( ) : Event, Strategizable { override val kord: Kord get() = message.kord - /** - * Requests to get the guild this message was created in, if it was created in one, - * returns null if the [Guild] isn't present or the message was a [DM][DmChannel]. - * - * @throws [RequestException] if anything went wrong during the request. - */ - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - /** * Requests to get the guild this message was created in, if it was created in one, * returns null if the [Guild] isn't present or the message was a [DM][DmChannel]. diff --git a/core/src/commonMain/kotlin/event/message/MessageDeleteEvent.kt b/core/src/commonMain/kotlin/event/message/MessageDeleteEvent.kt index 083a15cac086..2502428c44a2 100644 --- a/core/src/commonMain/kotlin/event/message/MessageDeleteEvent.kt +++ b/core/src/commonMain/kotlin/event/message/MessageDeleteEvent.kt @@ -33,13 +33,6 @@ public class MessageDeleteEvent( public suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - public suspend fun getGuildOrNull(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } override fun withStrategy(strategy: EntitySupplyStrategy<*>): MessageDeleteEvent = diff --git a/core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt b/core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt index 1ab82888b33b..4413ff0f64c7 100644 --- a/core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt +++ b/core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt @@ -41,13 +41,6 @@ public class ReactionAddEvent( public suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - public suspend fun getGuildOrNull(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } public suspend fun getMessage(): Message = supplier.getMessage(channelId = channelId, messageId = messageId) diff --git a/core/src/commonMain/kotlin/event/message/ReactionRemoveAllEvent.kt b/core/src/commonMain/kotlin/event/message/ReactionRemoveAllEvent.kt index ee222506b325..9a8fe76dee63 100644 --- a/core/src/commonMain/kotlin/event/message/ReactionRemoveAllEvent.kt +++ b/core/src/commonMain/kotlin/event/message/ReactionRemoveAllEvent.kt @@ -34,13 +34,6 @@ public class ReactionRemoveAllEvent( public suspend fun getChannel(): MessageChannel = supplier.getChannelOf(channelId) public suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - public suspend fun getGuildOrNull(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } public suspend fun getMessage(): Message = supplier.getMessage(channelId = channelId, messageId = messageId) diff --git a/core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt b/core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt index e0fd18e9f7c9..ed92d0e2da0c 100644 --- a/core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt +++ b/core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt @@ -41,13 +41,6 @@ public class ReactionRemoveEvent( public suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) - @Deprecated( - "Deprecated in favour of getGuildOrNull() as it provides more clarity over the functionality", - ReplaceWith("getGuildOrNull()"), - DeprecationLevel.HIDDEN - ) - public suspend fun getGuild(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } - public suspend fun getGuildOrNull(): Guild? = guildId?.let { supplier.getGuildOrNull(it) } public suspend fun getMessage(): Message = supplier.getMessage(channelId = channelId, messageId = messageId) diff --git a/rest/api/rest.api b/rest/api/rest.api index 0478e07e1d87..1bb92cc66a41 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -159,7 +159,6 @@ public abstract interface class dev/kord/rest/builder/automoderation/AutoModerat public final class dev/kord/rest/builder/automoderation/AutoModerationRuleBuilderKt { public static final fun allowAnywhereKeyword (Ldev/kord/rest/builder/automoderation/AllowedKeywordsAutoModerationRuleBuilder;Ljava/lang/String;)V public static final fun allowKeyword (Ldev/kord/rest/builder/automoderation/AllowedKeywordsAutoModerationRuleBuilder;Ljava/lang/String;)V - public static final synthetic fun allowKeyword (Ldev/kord/rest/builder/automoderation/KeywordPresetAutoModerationRuleBuilder;Ljava/lang/String;)V public static final fun allowPrefixKeyword (Ldev/kord/rest/builder/automoderation/AllowedKeywordsAutoModerationRuleBuilder;Ljava/lang/String;)V public static final fun allowSuffixKeyword (Ldev/kord/rest/builder/automoderation/AllowedKeywordsAutoModerationRuleBuilder;Ljava/lang/String;)V public static final fun anywhereKeyword (Ldev/kord/rest/builder/automoderation/KeywordAutoModerationRuleBuilder;Ljava/lang/String;)V @@ -828,7 +827,6 @@ public final class dev/kord/rest/builder/channel/thread/StartForumThreadBuilder } public final class dev/kord/rest/builder/channel/thread/StartThreadBuilder : dev/kord/rest/builder/AuditRequestBuilder { - public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;Ldev/kord/common/entity/ChannelType;)V public fun (Ljava/lang/String;Ldev/kord/common/entity/ChannelType;)V public final fun getAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; public final fun getInvitable ()Ljava/lang/Boolean; @@ -847,7 +845,6 @@ public final class dev/kord/rest/builder/channel/thread/StartThreadBuilder : dev public final class dev/kord/rest/builder/channel/thread/StartThreadWithMessageBuilder : dev/kord/rest/builder/AuditRequestBuilder { public fun (Ljava/lang/String;)V - public synthetic fun (Ljava/lang/String;Ldev/kord/common/entity/ArchiveDuration;)V public final fun getAutoArchiveDuration ()Ldev/kord/common/entity/ArchiveDuration; public final fun getName ()Ljava/lang/String; public final fun getRateLimitPerUser-FghU774 ()Lkotlin/time/Duration; @@ -897,7 +894,6 @@ public final class dev/kord/rest/builder/component/ActionRowBuilder : dev/kord/r public static synthetic fun mentionableSelect$default (Ldev/kord/rest/builder/component/ActionRowBuilder;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public final fun roleSelect (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun roleSelect$default (Ldev/kord/rest/builder/component/ActionRowBuilder;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V - public final synthetic fun selectMenu (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun stringSelect (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun textInput (Ldev/kord/common/entity/TextInputStyle;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun textInput$default (Ldev/kord/rest/builder/component/ActionRowBuilder;Ldev/kord/common/entity/TextInputStyle;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V @@ -960,19 +956,16 @@ public final class dev/kord/rest/builder/component/RoleSelectBuilder : dev/kord/ public fun (Ljava/lang/String;)V } -public class dev/kord/rest/builder/component/SelectMenuBuilder : dev/kord/rest/builder/component/ActionRowComponentBuilder { - public fun (Ljava/lang/String;)V +public abstract class dev/kord/rest/builder/component/SelectMenuBuilder : dev/kord/rest/builder/component/ActionRowComponentBuilder { + public synthetic fun (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun build ()Ldev/kord/common/entity/DiscordChatComponent; public synthetic fun build ()Ldev/kord/common/entity/DiscordComponent; protected fun buildChannelTypes ()Ldev/kord/common/entity/optional/Optional; protected fun buildOptions ()Ldev/kord/common/entity/optional/Optional; public final fun getAllowedValues ()Lkotlin/ranges/ClosedRange; public final fun getCustomId ()Ljava/lang/String; - public final fun getOptions ()Ljava/util/List; public final fun getPlaceholder ()Ljava/lang/String; - protected fun getType ()Ldev/kord/common/entity/ComponentType; - public final synthetic fun option (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V - public static synthetic fun option$default (Ldev/kord/rest/builder/component/SelectMenuBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + protected abstract fun getType ()Ldev/kord/common/entity/ComponentType; public final fun setAllowedValues (Lkotlin/ranges/ClosedRange;)V public final fun setCustomId (Ljava/lang/String;)V public final fun setPlaceholder (Ljava/lang/String;)V @@ -1003,6 +996,8 @@ public final class dev/kord/rest/builder/component/SelectOptionBuilder { public final class dev/kord/rest/builder/component/StringSelectBuilder : dev/kord/rest/builder/component/SelectMenuBuilder { public fun (Ljava/lang/String;)V + public final fun getOptions ()Ljava/util/List; + public final fun setOptions (Ljava/util/List;)V } public final class dev/kord/rest/builder/component/TextInputBuilder : dev/kord/rest/builder/component/ActionRowComponentBuilder { diff --git a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt index 7198c5fd6599..d66678677fb7 100644 --- a/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/automoderation/AutoModerationRuleBuilder.kt @@ -9,7 +9,6 @@ import dev.kord.common.entity.AutoModerationRuleTriggerType.* import dev.kord.common.entity.Permission.ModerateMembers import dev.kord.common.entity.Snowflake import dev.kord.rest.builder.AuditBuilder -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind.EXACTLY_ONCE import kotlin.contracts.contract import kotlin.time.Duration @@ -297,15 +296,6 @@ public fun KeywordPresetAutoModerationRuleBuilder.preset(preset: AutoModerationR presets?.add(preset) ?: assignPresets(mutableListOf(preset)) } -@Deprecated( - "Binary compatibility, an extension with the same name and parameter is now available on the " + - "'AllowedKeywordsAutoModerationRuleBuilder' supertype of 'KeywordPresetAutoModerationRuleBuilder'.", - level = HIDDEN, -) -public fun KeywordPresetAutoModerationRuleBuilder.allowKeyword(keyword: String) { - allowedKeywords?.add(keyword) ?: run { allowedKeywords = mutableListOf(keyword) } -} - /** An [AutoModerationRuleBuilder] for building rules with trigger type [MentionSpam]. */ @KordDsl @@ -323,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.WARNING, + DeprecationLevel.ERROR, ) 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 c6be4406d5dc..8ccd01b8fd6a 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.WARNING, + DeprecationLevel.ERROR, ) 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.WARNING, + DeprecationLevel.ERROR, ) 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.WARNING, + DeprecationLevel.ERROR, ) 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 9aa309752e93..bff4145e37d3 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.WARNING, + DeprecationLevel.ERROR, ) override fun assignMentionLimit(mentionLimit: Int) { this.mentionLimit = mentionLimit diff --git a/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadBuilder.kt b/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadBuilder.kt index 4d69940233d4..072ed20c2fe3 100644 --- a/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadBuilder.kt @@ -9,7 +9,6 @@ import dev.kord.common.entity.optional.delegate.delegate import dev.kord.common.entity.optional.optional import dev.kord.rest.builder.AuditRequestBuilder import dev.kord.rest.json.request.StartThreadRequest -import kotlin.DeprecationLevel.HIDDEN import kotlin.time.Duration @KordDsl @@ -17,17 +16,6 @@ public class StartThreadBuilder( public var name: String, public val type: ChannelType, ) : AuditRequestBuilder { - @Deprecated( - "'autoArchiveDuration' is no longer required, use other constructor instead.", - ReplaceWith( - "StartThreadBuilder(name, type).apply { this@apply.autoArchiveDuration = autoArchiveDuration }", - imports = ["dev.kord.rest.builder.channel.thread.StartThreadBuilder"] - ), - level = HIDDEN, - ) - public constructor(name: String, autoArchiveDuration: ArchiveDuration, type: ChannelType) : this(name, type) { - this.autoArchiveDuration = autoArchiveDuration - } override var reason: String? = null diff --git a/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadWithMessageBuilder.kt b/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadWithMessageBuilder.kt index 715b1c5de051..bd119775072a 100644 --- a/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadWithMessageBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/channel/thread/StartThreadWithMessageBuilder.kt @@ -6,22 +6,10 @@ import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.delegate.delegate import dev.kord.rest.builder.AuditRequestBuilder import dev.kord.rest.json.request.StartThreadRequest -import kotlin.DeprecationLevel.HIDDEN import kotlin.time.Duration @KordDsl public class StartThreadWithMessageBuilder(public var name: String) : AuditRequestBuilder { - @Deprecated( - "'autoArchiveDuration' is no longer required, use other constructor instead.", - ReplaceWith( - "StartThreadWithMessageBuilder(name).apply { this@apply.autoArchiveDuration = autoArchiveDuration }", - imports = ["dev.kord.rest.builder.channel.thread.StartThreadWithMessageBuilder"] - ), - level = HIDDEN, - ) - public constructor(name: String, autoArchiveDuration: ArchiveDuration) : this(name) { - this.autoArchiveDuration = autoArchiveDuration - } override var reason: String? = null diff --git a/rest/src/commonMain/kotlin/builder/component/ActionRowBuilder.kt b/rest/src/commonMain/kotlin/builder/component/ActionRowBuilder.kt index 5344cb4c8da9..c9eae6f39357 100644 --- a/rest/src/commonMain/kotlin/builder/component/ActionRowBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/component/ActionRowBuilder.kt @@ -6,7 +6,6 @@ import dev.kord.common.entity.ComponentType import dev.kord.common.entity.DiscordChatComponent import dev.kord.common.entity.TextInputStyle import dev.kord.common.entity.optional.Optional -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -41,23 +40,6 @@ public class ActionRowBuilder : MessageComponentBuilder { ) } - /** - * Creates and adds a select menu with the [customId] and configured by the [builder]. - * An ActionRow with a select menu cannot have any other select menus or buttons. - */ - @Deprecated( - "Renamed by discord to StringSelect", - ReplaceWith("stringSelect(customId) { builder() }"), - level = HIDDEN, - ) - public inline fun selectMenu(customId: String, builder: SelectMenuBuilder.() -> Unit) { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - - components.add(StringSelectBuilder(customId).apply(builder)) - } - /** * Creates and adds a string select menu with the [customId] and configured by the [builder]. * An ActionRow with a select menu cannot have any other select menus or buttons. diff --git a/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt b/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt index cb0f7ca99a08..ebd0fe46c88d 100644 --- a/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt +++ b/rest/src/commonMain/kotlin/builder/component/SelectMenuBuilder.kt @@ -1,5 +1,3 @@ -@file:Suppress("DEPRECATION_ERROR") - package dev.kord.rest.builder.component import dev.kord.common.annotation.KordDsl @@ -11,7 +9,6 @@ import dev.kord.common.entity.optional.Optional import dev.kord.common.entity.optional.OptionalInt import dev.kord.common.entity.optional.delegate.delegate import dev.kord.common.entity.optional.mapCopy -import kotlin.DeprecationLevel.HIDDEN import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -22,36 +19,7 @@ import kotlin.contracts.contract * @param customId The identifier for the menu, max 100 characters. */ @KordDsl -public open class SelectMenuBuilder -// actually: -//@Deprecated( -// "This will be made a sealed class in the future, please stop using this constructor. You can instead use the " + -// "constructor of one of the subtypes.", -// ReplaceWith("StringSelectBuilder(customId)", "dev.kord.rest.builder.component.StringSelectBuilder"), -// level = HIDDEN, -//) -@PublishedApi internal constructor(public var customId: String) : ActionRowComponentBuilder() { - - /** - * The choices in the select, max 25. - */ - // actually: - //@Deprecated( - // "This is only available for 'ComponentType.StringSelect' (in the 'StringSelectBuilder' subclass).", - // ReplaceWith( - // "(this as? StringSelectBuilder)?.options ?: mutableListOf()", - // "dev.kord.rest.builder.component.StringSelectBuilder", - // "dev.kord.rest.builder.component.options", - // ), - // level = HIDDEN, - //) - @PublishedApi - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - @kotlin.internal.LowPriorityInOverloadResolution - internal val options: MutableList get() = _options - - @Suppress("PropertyName") - internal var _options = mutableListOf() +public sealed class SelectMenuBuilder(public var customId: String) : ActionRowComponentBuilder() { /** * The range of values that can be accepted. Accepts any range between [0,25]. @@ -70,38 +38,8 @@ public open class SelectMenuBuilder */ public var placeholder: String? by ::_placeholder.delegate() - /** - * Adds a new option to the select menu with the given [label] and [value] and configured by the [builder]. - * - * @param label The user-facing name of the option, max 100 characters. - * @param value The dev-defined value of the option, max 100 characters. - */ - @Deprecated( - "This is only available for 'ComponentType.StringSelect' (in the 'StringSelectBuilder' subclass).", - ReplaceWith( - "(this as? StringSelectBuilder)?.option(label, value, builder)", - "dev.kord.rest.builder.component.StringSelectBuilder", - "dev.kord.rest.builder.component.option", - ), - level = HIDDEN, - ) - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - @kotlin.internal.LowPriorityInOverloadResolution - public inline fun option(label: String, value: String, builder: SelectOptionBuilder.() -> Unit = {}) { - contract { - callsInPlace(builder, InvocationKind.EXACTLY_ONCE) - } - - options.add(SelectOptionBuilder(label = label, value = value).apply(builder)) - } - - // TODO make abstract when this is turned into a sealed class - protected open val type: ComponentType get() = ComponentType.StringSelect - - // TODO return Optional.Missing() here when options is exclusively moved to StringSelectBuilder - protected open fun buildOptions(): Optional> = - if (type == ComponentType.StringSelect) Optional(options.map { it.build() }) else Optional.Missing() - + protected abstract val type: ComponentType + protected open fun buildOptions(): Optional> = Optional.Missing() protected open fun buildChannelTypes(): Optional> = Optional.Missing() final override fun build(): DiscordChatComponent = DiscordChatComponent( type = type, @@ -119,15 +57,19 @@ public open class SelectMenuBuilder public class StringSelectBuilder(customId: String) : SelectMenuBuilder(customId) { override val type: ComponentType get() = ComponentType.StringSelect + /** The choices in the select, max 25. */ + public var options: MutableList = mutableListOf() + override fun buildOptions(): Optional> = Optional(options.map { it.build() }) } -// TODO replace with member in StringSelectBuilder when SelectMenuBuilder.options is removed /** The choices in the select, max 25. */ +@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@Deprecated("Replaced by member in StringSelectBuilder.", ReplaceWith("this.options"), DeprecationLevel.WARNING) public var StringSelectBuilder.options: MutableList - get() = _options + get() = options set(value) { - _options = value + options = value } /** @@ -136,7 +78,6 @@ public var StringSelectBuilder.options: MutableList * @param label The user-facing name of the option, max 100 characters. * @param value The dev-defined value of the option, max 100 characters. */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") // can be removed when member in SelectMenuBuilder is removed public inline fun StringSelectBuilder.option( label: String, value: String, diff --git a/rest/src/commonMain/kotlin/service/AutoModerationService.kt b/rest/src/commonMain/kotlin/service/AutoModerationService.kt index 7a63c1e79776..f21b24effa1d 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.WARNING, + DeprecationLevel.ERROR, ) public suspend inline fun createMentionSpamAutoModerationRule( guildId: Snowflake,