Skip to content

Commit

Permalink
Now we wait on KTIJ-30021
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed May 22, 2024
1 parent 9199a05 commit 4c22ccc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public class ConverterProcessor(
import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.converters.*
import com.kotlindiscord.kord.extensions.commands.converters.builders.*
import com.kotlindiscord.kord.extensions.utils.MutableStringKeyedMap
import dev.kord.common.annotation.KordPreview
""".trimIndent()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public class ConverterBuilderClassBuilder : KoinComponent {
builder.append(" {\n")

if (ConverterType.CHOICE in types) {
builder.append(" override var choices: MutableMap<String, $argumentType> = mutableMapOf()\n\n")
builder.append(" override var choices: MutableStringKeyedMap<$argumentType> = mutableMapOf()\n\n")
}

builder.append(" /** @inject: builderFields **/\n")
Expand Down
8 changes: 0 additions & 8 deletions kord-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
repositories {
maven {
Expand Down Expand Up @@ -55,12 +53,6 @@ dependencies {
kspTest(project(":annotation-processor"))
}

val compileKotlin: KotlinCompile by tasks

compileKotlin.kotlinOptions {
languageVersion = "1.7"
}

dokkaModule {
moduleName = "Kord Extensions"
includes.add("packages.md")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,17 +578,15 @@ public abstract class ApplicationCommandRegistry : KordExKoinComponent {
}

@Suppress("DEPRECATION_ERROR")
private fun <A, B : Choice> BaseChoiceBuilder<A, B>.translate(command: ApplicationCommand<*>) {
private fun <C : Choice> BaseChoiceBuilder<*, C>.translate(command: ApplicationCommand<*>) {
this.choices = choices!!.map {
val (name, nameLocalizations) = command.localize(it.name)

when (it) {
is Choice.NumberChoice -> Choice.NumberChoice(name, Optional(nameLocalizations), it.value)
is Choice.StringChoice -> Choice.StringChoice(name, Optional(nameLocalizations), it.value)
is Choice.IntegerChoice -> Choice.IntegerChoice(name, Optional(nameLocalizations), it.value)

is NumericOptionBuilder<*, *> -> TODO()
} as B
when (val c = it as Choice) {
is Choice.NumberChoice -> Choice.NumberChoice(name, Optional(nameLocalizations), c.value)
is Choice.StringChoice -> Choice.StringChoice(name, Optional(nameLocalizations), c.value)
is Choice.IntegerChoice -> Choice.IntegerChoice(name, Optional(nameLocalizations), c.value)
} as C
}.toMutableList()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public open class SentryScopeCapture : SentryCapture() {
scope.setContexts("omitted_data_types", allowedTypes.omittedData!!)
}

processMap(tags).forEach(scope::setTag)
processMap<String>(tags).forEach(scope::setTag)
}

/** Set the given [value] into the [tags] map under [key]. **/
Expand Down
8 changes: 0 additions & 8 deletions test-bot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
repositories {
maven {
Expand Down Expand Up @@ -74,12 +72,6 @@ dependencies {
kspTest(project(":annotation-processor"))
}

val compileKotlin: KotlinCompile by tasks

compileKotlin.kotlinOptions {
languageVersion = "1.7"
}

application {
this.mainClass.set("com.kotlindiscord.kord.extensions.testbot.TestBotKt")
}
Expand Down

0 comments on commit 4c22ccc

Please sign in to comment.