update up to 4.0.0

This commit is contained in:
InsanusMokrassar 2022-11-08 12:19:23 +06:00
parent c3dcb4d738
commit c0019bcbf8
2 changed files with 5 additions and 21 deletions

View File

@ -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) {

View File

@ -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