mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-07-15 23:11:03 +00:00
update up to 0.35.9
This commit is contained in:
FSMBot/src/main/kotlin
FilesLoaderBot/src/main/kotlin
ForwardInfoSenderBot/src/main/kotlin
RandomFileSenderBot/src/main/kotlin
ResenderBot/ResenderBotLib/src/commonMain/kotlin
gradle.properties@ -36,7 +36,7 @@ suspend fun main(args: Array<String>) {
|
||||
if (currentRoot.isFile) {
|
||||
return currentRoot
|
||||
} else {
|
||||
return pickFile(currentRoot.listFiles() ?.random() ?: return null)
|
||||
return pickFile(currentRoot.listFiles() ?.takeIf { it.isNotEmpty() } ?.random() ?: return null)
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,8 +76,10 @@ suspend fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
sendFiles(message.chat, chosen)
|
||||
sent || chosen.isNotEmpty()
|
||||
if (chosen.isNotEmpty()) {
|
||||
sendFiles(message.chat, chosen)
|
||||
sent = true
|
||||
}
|
||||
|
||||
if (!sent) {
|
||||
bot.reply(message, "Nothing selected :(")
|
||||
|
Reference in New Issue
Block a user