mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 08:13:53 +00:00
3.3.0
This commit is contained in:
parent
f73620afec
commit
6abfc3d369
@ -2,8 +2,7 @@ import dev.inmo.micro_utils.coroutines.defaultSafelyWithoutExceptionHandler
|
|||||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||||
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.get.getCustomEmojiStickerOrNull
|
import dev.inmo.tgbotapi.extensions.api.get.*
|
||||||
import dev.inmo.tgbotapi.extensions.api.get.getStickerSet
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.*
|
import dev.inmo.tgbotapi.extensions.api.send.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
|
||||||
@ -14,7 +13,10 @@ import dev.inmo.tgbotapi.utils.bold
|
|||||||
import dev.inmo.tgbotapi.utils.buildEntities
|
import dev.inmo.tgbotapi.utils.buildEntities
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
fun StickerSet.buildInfo() = buildEntities {
|
fun StickerSet?.buildInfo() = buildEntities {
|
||||||
|
if (this@buildInfo == null) {
|
||||||
|
bold("Looks like this stickerset has been removed")
|
||||||
|
} else {
|
||||||
bold("StickerSet name: ") + "${name}\n"
|
bold("StickerSet name: ") + "${name}\n"
|
||||||
bold("StickerSet title: ") + "${title}\n"
|
bold("StickerSet title: ") + "${title}\n"
|
||||||
bold(
|
bold(
|
||||||
@ -25,6 +27,7 @@ fun StickerSet.buildInfo() = buildEntities {
|
|||||||
is StickerType.Unknown -> "Unknown type \"${stickerType.type}\""
|
is StickerType.Unknown -> "Unknown type \"${stickerType.type}\""
|
||||||
}
|
}
|
||||||
) + " sticker set with title " + bold(title) + " and name " + bold(name)
|
) + " sticker set with title " + bold(title) + " and name " + bold(name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun activateStickerInfoBot(
|
suspend fun activateStickerInfoBot(
|
||||||
@ -58,7 +61,7 @@ suspend fun activateStickerInfoBot(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onSticker {
|
onSticker {
|
||||||
val stickerSetInfo = getStickerSet(it.content.media)
|
val stickerSetInfo = getStickerSetOrNull(it.content.media)
|
||||||
reply(
|
reply(
|
||||||
it,
|
it,
|
||||||
stickerSetInfo.buildInfo()
|
stickerSetInfo.buildInfo()
|
||||||
|
@ -4,8 +4,8 @@ org.gradle.parallel=true
|
|||||||
org.gradle.jvmargs=-Xmx768m
|
org.gradle.jvmargs=-Xmx768m
|
||||||
|
|
||||||
|
|
||||||
kotlin_version=1.7.10
|
kotlin_version=1.7.20
|
||||||
telegram_bot_api_version=3.2.7
|
telegram_bot_api_version=3.3.0
|
||||||
micro_utils_version=0.12.17
|
micro_utils_version=0.13.1
|
||||||
serialization_version=1.4.0
|
serialization_version=1.4.1
|
||||||
ktor_version=2.1.2
|
ktor_version=2.1.2
|
||||||
|
Loading…
Reference in New Issue
Block a user