Skip to content

Commit

Permalink
Small general converter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Dec 17, 2023
1 parent cc824eb commit 0fac60b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import dev.kord.rest.builder.interaction.StringChoiceBuilder

types = [ConverterType.DEFAULTING, ConverterType.LIST, ConverterType.OPTIONAL, ConverterType.SINGLE],
imports = ["kotlin.text.RegexOption"],
builderFields = ["public var options: Set<RegexOption> = setOf()"]
builderFields = ["public var options: MutableSet<RegexOption> = mutableSetOf()"]
)
public class RegexConverter(
private val options: Set<RegexOption> = setOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public class UserConverter(
}
}

if (arg.equals("you", true)) {
this.parsed = bot.kordRef.getSelf()

return true
}

this.parsed = findUser(arg, context)
?: throw DiscordRelayedException(
context.translate("converters.user.error.missing", replacements = arrayOf(arg))
Expand Down

0 comments on commit 0fac60b

Please sign in to comment.