mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-04 15:49:41 +00:00
fixes in parseCommandsWithParams
This commit is contained in:
@@ -18,10 +18,12 @@ fun List<TextSource>.parseCommandsWithParams(
|
|||||||
var currentArgs = ""
|
var currentArgs = ""
|
||||||
fun includeCurrent() = currentBotCommandSource ?.let {
|
fun includeCurrent() = currentBotCommandSource ?.let {
|
||||||
currentArgs = currentArgs.trim()
|
currentArgs = currentArgs.trim()
|
||||||
if (currentArgs.isNotEmpty()) {
|
result[it.command] = if (currentArgs.isNotEmpty()) {
|
||||||
result[it.command] = currentArgs.split(argsSeparator).toTypedArray()
|
currentArgs.split(argsSeparator).toTypedArray()
|
||||||
currentArgs = ""
|
} else {
|
||||||
|
emptyArray()
|
||||||
}
|
}
|
||||||
|
currentArgs = ""
|
||||||
}
|
}
|
||||||
for (textSource in this) {
|
for (textSource in this) {
|
||||||
if (textSource is BotCommandTextSource) {
|
if (textSource is BotCommandTextSource) {
|
||||||
|
Reference in New Issue
Block a user