From 2f5fdcdca0cac43b15abb243b39141e5d2a1359b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 12 Jan 2022 11:37:34 +0600 Subject: [PATCH 1/7] start 0.38.3 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d03acee3..568a631b1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 0.38.3 + ## 0.38.2 * `Common`: diff --git a/gradle.properties b/gradle.properties index 6b1f41d6d1..da3400dc2f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,6 +18,6 @@ micro_utils_version=0.9.1 javax_activation_version=1.1.1 library_group=dev.inmo -library_version=0.38.2 +library_version=0.38.3 github_release_plugin_version=2.2.12 From 28fce0b4c1678f9351634eb3f5add52ececb8543 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 12 Jan 2022 11:39:35 +0600 Subject: [PATCH 2/7] New extensions "TelegramBot#send*" for media groups with contents --- CHANGELOG.md | 3 + .../api/send/media/SendMediaGroup.kt | 126 ++++++++++++++++++ 2 files changed, 129 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 568a631b1e..031ee31f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.38.3 +* `API` + * New extensions `TelegramBot#send*` for media groups with contents + ## 0.38.2 * `Common`: diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt index 0bd5de4206..be8f180f54 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt @@ -7,7 +7,11 @@ import dev.inmo.tgbotapi.types.InputMedia.* import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.chat.abstracts.Chat import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent +import dev.inmo.tgbotapi.types.message.content.abstracts.VisualMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.media.AudioContent +import dev.inmo.tgbotapi.types.message.content.media.DocumentContent import dev.inmo.tgbotapi.utils.RiskFeature +import kotlin.jvm.JvmName /** * @see SendMediaGroup @@ -41,6 +45,38 @@ suspend fun TelegramBot.sendMediaGroup( chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply ) +/** + * @see SendMediaGroup + */ +@RiskFeature(rawSendingMediaGroupsWarning) +@JvmName("sendMedaGroupByContent") +suspend fun TelegramBot.sendMediaGroup( + chatId: ChatIdentifier, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendMediaGroup( + chatId, media.map { it.toMediaGroupMemberInputMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + +/** + * @see SendMediaGroup + */ +@RiskFeature(rawSendingMediaGroupsWarning) +@JvmName("sendMedaGroupByContent") +suspend fun TelegramBot.sendMediaGroup( + chat: Chat, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendMediaGroup( + chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + /** * @see SendPlaylist */ @@ -71,6 +107,36 @@ suspend fun TelegramBot.sendPlaylist( chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply ) +/** + * @see SendPlaylist + */ +@JvmName("sendPlaylistByContent") +suspend fun TelegramBot.sendPlaylist( + chatId: ChatIdentifier, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendPlaylist( + chatId, media.map { it.toMediaGroupMemberInputMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + +/** + * @see SendPlaylist + */ +@JvmName("sendPlaylistByContent") +suspend fun TelegramBot.sendPlaylist( + chat: Chat, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendPlaylist( + chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + /** * @see SendDocumentsGroup */ @@ -101,6 +167,36 @@ suspend fun TelegramBot.sendDocumentsGroup( chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply ) +/** + * @see SendDocumentsGroup + */ +@JvmName("sendDocumentsByContent") +suspend fun TelegramBot.sendDocumentsGroup( + chatId: ChatIdentifier, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendDocumentsGroup( + chatId, media.map { it.toMediaGroupMemberInputMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + +/** + * @see SendDocumentsGroup + */ +@JvmName("sendDocumentsByContent") +suspend fun TelegramBot.sendDocumentsGroup( + chat: Chat, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendDocumentsGroup( + chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + /** * @see SendVisualMediaGroup */ @@ -130,3 +226,33 @@ suspend fun TelegramBot.sendVisualMediaGroup( ) = sendVisualMediaGroup( chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply ) + +/** + * @see SendVisualMediaGroup + */ +@JvmName("sendVisualMediaGroupByContent") +suspend fun TelegramBot.sendVisualMediaGroup( + chatId: ChatIdentifier, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendVisualMediaGroup( + chatId, media.map { it.toMediaGroupMemberInputMedia() }, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) + +/** + * @see SendVisualMediaGroup + */ +@JvmName("sendVisualMediaGroupByContent") +suspend fun TelegramBot.sendVisualMediaGroup( + chat: Chat, + media: List, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) = sendVisualMediaGroup( + chat.id, media, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply +) From 85a8a8eedcbce9354bf49ff9bafd91bfe41a6eb4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 12 Jan 2022 13:02:23 +0600 Subject: [PATCH 3/7] update dokka version --- docs/gradle.properties | 2 -- gradle.properties | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/gradle.properties b/docs/gradle.properties index 612bde7275..e9157af4da 100644 --- a/docs/gradle.properties +++ b/docs/gradle.properties @@ -1,3 +1 @@ -dokka_version=1.6.0 - org.gradle.jvmargs=-Xmx1024m diff --git a/gradle.properties b/gradle.properties index da3400dc2f..b4765528f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,11 +12,13 @@ klock_version=2.4.10 uuid_version=0.3.1 ktor_version=1.6.7 - micro_utils_version=0.9.1 javax_activation_version=1.1.1 + +dokka_version=1.6.10 + library_group=dev.inmo library_version=0.38.3 From 094f88867dc318f911c73bbd0c16811c09726a85 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jan 2022 13:52:49 +0600 Subject: [PATCH 4/7] Update gradle.properties --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index b4765528f0..64f2f6d0c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,11 +8,11 @@ kotlin.incremental.js=true kotlin_version=1.6.10 kotlin_coroutines_version=1.6.0 kotlin_serialisation_runtime_version=1.3.2 -klock_version=2.4.10 +klock_version=2.4.12 uuid_version=0.3.1 ktor_version=1.6.7 -micro_utils_version=0.9.1 +micro_utils_version=0.9.2 javax_activation_version=1.1.1 From 1ea79b9f7f1cb3e4966128d33d546e179be6d5d4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jan 2022 19:01:17 +0600 Subject: [PATCH 5/7] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 031ee31f3b..13f7ad5baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.38.3 +* `Common`: + * `Version`: + * `MicroUtils`: `0.9.1` -> `0.9.2` + * `Klock`: `2.4.10` -> `2.4.12` * `API` * New extensions `TelegramBot#send*` for media groups with contents From 441f3cee3ddff4228d5c5d19808b70a85900782d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 14 Jan 2022 16:31:19 +0600 Subject: [PATCH 6/7] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 64f2f6d0c8..ae5123c8ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ kotlin_version=1.6.10 kotlin_coroutines_version=1.6.0 kotlin_serialisation_runtime_version=1.3.2 klock_version=2.4.12 -uuid_version=0.3.1 +uuid_version=0.4.0 ktor_version=1.6.7 micro_utils_version=0.9.2 From 468fc0a49b7d83ef28c268d65dfcc7e94a7ffa0a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 14 Jan 2022 16:31:57 +0600 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f7ad5baf..89834efb6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * `Version`: * `MicroUtils`: `0.9.1` -> `0.9.2` * `Klock`: `2.4.10` -> `2.4.12` + * `UUID`: `0.3.1` -> `0.4.0` * `API` * New extensions `TelegramBot#send*` for media groups with contents