diff --git a/core/src/main/kotlin/Util.kt b/core/src/main/kotlin/Util.kt index b79020ca6c7..5aca9b0bf3c 100644 --- a/core/src/main/kotlin/Util.kt +++ b/core/src/main/kotlin/Util.kt @@ -30,12 +30,12 @@ import kotlin.reflect.KClass internal fun String?.toSnowflakeOrNull(): Snowflake? = when { this == null -> null - else -> runCatching { Snowflake(this) }.getOrNull() + else -> Snowflake(this) } internal fun Long?.toSnowflakeOrNull(): Snowflake? = when { this == null -> null - else -> runCatching { Snowflake(this) }.getOrNull() + else -> Snowflake(this) } internal fun String.toInstant() = DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(this, Instant::from) diff --git a/core/src/main/kotlin/entity/interaction/Interaction.kt b/core/src/main/kotlin/entity/interaction/Interaction.kt index a41e10b6b8a..1681f9c87d6 100644 --- a/core/src/main/kotlin/entity/interaction/Interaction.kt +++ b/core/src/main/kotlin/entity/interaction/Interaction.kt @@ -261,7 +261,7 @@ fun OptionValue(value: DiscordOptionValue<*>, resolvedObjects: ResolvedObjects?) if (resolvedObjects == null) return OptionValue.StringOptionValue(value.value) val string = value.value - val snowflake = string.toSnowflakeOrNull() ?: return OptionValue.StringOptionValue(string) + val snowflake = string.toLongOrNull().toSnowflakeOrNull() ?: return OptionValue.StringOptionValue(string) when { resolvedObjects.members?.get(snowflake) != null ->