mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
fixes in parseCommandsWithParams
This commit is contained in:
parent
e7bbce3fa7
commit
3069a6084c
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user