diff --git a/build.gradle.kts b/build.gradle.kts index 0ad64bff26f..fa2b8190fc1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } group = Library.group diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 260920e5258..95e5b79cce5 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -4,6 +4,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } kotlin { diff --git a/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts b/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts index ad9b04bb4d1..49fabff4004 100644 --- a/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts @@ -4,6 +4,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } kotlin { diff --git a/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts b/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts index 076b387f80e..7c9c2a170ad 100644 --- a/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts @@ -6,6 +6,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } @OptIn(ExperimentalKotlinGradlePluginApi::class) diff --git a/buildSrc/src/main/kotlin/kord-module.gradle.kts b/buildSrc/src/main/kotlin/kord-module.gradle.kts index 19322086bd4..ce44c7da25c 100644 --- a/buildSrc/src/main/kotlin/kord-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-module.gradle.kts @@ -12,6 +12,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } dependencies { diff --git a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts index 5a28f04dd8c..5c4bca6a883 100644 --- a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts @@ -13,6 +13,8 @@ plugins { repositories { mavenCentral() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + mavenLocal() } dependencies { diff --git a/core/api/core.api b/core/api/core.api index c6b9747ca07..be21c6cda49 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -42,8 +42,8 @@ public final class dev/kord/core/Kord : kotlinx/coroutines/CoroutineScope { public final fun getEvents ()Lkotlinx/coroutines/flow/SharedFlow; public final fun getGateway ()Ldev/kord/core/gateway/MasterGateway; public final fun getGlobalApplicationCommand (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getGlobalApplicationCommandOf (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun getGlobalApplicationCommandOfOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final synthetic fun getGlobalApplicationCommandOf (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final synthetic fun getGlobalApplicationCommandOfOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGlobalApplicationCommandOrNull (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getGlobalApplicationCommands (Ljava/lang/Boolean;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun getGlobalApplicationCommands$default (Ldev/kord/core/Kord;Ljava/lang/Boolean;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; diff --git a/core/api/core.klib.api b/core/api/core.klib.api index 6d212634e25..a55ca0c4f4f 100644 --- a/core/api/core.klib.api +++ b/core/api/core.klib.api @@ -11698,6 +11698,8 @@ final class dev.kord.core/Kord : kotlinx.coroutines/CoroutineScope { // dev.kord final suspend fun getWebhookWithTokenOrNull(dev.kord.common.entity/Snowflake, kotlin/String, dev.kord.core.supplier/EntitySupplyStrategy<*> = ...): dev.kord.core.entity/Webhook? // dev.kord.core/Kord.getWebhookWithTokenOrNull|getWebhookWithTokenOrNull(dev.kord.common.entity.Snowflake;kotlin.String;dev.kord.core.supplier.EntitySupplyStrategy<*>){}[0] final suspend fun logout() // dev.kord.core/Kord.logout|logout(){}[0] final suspend fun shutdown() // dev.kord.core/Kord.shutdown|shutdown(){}[0] + final suspend inline fun <#A1: reified dev.kord.core.entity.application/GlobalApplicationCommand> getGlobalApplicationCommandOf(dev.kord.common.entity/Snowflake): #A1 // dev.kord.core/Kord.getGlobalApplicationCommandOf|getGlobalApplicationCommandOf(dev.kord.common.entity.Snowflake){0§}[0] + final suspend inline fun <#A1: reified dev.kord.core.entity.application/GlobalApplicationCommand> getGlobalApplicationCommandOfOrNull(dev.kord.common.entity/Snowflake): #A1? // dev.kord.core/Kord.getGlobalApplicationCommandOfOrNull|getGlobalApplicationCommandOfOrNull(dev.kord.common.entity.Snowflake){0§}[0] final suspend inline fun <#A1: reified dev.kord.core.entity.application/GuildApplicationCommand> getGuildApplicationCommandOf(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake): #A1 // dev.kord.core/Kord.getGuildApplicationCommandOf|getGuildApplicationCommandOf(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake){0§}[0] final suspend inline fun <#A1: reified dev.kord.core.entity.application/GuildApplicationCommand> getGuildApplicationCommandOfOrNull(dev.kord.common.entity/Snowflake, dev.kord.common.entity/Snowflake): #A1? // dev.kord.core/Kord.getGuildApplicationCommandOfOrNull|getGuildApplicationCommandOfOrNull(dev.kord.common.entity.Snowflake;dev.kord.common.entity.Snowflake){0§}[0] final suspend inline fun <#A1: reified dev.kord.core.entity.channel/Channel> getChannelOf(dev.kord.common.entity/Snowflake, dev.kord.core.supplier/EntitySupplyStrategy<*> = ...): #A1? // dev.kord.core/Kord.getChannelOf|getChannelOf(dev.kord.common.entity.Snowflake;dev.kord.core.supplier.EntitySupplyStrategy<*>){0§}[0] diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index 9f49374ee11..4e5db7d28a8 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -40,6 +40,7 @@ import kotlinx.coroutines.flow.* import kotlin.contracts.InvocationKind import kotlin.contracts.contract import kotlin.coroutines.CoroutineContext +import kotlin.jvm.JvmName import kotlinx.coroutines.channels.Channel as CoroutineChannel @Deprecated("Use your own logger instead. This declaration will be removed in 0.16.0.", level = DeprecationLevel.HIDDEN) @@ -501,16 +502,46 @@ public class Kord( } + @Suppress("TYPE_INTERSECTION_AS_REIFIED_WARNING") + @Deprecated( + "This function has bad semantics: the type argument for T is effectively ignored. It no longer compiles " + + "without a 'TYPE_INTERSECTION_AS_REIFIED_WARNING' (https://youtrack.jetbrains.com/issue/KT-52469). " + + "The replacement function has a proper bounded reified type parameter that is actually used. This " + + "declaration is kept for binary compatibility, it will be removed in 0.18.0. The replacement function " + + "should then be migrated away from using @JvmName.", + level = DeprecationLevel.HIDDEN, + ) public suspend fun getGlobalApplicationCommandOf(commandId: Snowflake): T { return defaultSupplier.getGlobalApplicationCommandOf(resources.applicationId, commandId) } + @Suppress("TYPE_INTERSECTION_AS_REIFIED_WARNING") + @Deprecated( + "This function has bad semantics: the type argument for T is effectively ignored. It no longer compiles " + + "without a 'TYPE_INTERSECTION_AS_REIFIED_WARNING' (https://youtrack.jetbrains.com/issue/KT-52469). " + + "The replacement function has a proper bounded reified type parameter that is actually used. This " + + "declaration is kept for binary compatibility, it will be removed in 0.18.0. The replacement function " + + "should then be migrated away from using @JvmName.", + level = DeprecationLevel.HIDDEN, + ) public suspend fun getGlobalApplicationCommandOfOrNull(commandId: Snowflake): T? { return defaultSupplier.getGlobalApplicationCommandOfOrNull(resources.applicationId, commandId) } + @JvmName("getGlobalApplicationCommandOfJvmInlineReplacement") + public suspend inline fun getGlobalApplicationCommandOf( + commandId: Snowflake, + ): T = defaultSupplier.getGlobalApplicationCommandOf(resources.applicationId, commandId) + + + @JvmName("getGlobalApplicationCommandOfOrNullJvmInlineReplacement") + public suspend inline fun getGlobalApplicationCommandOfOrNull( + commandId: Snowflake, + ): T? = defaultSupplier.getGlobalApplicationCommandOfOrNull(resources.applicationId, commandId) + + public suspend inline fun createGlobalChatInputCommand( name: String, description: String, diff --git a/core/src/commonMain/kotlin/entity/VoiceState.kt b/core/src/commonMain/kotlin/entity/VoiceState.kt index 22003beea14..0c41c80410e 100644 --- a/core/src/commonMain/kotlin/entity/VoiceState.kt +++ b/core/src/commonMain/kotlin/entity/VoiceState.kt @@ -60,7 +60,8 @@ public class VoiceState( * * @throws [RequestException] if anything went wrong during the request. */ - public suspend fun getChannelOrNull(): BaseVoiceChannelBehavior? = channelId?.let { supplier.getChannelOfOrNull(it) } + public suspend fun getChannelOrNull(): BaseVoiceChannelBehavior? = + channelId?.let { supplier.getChannelOrNull(it) as? BaseVoiceChannelBehavior } /** diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 39a9af8bcb1..dcebe93c11e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # api dependencies -kotlin = "2.1.0-Beta1" # https://github.com/JetBrains/kotlin +kotlin = "2.1.0-dev-7621" # https://github.com/JetBrains/kotlin ktor = "2.3.12" # https://github.com/ktorio/ktor kotlinx-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines kotlinx-serialization = "1.7.2" # https://github.com/Kotlin/kotlinx.serialization @@ -18,7 +18,7 @@ stately = "2.1.0" # https://github.com/touchlab/Stately fastZlib = "2.0.1" # https://github.com/timotejroiko/fast-zlib # code generation -ksp = "2.0.20-1.0.24" # https://github.com/google/ksp +ksp = "2.0.255-SNAPSHOT" # https://github.com/google/ksp kotlinpoet = "1.18.1" # https://github.com/square/kotlinpoet # tests diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index d138ecefe9a..b2f299525e2 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -325,10 +325,10 @@ minimatch@^5.0.1, minimatch@^5.1.6: dependencies: brace-expansion "^2.0.1" -mocha@10.7.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a" - integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA== +mocha@10.7.3: + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== dependencies: ansi-colors "^4.1.3" browser-stdout "^1.3.1"