mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 16:23:54 +00:00
update up to 4.0.0
This commit is contained in:
parent
c3dcb4d738
commit
c0019bcbf8
@ -20,33 +20,17 @@ suspend fun activateResenderBot(
|
|||||||
|
|
||||||
bot.buildBehaviourWithLongPolling(CoroutineScope(currentCoroutineContext() + SupervisorJob())) {
|
bot.buildBehaviourWithLongPolling(CoroutineScope(currentCoroutineContext() + SupervisorJob())) {
|
||||||
onContentMessage(
|
onContentMessage(
|
||||||
initialFilter = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter = MessageFilterByChat
|
subcontextUpdatesFilter = MessageFilterByChat
|
||||||
) {
|
) {
|
||||||
val chat = it.chat
|
val chat = it.chat
|
||||||
withTypingAction(chat) {
|
|
||||||
|
val answer = withTypingAction(chat) {
|
||||||
executeUnsafe(it.content.createResend(chat.id, replyToMessageId = it.messageId)) {
|
executeUnsafe(it.content.createResend(chat.id, replyToMessageId = it.messageId)) {
|
||||||
it.forEach(print)
|
it.forEach(print)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
onVisualGallery {
|
println("Answer info: $answer")
|
||||||
val chat = it.chat ?: return@onVisualGallery
|
|
||||||
withUploadPhotoAction(chat) {
|
|
||||||
send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onPlaylist {
|
|
||||||
val chat = it.chat ?: return@onPlaylist
|
|
||||||
withUploadDocumentAction(chat) {
|
|
||||||
send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onDocumentsGroup {
|
|
||||||
val chat = it.chat ?: return@onDocumentsGroup
|
|
||||||
withUploadDocumentAction(chat) {
|
|
||||||
send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx768m
|
|||||||
|
|
||||||
|
|
||||||
kotlin_version=1.7.20
|
kotlin_version=1.7.20
|
||||||
telegram_bot_api_version=3.3.1
|
telegram_bot_api_version=4.0.0
|
||||||
micro_utils_version=0.13.2
|
micro_utils_version=0.13.2
|
||||||
serialization_version=1.4.1
|
serialization_version=1.4.1
|
||||||
ktor_version=2.1.3
|
ktor_version=2.1.3
|
||||||
|
Loading…
Reference in New Issue
Block a user