mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +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
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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,9 +18,12 @@ fun List<TextSource>.parseCommandsWithParams(
|
|||||||
var currentBotCommandSource: BotCommandTextSource? = null
|
var currentBotCommandSource: BotCommandTextSource? = null
|
||||||
var currentArgs = ""
|
var currentArgs = ""
|
||||||
fun includeCurrent() = currentBotCommandSource ?.let {
|
fun includeCurrent() = currentBotCommandSource ?.let {
|
||||||
|
currentArgs = currentArgs.trim()
|
||||||
|
if (currentArgs.isNotEmpty()) {
|
||||||
result[it.command] = currentArgs.split(argsSeparator).toTypedArray()
|
result[it.command] = currentArgs.split(argsSeparator).toTypedArray()
|
||||||
currentArgs = ""
|
currentArgs = ""
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (textSource in this) {
|
for (textSource in this) {
|
||||||
if (textSource is BotCommandTextSource) {
|
if (textSource is BotCommandTextSource) {
|
||||||
includeCurrent()
|
includeCurrent()
|
||||||
|
Loading…
Reference in New Issue
Block a user