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