From 0ca811c3c0b4a8eb198ff7e2735b2605af85bf3c Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Tue, 26 Dec 2023 11:12:29 +0000 Subject: [PATCH] Converter: Support missing genericBuilder Required by the wrapping converters, but was swallowed previously due to the inconsistent error-ignoring logic. --- .../kord/extensions/commands/converters/Converter.kt | 2 +- .../extensions/testbot/extensions/ArgumentTestExtension.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/converters/Converter.kt b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/converters/Converter.kt index 01157e92d8..009c4435d1 100644 --- a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/converters/Converter.kt +++ b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/converters/Converter.kt @@ -88,7 +88,7 @@ public abstract class Converter): OutputType = - if (genericBuilder.mutator != null) { + if (::genericBuilder.isInitialized && genericBuilder.mutator != null) { genericBuilder.mutator!!(parsed) } else { parsed diff --git a/test-bot/src/main/kotlin/com/kotlindiscord/kord/extensions/testbot/extensions/ArgumentTestExtension.kt b/test-bot/src/main/kotlin/com/kotlindiscord/kord/extensions/testbot/extensions/ArgumentTestExtension.kt index edd0c6c173..bb4b506b62 100644 --- a/test-bot/src/main/kotlin/com/kotlindiscord/kord/extensions/testbot/extensions/ArgumentTestExtension.kt +++ b/test-bot/src/main/kotlin/com/kotlindiscord/kord/extensions/testbot/extensions/ArgumentTestExtension.kt @@ -31,7 +31,8 @@ public class ArgumentTestExtension : Extension() { action { respond { - content = "Tag provided: `${arguments.tag?.name}`" + content = "Channel provided: `${arguments.channel?.mention}`\n" + + "Tag provided: `${arguments.tag?.name}`" } } }