Better prefix trimming for redirects

This commit is contained in:
kageru 2019-06-10 08:18:44 +02:00
parent 92dc0a3322
commit 18ea000b9d
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ class Redirect(private val target: Long, private val anonymous: Boolean) {
config.localization.redirectedMessage,
message.readableMessageContent.let { content ->
when (command.matchType) {
MatchType.PREFIX -> content.removePrefix("${command.trigger} ")
MatchType.PREFIX -> content.removePrefix(command.trigger).trim()
else -> content
}
}

View File

@ -50,4 +50,4 @@ actions = { redirect = { target = 555097559023222825 } }
[[commands]]
trigger = "!anonRedirect"
response = "redirected"
actions = { redirect = {target = 555097559023222825, anonymous = true } }
actions = { redirect = { target = 555097559023222825, anonymous = true } }