mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 08:13:53 +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())) {
|
||||
onContentMessage(
|
||||
initialFilter = CommonMessageFilterExcludeMediaGroups,
|
||||
subcontextUpdatesFilter = MessageFilterByChat
|
||||
) {
|
||||
val chat = it.chat
|
||||
withTypingAction(chat) {
|
||||
|
||||
val answer = withTypingAction(chat) {
|
||||
executeUnsafe(it.content.createResend(chat.id, replyToMessageId = it.messageId)) {
|
||||
it.forEach(print)
|
||||
}
|
||||
}
|
||||
}
|
||||
onVisualGallery {
|
||||
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() })
|
||||
}
|
||||
|
||||
println("Answer info: $answer")
|
||||
}
|
||||
|
||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx768m
|
||||
|
||||
|
||||
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
|
||||
serialization_version=1.4.1
|
||||
ktor_version=2.1.3
|
||||
|
Loading…
Reference in New Issue
Block a user