Compare commits

...

31 Commits

Author SHA1 Message Date
InsanusMokrassar 7d3c8a2d27
Merge pull request #843 from InsanusMokrassar/12.0.0
12.0.0
2024-04-20 23:35:13 +06:00
InsanusMokrassar f12628bec3 add notice about breaking changes in 12.0.0 2024-04-20 23:33:32 +06:00
InsanusMokrassar c1734e6d12 update changelog and readme 2024-04-20 23:31:42 +06:00
InsanusMokrassar 4bff860c01 fixes 2024-04-19 19:34:27 +06:00
InsanusMokrassar 6a8b83f750 remove timezone function from BusinessOpeningHours 2024-04-19 17:50:35 +06:00
InsanusMokrassar ab9718b7c6 fixes in business connections 2024-04-19 17:36:38 +06:00
InsanusMokrassar 0a9235bcd9 add flag sentByBusinessConnectionOwner 2024-04-18 20:07:33 +06:00
InsanusMokrassar eff2f2ba41 fixes in updates retrieving 2024-04-18 17:06:48 +06:00
InsanusMokrassar db644c93ff update support of BiometricManager 2024-04-18 16:40:59 +06:00
InsanusMokrassar 28e031265c update stickers 2024-04-18 16:12:19 +06:00
InsanusMokrassar 84abd006ad support of new stickers API 2024-04-18 15:50:21 +06:00
InsanusMokrassar 5f4a327c2e add support of replaceStickerInSet 2024-04-18 15:21:07 +06:00
InsanusMokrassar c5102590cc update users shared related things 2024-04-18 15:03:22 +06:00
InsanusMokrassar 072264faad add support of users in UsersShared 2024-04-18 14:47:22 +06:00
InsanusMokrassar 6b74bc155e update ChatShared 2024-04-18 14:45:06 +06:00
InsanusMokrassar 9d506b11a3 add support of birthdate 2024-04-18 14:43:14 +06:00
InsanusMokrassar f47b3673a7 fix build 2024-04-17 16:40:58 +06:00
InsanusMokrassar dbb8be502a almost completed sends with business connection id 2024-04-17 15:09:45 +06:00
InsanusMokrassar 170747741f remove redundant includes of business connection id in send requests 2024-04-17 13:55:37 +06:00
InsanusMokrassar e4a3acdd68 start adding of support business_connection_id in sending requests 2024-04-16 23:11:01 +06:00
InsanusMokrassar 953bdef657 add support of personal chat, is_from_offline and can_connect_to_business 2024-04-16 22:57:07 +06:00
InsanusMokrassar 64ef0fa160 potentially finally add support of business chats input 2024-04-16 22:04:35 +06:00
InsanusMokrassar c1f40c1030 some progress on business chats 2024-04-16 19:25:18 +06:00
InsanusMokrassar 8de584b292 add support of business info in chats 2024-04-16 18:43:09 +06:00
InsanusMokrassar cb7bb01671 add sender_business_bot support 2024-04-16 18:37:04 +06:00
InsanusMokrassar a7b2bb820b add different business entities 2024-04-16 18:29:57 +06:00
InsanusMokrassar be9c0cff61 some progress in business connections support 2024-04-16 16:00:15 +06:00
InsanusMokrassar 6ac6ad0c0a add several abstractions of business chats 2024-04-15 21:01:52 +06:00
InsanusMokrassar dbc69def0b add support of BusinessConnection 2024-04-15 17:47:18 +06:00
InsanusMokrassar b8061966be almost completed adding of BusinessConnection 2024-04-15 01:19:33 +06:00
InsanusMokrassar 0e0af73633 start 12.0.0 2024-04-02 21:12:35 +06:00
159 changed files with 5592 additions and 2621 deletions

View File

@ -1,5 +1,11 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 12.0.0
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
## 11.0.0 ## 11.0.0
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS** **THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**

View File

@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.1-blue)](https://core.telegram.org/bots/api-changelog#february-16-2024) # TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.2-blue)](https://core.telegram.org/bots/api-changelog#march-31-2024)
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true kotlin.incremental.js=true
library_group=dev.inmo library_group=dev.inmo
library_version=11.0.0 library_version=12.0.0

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.edit
import dev.inmo.tgbotapi.extensions.api.send.send import dev.inmo.tgbotapi.extensions.api.send.send
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
@ -42,6 +43,7 @@ suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<EditLiveLocationInfo>, locationsFlow: Flow<EditLiveLocationInfo>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -68,6 +70,7 @@ suspend fun TelegramBot.handleLiveLocation(
it.heading, it.heading,
it.proximityAlertRadius, it.proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -102,6 +105,7 @@ suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Location>, locationsFlow: Flow<Location>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -121,6 +125,7 @@ suspend fun TelegramBot.handleLiveLocation(
}, },
liveTimeMillis, liveTimeMillis,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -139,6 +144,7 @@ suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Pair<Double, Double>>, locationsFlow: Flow<Pair<Double, Double>>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -154,6 +160,7 @@ suspend fun TelegramBot.handleLiveLocation(
}, },
liveTimeMillis, liveTimeMillis,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,

View File

@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
import dev.inmo.tgbotapi.requests.send.SendLiveLocation import dev.inmo.tgbotapi.requests.send.SendLiveLocation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
@ -94,6 +95,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -110,6 +112,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -139,6 +142,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -153,6 +157,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -172,6 +177,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -186,6 +192,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -205,6 +212,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -219,6 +227,7 @@ suspend fun TelegramBot.startLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -239,6 +248,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull, threadId: MessageThreadId? = to.threadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -253,6 +263,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -272,6 +283,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null, initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null, initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull, threadId: MessageThreadId? = to.threadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -285,6 +297,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading, initHeading,
initProximityAlertRadius, initProximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),

View File

@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.get
import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.get.GetBusinessConnection
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
suspend fun TelegramBot.getBusinessConnection(
id: BusinessConnectionId
) = execute(GetBusinessConnection(businessConnectionId = id))
@Warning("This method may lead to error due to raw String type usage")
suspend fun TelegramBot.getBusinessConnection(
id: String
) = getBusinessConnection(
BusinessConnectionId(id)
)

View File

@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.api.send.polls.sendRegularPoll
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
@ -49,6 +50,7 @@ suspend inline fun TelegramBot.reply(
lastName: String? = null, lastName: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -59,6 +61,7 @@ suspend inline fun TelegramBot.reply(
firstName, firstName,
lastName, lastName,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -74,6 +77,7 @@ suspend inline fun TelegramBot.reply(
contact: Contact, contact: Contact,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -82,6 +86,7 @@ suspend inline fun TelegramBot.reply(
replyInChatId, replyInChatId,
contact, contact,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -100,11 +105,12 @@ suspend inline fun TelegramBot.replyWithDice(
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendDice(replyInChatId, animationType, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -115,11 +121,12 @@ suspend inline fun TelegramBot.reply(
animationType: DiceAnimationType, animationType: DiceAnimationType,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = replyWithDice(to, animationType, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = replyWithDice(to, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Location // Location
@ -134,6 +141,7 @@ suspend inline fun TelegramBot.reply(
longitude: Double, longitude: Double,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -143,6 +151,7 @@ suspend inline fun TelegramBot.reply(
latitude, latitude,
longitude, longitude,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -158,6 +167,7 @@ suspend inline fun TelegramBot.reply(
location: StaticLocation, location: StaticLocation,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -166,6 +176,7 @@ suspend inline fun TelegramBot.reply(
replyInChatId, replyInChatId,
location, location,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -186,6 +197,7 @@ suspend inline fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -196,6 +208,7 @@ suspend inline fun TelegramBot.reply(
parseMode, parseMode,
linkPreviewOptions, linkPreviewOptions,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -212,6 +225,7 @@ suspend inline fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -221,6 +235,7 @@ suspend inline fun TelegramBot.reply(
entities, entities,
linkPreviewOptions, linkPreviewOptions,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -237,12 +252,13 @@ suspend fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -254,12 +270,13 @@ suspend fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Venue // Venue
@ -280,6 +297,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -295,6 +313,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply),
@ -312,6 +331,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -327,6 +347,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply),
@ -338,6 +359,7 @@ suspend inline fun TelegramBot.reply(
venue: Venue, venue: Venue,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -346,6 +368,7 @@ suspend inline fun TelegramBot.reply(
chatId = replyInChatId, chatId = replyInChatId,
venue = venue, venue = venue,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply),
@ -360,12 +383,13 @@ suspend inline fun TelegramBot.replyWithGame(
gameShortName: String, gameShortName: String,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
replyInChatId, gameShortName, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup replyInChatId, gameShortName, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup
) )
suspend inline fun TelegramBot.replyWithGame( suspend inline fun TelegramBot.replyWithGame(
@ -373,12 +397,13 @@ suspend inline fun TelegramBot.replyWithGame(
game: Game, game: Game,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
replyInChatId, game.title, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup replyInChatId, game.title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup
) )
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
@ -386,11 +411,12 @@ suspend inline fun TelegramBot.reply(
game: Game, game: Game,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = replyWithGame(to, game, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = replyWithGame(to, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Animation // Animation
@ -407,6 +433,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -422,6 +449,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
width, width,
height, height,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -439,11 +467,12 @@ suspend inline fun TelegramBot.reply(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(replyInChatId, animation, text, parseMode, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAnimation(replyInChatId, animation, text, parseMode, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithAnimation( suspend inline fun TelegramBot.replyWithAnimation(
to: AccessibleMessage, to: AccessibleMessage,
@ -456,6 +485,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -470,6 +500,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
width, width,
height, height,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
@ -486,11 +517,12 @@ suspend inline fun TelegramBot.reply(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(replyInChatId, animation, entities, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAnimation(replyInChatId, animation, entities, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Audio // Audio
@ -506,11 +538,12 @@ suspend inline fun TelegramBot.replyWithAudio(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -520,11 +553,12 @@ suspend inline fun TelegramBot.reply(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithAudio( suspend inline fun TelegramBot.replyWithAudio(
to: AccessibleMessage, to: AccessibleMessage,
@ -536,11 +570,12 @@ suspend inline fun TelegramBot.replyWithAudio(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -549,11 +584,12 @@ suspend inline fun TelegramBot.reply(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Documents // Documents
@ -566,12 +602,13 @@ suspend inline fun TelegramBot.replyWithDocument(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -580,12 +617,13 @@ suspend inline fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.replyWithDocument( suspend inline fun TelegramBot.replyWithDocument(
to: AccessibleMessage, to: AccessibleMessage,
@ -594,12 +632,13 @@ suspend inline fun TelegramBot.replyWithDocument(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -607,12 +646,13 @@ suspend inline fun TelegramBot.reply(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
// Media Group // Media Group
@ -623,40 +663,44 @@ suspend inline fun TelegramBot.replyWithMediaGroup(
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendMediaGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithPlaylist( suspend inline fun TelegramBot.replyWithPlaylist(
to: AccessibleMessage, to: AccessibleMessage,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendPlaylist(replyInChatId, media, replyInThreadId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendPlaylist(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithDocuments( suspend inline fun TelegramBot.replyWithDocuments(
to: AccessibleMessage, to: AccessibleMessage,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendDocumentsGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendDocumentsGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithGallery( suspend inline fun TelegramBot.replyWithGallery(
to: AccessibleMessage, to: AccessibleMessage,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply))
// Photo // Photo
@ -669,11 +713,12 @@ suspend inline fun TelegramBot.replyWithPhoto(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, fileId, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, fileId, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -683,11 +728,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photo, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photo, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -697,11 +743,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photoSize, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photoSize, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithPhoto( suspend inline fun TelegramBot.replyWithPhoto(
@ -711,11 +758,12 @@ suspend inline fun TelegramBot.replyWithPhoto(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, fileId, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, fileId, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -724,11 +772,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photo, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photo, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -737,11 +786,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photoSize, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photoSize, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Sticker // Sticker
@ -752,11 +802,12 @@ suspend inline fun TelegramBot.replyWithSticker(
emoji: String? = null, emoji: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(replyInChatId, sticker, replyInThreadId, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -764,11 +815,12 @@ suspend inline fun TelegramBot.reply(
emoji: String? = null, emoji: String? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(replyInChatId, sticker, replyInThreadId, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Videos // Videos
@ -785,11 +837,12 @@ suspend inline fun TelegramBot.replyWithVideo(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, thumb, text, parseMode, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, thumb, text, parseMode, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -799,11 +852,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithVideo( suspend inline fun TelegramBot.replyWithVideo(
to: AccessibleMessage, to: AccessibleMessage,
@ -816,11 +870,12 @@ suspend inline fun TelegramBot.replyWithVideo(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, thumb, entities, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, thumb, entities, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -829,11 +884,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVideo(replyInChatId, video, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
// VideoNotes // VideoNotes
@ -846,22 +902,24 @@ suspend inline fun TelegramBot.replyWithVideoNote(
size: Int? = null, size: Int? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(replyInChatId, videoNote, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVideoNote(replyInChatId, videoNote, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
// Voice // Voice
@ -874,11 +932,12 @@ suspend inline fun TelegramBot.replyWithVoice(
duration: Long? = null, duration: Long? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -887,11 +946,12 @@ suspend inline fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.replyWithVoice( suspend inline fun TelegramBot.replyWithVoice(
@ -901,11 +961,12 @@ suspend inline fun TelegramBot.replyWithVoice(
duration: Long? = null, duration: Long? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -913,11 +974,12 @@ suspend inline fun TelegramBot.reply(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
// Invoice // Invoice
@ -966,11 +1028,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(replyInChatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendRegularPoll(replyInChatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -983,11 +1046,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(replyInChatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendRegularPoll(replyInChatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -1001,11 +1065,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -1020,11 +1085,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -1037,11 +1103,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
to: AccessibleMessage, to: AccessibleMessage,
@ -1055,11 +1122,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) ) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
@ -1072,6 +1140,7 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1088,6 +1157,7 @@ suspend inline fun TelegramBot.reply(
closeInfo = closeInfo, closeInfo = closeInfo,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1105,6 +1175,7 @@ suspend inline fun TelegramBot.reply(
closeInfo = closeInfo, closeInfo = closeInfo,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1170,6 +1241,7 @@ suspend fun TelegramBot.reply(
content: MessageContent, content: MessageContent,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1178,6 +1250,7 @@ suspend fun TelegramBot.reply(
content.createResend( content.createResend(
replyInChatId, replyInChatId,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true),
@ -1196,6 +1269,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1204,6 +1278,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true)
@ -1222,6 +1297,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1231,6 +1307,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true)
@ -1250,6 +1327,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1259,6 +1337,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true)
@ -1270,6 +1349,7 @@ suspend fun TelegramBot.reply(
mediaFile: TelegramMediaFile, mediaFile: TelegramMediaFile,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1281,6 +1361,7 @@ suspend fun TelegramBot.reply(
audio = mediaFile, audio = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1291,6 +1372,7 @@ suspend fun TelegramBot.reply(
animation = mediaFile, animation = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1301,6 +1383,7 @@ suspend fun TelegramBot.reply(
voice = mediaFile, voice = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1311,6 +1394,7 @@ suspend fun TelegramBot.reply(
video = mediaFile, video = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1321,6 +1405,7 @@ suspend fun TelegramBot.reply(
videoNote = mediaFile, videoNote = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1331,6 +1416,7 @@ suspend fun TelegramBot.reply(
document = mediaFile, document = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1341,6 +1427,7 @@ suspend fun TelegramBot.reply(
sticker = mediaFile, sticker = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1351,6 +1438,7 @@ suspend fun TelegramBot.reply(
photoSize = mediaFile, photoSize = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1361,6 +1449,7 @@ suspend fun TelegramBot.reply(
document = mediaFile.asDocumentFile(), document = mediaFile.asDocumentFile(),
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1376,6 +1465,7 @@ suspend fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1389,6 +1479,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1401,6 +1492,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1413,6 +1505,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1425,6 +1518,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1437,6 +1531,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1449,6 +1544,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1463,6 +1559,7 @@ suspend fun TelegramBot.reply(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = to.chat.id, replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1475,6 +1572,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1486,6 +1584,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1497,6 +1596,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1508,6 +1608,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1519,6 +1620,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1530,6 +1632,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,

View File

@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.api.send.polls.sendRegularPoll
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning import dev.inmo.tgbotapi.requests.send.media.rawSendingMediaGroupsWarning
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
@ -49,6 +50,7 @@ suspend inline fun TelegramBot.reply(
lastName: String? = null, lastName: String? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -59,6 +61,7 @@ suspend inline fun TelegramBot.reply(
firstName, firstName,
lastName, lastName,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -75,6 +78,7 @@ suspend inline fun TelegramBot.reply(
contact: Contact, contact: Contact,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -83,6 +87,7 @@ suspend inline fun TelegramBot.reply(
replyInChatId, replyInChatId,
contact, contact,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -102,11 +107,12 @@ suspend inline fun TelegramBot.replyWithDice(
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendDice(replyInChatId, animationType, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -118,11 +124,12 @@ suspend inline fun TelegramBot.reply(
animationType: DiceAnimationType, animationType: DiceAnimationType,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = replyWithDice(toChatId, toMessageId, animationType, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = replyWithDice(toChatId, toMessageId, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Location // Location
@ -138,6 +145,7 @@ suspend inline fun TelegramBot.reply(
longitude: Double, longitude: Double,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -147,6 +155,7 @@ suspend inline fun TelegramBot.reply(
latitude, latitude,
longitude, longitude,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -163,6 +172,7 @@ suspend inline fun TelegramBot.reply(
location: StaticLocation, location: StaticLocation,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -171,6 +181,7 @@ suspend inline fun TelegramBot.reply(
replyInChatId, replyInChatId,
location, location,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -192,6 +203,7 @@ suspend inline fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -202,6 +214,7 @@ suspend inline fun TelegramBot.reply(
parseMode, parseMode,
linkPreviewOptions, linkPreviewOptions,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -219,6 +232,7 @@ suspend inline fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -228,6 +242,7 @@ suspend inline fun TelegramBot.reply(
entities, entities,
linkPreviewOptions, linkPreviewOptions,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -245,12 +260,13 @@ suspend fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -263,12 +279,13 @@ suspend fun TelegramBot.reply(
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Venue // Venue
@ -290,6 +307,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -305,6 +323,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -323,6 +342,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -338,6 +358,7 @@ suspend inline fun TelegramBot.reply(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -350,6 +371,7 @@ suspend inline fun TelegramBot.reply(
venue: Venue, venue: Venue,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -358,6 +380,7 @@ suspend inline fun TelegramBot.reply(
chatId = replyInChatId, chatId = replyInChatId,
venue = venue, venue = venue,
threadId = replyInThreadId, threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyParameters = ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -373,12 +396,13 @@ suspend inline fun TelegramBot.replyWithGame(
gameShortName: String, gameShortName: String,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
replyInChatId, gameShortName, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup replyInChatId, gameShortName, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup
) )
suspend inline fun TelegramBot.replyWithGame( suspend inline fun TelegramBot.replyWithGame(
@ -387,12 +411,13 @@ suspend inline fun TelegramBot.replyWithGame(
game: Game, game: Game,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
replyInChatId, game.title, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup replyInChatId, game.title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup
) )
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
@ -401,11 +426,12 @@ suspend inline fun TelegramBot.reply(
game: Game, game: Game,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = replyWithGame(toChatId, toMessageId, game, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) ) = replyWithGame(toChatId, toMessageId, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
// Animation // Animation
@ -423,6 +449,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -438,6 +465,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
width, width,
height, height,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -456,11 +484,12 @@ suspend inline fun TelegramBot.reply(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(replyInChatId, animation, text, parseMode, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAnimation(replyInChatId, animation, text, parseMode, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithAnimation( suspend inline fun TelegramBot.replyWithAnimation(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -474,6 +503,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -488,6 +518,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
width, width,
height, height,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -505,11 +536,12 @@ suspend inline fun TelegramBot.reply(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(replyInChatId, animation, entities, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAnimation(replyInChatId, animation, entities, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Audio // Audio
@ -526,11 +558,12 @@ suspend inline fun TelegramBot.replyWithAudio(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -541,11 +574,12 @@ suspend inline fun TelegramBot.reply(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithAudio( suspend inline fun TelegramBot.replyWithAudio(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -558,11 +592,12 @@ suspend inline fun TelegramBot.replyWithAudio(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -572,11 +607,12 @@ suspend inline fun TelegramBot.reply(
title: String? = null, title: String? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Documents // Documents
@ -590,12 +626,13 @@ suspend inline fun TelegramBot.replyWithDocument(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -605,12 +642,13 @@ suspend inline fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.replyWithDocument( suspend inline fun TelegramBot.replyWithDocument(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -620,12 +658,13 @@ suspend inline fun TelegramBot.replyWithDocument(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -634,12 +673,13 @@ suspend inline fun TelegramBot.reply(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(replyInChatId, document, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) ) = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection)
// Media Group // Media Group
@ -651,10 +691,11 @@ suspend inline fun TelegramBot.replyWithMediaGroup(
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendMediaGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithPlaylist( suspend inline fun TelegramBot.replyWithPlaylist(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -662,10 +703,11 @@ suspend inline fun TelegramBot.replyWithPlaylist(
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendPlaylist(replyInChatId, media, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendPlaylist(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithDocuments( suspend inline fun TelegramBot.replyWithDocuments(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -673,10 +715,11 @@ suspend inline fun TelegramBot.replyWithDocuments(
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendDocumentsGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendDocumentsGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply))
suspend inline fun TelegramBot.replyWithGallery( suspend inline fun TelegramBot.replyWithGallery(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -684,10 +727,11 @@ suspend inline fun TelegramBot.replyWithGallery(
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) ) = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply))
// Photo // Photo
@ -701,11 +745,12 @@ suspend inline fun TelegramBot.replyWithPhoto(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, fileId, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, fileId, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -716,11 +761,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photo, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photo, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -731,11 +777,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photoSize, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photoSize, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithPhoto( suspend inline fun TelegramBot.replyWithPhoto(
@ -746,11 +793,12 @@ suspend inline fun TelegramBot.replyWithPhoto(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, fileId, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, fileId, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -760,11 +808,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photo, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photo, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -774,11 +823,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(replyInChatId, photoSize, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendPhoto(replyInChatId, photoSize, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Sticker // Sticker
@ -789,12 +839,13 @@ suspend inline fun TelegramBot.replyWithSticker(
sticker: InputFile, sticker: InputFile,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(replyInChatId, sticker, replyInThreadId, emoji, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -802,12 +853,13 @@ suspend inline fun TelegramBot.reply(
sticker: Sticker, sticker: Sticker,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(replyInChatId, sticker, replyInThreadId, emoji, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Videos // Videos
@ -825,11 +877,12 @@ suspend inline fun TelegramBot.replyWithVideo(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, thumb, text, parseMode, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, thumb, text, parseMode, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -840,11 +893,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, text, parseMode, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, text, parseMode, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithVideo( suspend inline fun TelegramBot.replyWithVideo(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -858,11 +912,12 @@ suspend inline fun TelegramBot.replyWithVideo(
height: Int? = null, height: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, thumb, entities, spoilered, duration, width, height, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, thumb, entities, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -872,11 +927,12 @@ suspend inline fun TelegramBot.reply(
spoilered: Boolean = false, spoilered: Boolean = false,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(replyInChatId, video, entities, spoilered, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideo(replyInChatId, video, entities, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// VideoNotes // VideoNotes
@ -890,11 +946,12 @@ suspend inline fun TelegramBot.replyWithVideoNote(
size: Int? = null, size: Int? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -902,11 +959,12 @@ suspend inline fun TelegramBot.reply(
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(replyInChatId, videoNote, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVideoNote(replyInChatId, videoNote, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Voice // Voice
@ -920,11 +978,12 @@ suspend inline fun TelegramBot.replyWithVoice(
duration: Long? = null, duration: Long? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -934,11 +993,12 @@ suspend inline fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.replyWithVoice( suspend inline fun TelegramBot.replyWithVoice(
@ -949,11 +1009,12 @@ suspend inline fun TelegramBot.replyWithVoice(
duration: Long? = null, duration: Long? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -962,11 +1023,12 @@ suspend inline fun TelegramBot.reply(
entities: TextSourcesList, entities: TextSourcesList,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(replyInChatId, voice, entities, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
// Invoice // Invoice
@ -1017,11 +1079,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(replyInChatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendRegularPoll(replyInChatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -1035,11 +1098,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(replyInChatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendRegularPoll(replyInChatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -1054,11 +1118,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -1074,11 +1139,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -1092,11 +1158,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendQuizPoll(replyInChatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
toChatId: IdChatIdentifier, toChatId: IdChatIdentifier,
@ -1111,11 +1178,12 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, replyInThreadId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) ) = sendQuizPoll(replyInChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup)
suspend inline fun TelegramBot.reply( suspend inline fun TelegramBot.reply(
@ -1129,6 +1197,7 @@ suspend inline fun TelegramBot.reply(
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1146,6 +1215,7 @@ suspend inline fun TelegramBot.reply(
closeInfo = closeInfo, closeInfo = closeInfo,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1164,6 +1234,7 @@ suspend inline fun TelegramBot.reply(
closeInfo = closeInfo, closeInfo = closeInfo,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1233,6 +1304,7 @@ suspend fun TelegramBot.reply(
content: MessageContent, content: MessageContent,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1242,6 +1314,7 @@ suspend fun TelegramBot.reply(
content.createResend( content.createResend(
replyInChatId, replyInChatId,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
@ -1262,6 +1335,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1270,6 +1344,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply) ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)
@ -1289,6 +1364,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1298,6 +1374,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply) ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)
@ -1318,6 +1395,7 @@ suspend fun TelegramBot.reply(
liveTimeMillis: Long = defaultLivePeriodDelayMillis, liveTimeMillis: Long = defaultLivePeriodDelayMillis,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
@ -1327,6 +1405,7 @@ suspend fun TelegramBot.reply(
locationsFlow, locationsFlow,
liveTimeMillis, liveTimeMillis,
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply) ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)
@ -1339,6 +1418,7 @@ suspend fun TelegramBot.reply(
mediaFile: TelegramMediaFile, mediaFile: TelegramMediaFile,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1351,6 +1431,7 @@ suspend fun TelegramBot.reply(
audio = mediaFile, audio = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1362,6 +1443,7 @@ suspend fun TelegramBot.reply(
animation = mediaFile, animation = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1373,6 +1455,7 @@ suspend fun TelegramBot.reply(
voice = mediaFile, voice = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1384,6 +1467,7 @@ suspend fun TelegramBot.reply(
video = mediaFile, video = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1395,6 +1479,7 @@ suspend fun TelegramBot.reply(
videoNote = mediaFile, videoNote = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1406,6 +1491,7 @@ suspend fun TelegramBot.reply(
document = mediaFile, document = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1417,6 +1503,7 @@ suspend fun TelegramBot.reply(
sticker = mediaFile, sticker = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1428,6 +1515,7 @@ suspend fun TelegramBot.reply(
photoSize = mediaFile, photoSize = mediaFile,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1439,6 +1527,7 @@ suspend fun TelegramBot.reply(
document = mediaFile.asDocumentFile(), document = mediaFile.asDocumentFile(),
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1455,6 +1544,7 @@ suspend fun TelegramBot.reply(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1469,6 +1559,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1482,6 +1573,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1495,6 +1587,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1508,6 +1601,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1521,6 +1615,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1534,6 +1629,7 @@ suspend fun TelegramBot.reply(
parseMode = parseMode, parseMode = parseMode,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1549,6 +1645,7 @@ suspend fun TelegramBot.reply(
entities: List<TextSource>, entities: List<TextSource>,
replyInChatId: IdChatIdentifier = toChatId, replyInChatId: IdChatIdentifier = toChatId,
replyInThreadId: MessageThreadId? = replyInChatId.threadId, replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
@ -1562,6 +1659,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1574,6 +1672,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1586,6 +1685,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1598,6 +1698,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1610,6 +1711,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,
@ -1622,6 +1724,7 @@ suspend fun TelegramBot.reply(
entities = entities, entities = entities,
replyInChatId = replyInChatId, replyInChatId = replyInChatId,
replyInThreadId = replyInThreadId, replyInThreadId = replyInThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
allowSendingWithoutReply = allowSendingWithoutReply, allowSendingWithoutReply = allowSendingWithoutReply,

View File

@ -5,127 +5,152 @@ import dev.inmo.tgbotapi.requests.send.SendAction
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.actions.* import dev.inmo.tgbotapi.types.actions.*
import dev.inmo.tgbotapi.types.businessConnectionId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.threadId import dev.inmo.tgbotapi.types.threadId
suspend fun TelegramBot.sendBotAction( suspend fun TelegramBot.sendBotAction(
chatId: ChatIdentifier, chatId: ChatIdentifier,
action: BotAction, action: BotAction,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = execute( ) = execute(
SendAction(chatId, action, threadId) SendAction(chatId, action, threadId, businessConnectionId)
) )
suspend fun TelegramBot.sendBotAction( suspend fun TelegramBot.sendBotAction(
chat: Chat, chat: Chat,
action: BotAction, action: BotAction,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat.id, action, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat.id, action, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionTyping( suspend fun TelegramBot.sendActionTyping(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, TypingAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, TypingAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadPhoto( suspend fun TelegramBot.sendActionUploadPhoto(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, UploadPhotoAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, UploadPhotoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVideo( suspend fun TelegramBot.sendActionRecordVideo(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, RecordVideoAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, RecordVideoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVideo( suspend fun TelegramBot.sendActionUploadVideo(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, UploadVideoAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, UploadVideoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVoice( suspend fun TelegramBot.sendActionRecordVoice(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, RecordVoiceAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, RecordVoiceAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVoice( suspend fun TelegramBot.sendActionUploadVoice(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, UploadVoiceAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, UploadVoiceAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadDocument( suspend fun TelegramBot.sendActionUploadDocument(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, UploadDocumentAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, UploadDocumentAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionFindLocation( suspend fun TelegramBot.sendActionFindLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, FindLocationAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, FindLocationAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVideoNote( suspend fun TelegramBot.sendActionRecordVideoNote(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, RecordVideoNoteAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVideoNote( suspend fun TelegramBot.sendActionUploadVideoNote(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId threadId: MessageThreadId? = chatId.threadId,
) = sendBotAction(chatId, UploadVideoNoteAction, threadId) businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
) = sendBotAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionTyping( suspend fun TelegramBot.sendActionTyping(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, TypingAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, TypingAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadPhoto( suspend fun TelegramBot.sendActionUploadPhoto(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, UploadPhotoAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, UploadPhotoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVideo( suspend fun TelegramBot.sendActionRecordVideo(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, RecordVideoAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, RecordVideoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVideo( suspend fun TelegramBot.sendActionUploadVideo(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, UploadVideoAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, UploadVideoAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVoice( suspend fun TelegramBot.sendActionRecordVoice(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, RecordVoiceAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, RecordVoiceAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVoice( suspend fun TelegramBot.sendActionUploadVoice(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, UploadVoiceAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, UploadVoiceAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadDocument( suspend fun TelegramBot.sendActionUploadDocument(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, UploadDocumentAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, UploadDocumentAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionFindLocation( suspend fun TelegramBot.sendActionFindLocation(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, FindLocationAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, FindLocationAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionRecordVideoNote( suspend fun TelegramBot.sendActionRecordVideoNote(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, RecordVideoNoteAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, RecordVideoNoteAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionUploadVideoNote( suspend fun TelegramBot.sendActionUploadVideoNote(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, UploadVideoNoteAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, UploadVideoNoteAction, threadId, businessConnectionId)
suspend fun TelegramBot.sendActionChooseStickerAction( suspend fun TelegramBot.sendActionChooseStickerAction(
chat: Chat, chat: Chat,
threadId: MessageThreadId? = chat.id.threadId threadId: MessageThreadId? = chat.id.threadId,
) = sendBotAction(chat, ChooseStickerAction, threadId) businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
) = sendBotAction(chat, ChooseStickerAction, threadId, businessConnectionId)

View File

@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendAction import dev.inmo.tgbotapi.requests.send.SendAction
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.actions.* import dev.inmo.tgbotapi.types.actions.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlin.contracts.* import kotlin.contracts.*
@ -39,13 +40,14 @@ suspend fun <T> TelegramBot.withAction(
chatId: IdChatIdentifier, chatId: IdChatIdentifier,
action: BotAction, action: BotAction,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
block: TelegramBotActionCallback<T> block: TelegramBotActionCallback<T>
): T { ): T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction( return withAction(
SendAction(chatId, action, threadId), SendAction(chatId, action, threadId, businessConnectionId),
block block
) )
} }
@ -55,6 +57,7 @@ suspend fun <T> TelegramBot.withAction(
chat: Chat, chat: Chat,
action: BotAction, action: BotAction,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
block: TelegramBotActionCallback<T> block: TelegramBotActionCallback<T>
): T { ): T {
contract { contract {
@ -64,163 +67,164 @@ suspend fun <T> TelegramBot.withAction(
chat.id, chat.id,
action, action,
threadId, threadId,
businessConnectionId,
block block
) )
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, TypingAction, threadId, block) return withAction(chatId, TypingAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, UploadPhotoAction, threadId, block) return withAction(chatId, UploadPhotoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, RecordVideoAction, threadId, block) return withAction(chatId, RecordVideoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, UploadVideoAction, threadId, block) return withAction(chatId, UploadVideoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, RecordVoiceAction, threadId, block) return withAction(chatId, RecordVoiceAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, UploadVoiceAction, threadId, block) return withAction(chatId, UploadVoiceAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, UploadDocumentAction, threadId, block) return withAction(chatId, UploadDocumentAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, FindLocationAction, threadId, block) return withAction(chatId, FindLocationAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, RecordVideoNoteAction, threadId, block) return withAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, UploadVideoNoteAction, threadId, block) return withAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chatId, ChooseStickerAction, threadId, block) return withAction(chatId, ChooseStickerAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, TypingAction, threadId, block) return withAction(chat, TypingAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, UploadPhotoAction, threadId, block) return withAction(chat, UploadPhotoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, RecordVideoAction, threadId, block) return withAction(chat, RecordVideoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, UploadVideoAction, threadId, block) return withAction(chat, UploadVideoAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, RecordVoiceAction, threadId, block) return withAction(chat, RecordVoiceAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, UploadVoiceAction, threadId, block) return withAction(chat, UploadVoiceAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, UploadDocumentAction, threadId, block) return withAction(chat, UploadDocumentAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, FindLocationAction, threadId, block) return withAction(chat, FindLocationAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, RecordVideoNoteAction, threadId, block) return withAction(chat, RecordVideoNoteAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, UploadVideoNoteAction, threadId, block) return withAction(chat, UploadVideoNoteAction, threadId, businessConnectionId, block)
} }
@OptIn(ExperimentalContracts::class) @OptIn(ExperimentalContracts::class)
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T { suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
contract { contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE) callsInPlace(block, InvocationKind.EXACTLY_ONCE)
} }
return withAction(chat, ChooseStickerAction, threadId, block) return withAction(chat, ChooseStickerAction, threadId, businessConnectionId, block)
} }

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendContact import dev.inmo.tgbotapi.requests.send.SendContact
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
@ -16,13 +17,14 @@ suspend fun TelegramBot.sendContact(
firstName: String, firstName: String,
lastName: String? = null, lastName: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendContact( SendContact(
chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
@ -34,13 +36,14 @@ suspend fun TelegramBot.sendContact(
chatId: ChatIdentifier, chatId: ChatIdentifier,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendContact( SendContact(
chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
@ -54,12 +57,13 @@ suspend fun TelegramBot.sendContact(
firstName: String, firstName: String,
lastName: String? = null, lastName: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendContact( ) = sendContact(
chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -70,10 +74,11 @@ suspend fun TelegramBot.sendContact(
chat: Chat, chat: Chat,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendContact( ) = sendContact(
chat.id, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendDice import dev.inmo.tgbotapi.requests.send.SendDice
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.dice.DiceAnimationType
@ -15,12 +16,13 @@ suspend fun TelegramBot.sendDice(
chatId: ChatIdentifier, chatId: ChatIdentifier,
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
) )
/** /**
@ -31,8 +33,9 @@ suspend fun TelegramBot.sendDice(
chat: Chat, chat: Chat,
animationType: DiceAnimationType? = null, animationType: DiceAnimationType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendLiveLocation import dev.inmo.tgbotapi.requests.send.SendLiveLocation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
@ -20,6 +21,7 @@ suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -34,6 +36,7 @@ suspend fun TelegramBot.sendLocation(
heading, heading,
proximityAlertRadius, proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -53,6 +56,7 @@ suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -66,6 +70,7 @@ suspend fun TelegramBot.sendLocation(
heading, heading,
proximityAlertRadius, proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -85,6 +90,7 @@ suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -98,6 +104,7 @@ suspend fun TelegramBot.sendLocation(
heading, heading,
proximityAlertRadius, proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -116,6 +123,7 @@ suspend fun TelegramBot.sendLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -129,6 +137,7 @@ suspend fun TelegramBot.sendLocation(
heading, heading,
proximityAlertRadius, proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -148,11 +157,12 @@ suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -166,11 +176,12 @@ suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -185,11 +196,12 @@ suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -203,8 +215,9 @@ suspend fun TelegramBot.sendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendTextMessage import dev.inmo.tgbotapi.requests.send.SendTextMessage
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -21,6 +22,7 @@ suspend fun TelegramBot.sendMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -32,6 +34,7 @@ suspend fun TelegramBot.sendMessage(
parseMode, parseMode,
linkPreviewOptions, linkPreviewOptions,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -49,12 +52,13 @@ suspend fun TelegramBot.sendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage( ) = sendMessage(
chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -67,11 +71,12 @@ suspend fun TelegramBot.sendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -84,11 +89,12 @@ suspend fun TelegramBot.sendMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -99,12 +105,13 @@ suspend fun TelegramBot.sendMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
) )
/** /**
@ -116,12 +123,13 @@ suspend fun TelegramBot.sendMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -133,12 +141,13 @@ suspend fun TelegramBot.sendMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -149,12 +158,13 @@ suspend fun TelegramBot.sendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage( ) = sendMessage(
chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -166,12 +176,13 @@ suspend fun TelegramBot.sendTextMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -183,12 +194,13 @@ suspend fun TelegramBot.sendTextMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -199,11 +211,12 @@ suspend fun TelegramBot.sendMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -214,12 +227,13 @@ suspend fun TelegramBot.sendMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -231,12 +245,13 @@ suspend fun TelegramBot.sendMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -248,11 +263,12 @@ suspend fun TelegramBot.sendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -263,12 +279,13 @@ suspend fun TelegramBot.sendTextMessage(
separator: TextSource? = null, separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -280,9 +297,10 @@ suspend fun TelegramBot.sendTextMessage(
separator: String, separator: String,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builderBody: EntitiesBuilderBody builderBody: EntitiesBuilderBody
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendStaticLocation import dev.inmo.tgbotapi.requests.send.SendStaticLocation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.Location
@ -16,6 +17,7 @@ suspend fun TelegramBot.sendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -26,6 +28,7 @@ suspend fun TelegramBot.sendLocation(
latitude, latitude,
longitude, longitude,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -41,6 +44,7 @@ suspend fun TelegramBot.sendLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
location: Location, location: Location,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -50,6 +54,7 @@ suspend fun TelegramBot.sendLocation(
location.latitude, location.latitude,
location.longitude, location.longitude,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -65,6 +70,7 @@ suspend fun TelegramBot.sendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -74,6 +80,7 @@ suspend fun TelegramBot.sendLocation(
latitude, latitude,
longitude, longitude,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -88,6 +95,7 @@ suspend fun TelegramBot.sendLocation(
chat: Chat, chat: Chat,
location: Location, location: Location,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -97,6 +105,7 @@ suspend fun TelegramBot.sendLocation(
location.latitude, location.latitude,
location.longitude, location.longitude,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -112,11 +121,12 @@ suspend fun TelegramBot.sendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -126,11 +136,12 @@ suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
location: Location, location: Location,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -141,11 +152,12 @@ suspend fun TelegramBot.sendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -155,8 +167,9 @@ suspend fun TelegramBot.sendStaticLocation(
chat: Chat, chat: Chat,
location: Location, location: Location,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendVenue import dev.inmo.tgbotapi.requests.send.SendVenue
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.StaticLocation import dev.inmo.tgbotapi.types.location.StaticLocation
@ -23,6 +24,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -39,6 +41,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -61,6 +64,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -76,6 +80,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -96,6 +101,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -111,6 +117,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -131,6 +138,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId: GooglePlaceId? = null, googlePlaceId: GooglePlaceId? = null,
googlePlaceType: GooglePlaceType? = null, googlePlaceType: GooglePlaceType? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -146,6 +154,7 @@ suspend fun TelegramBot.sendVenue(
googlePlaceId = googlePlaceId, googlePlaceId = googlePlaceId,
googlePlaceType = googlePlaceType, googlePlaceType = googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -160,6 +169,7 @@ suspend fun TelegramBot.sendVenue(
chatId: ChatIdentifier, chatId: ChatIdentifier,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -169,6 +179,7 @@ suspend fun TelegramBot.sendVenue(
chatId = chatId, chatId = chatId,
venue = venue, venue = venue,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -184,6 +195,7 @@ suspend fun TelegramBot.sendVenue(
chat: Chat, chat: Chat,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -192,6 +204,7 @@ suspend fun TelegramBot.sendVenue(
chatId = chat.id, chatId = chat.id,
venue = venue, venue = venue,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
replyParameters = replyParameters, replyParameters = replyParameters,

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send.games
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.games.SendGame import dev.inmo.tgbotapi.requests.send.games.SendGame
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.games.Game
@ -15,13 +16,14 @@ suspend fun TelegramBot.sendGame(
chatId: ChatIdentifier, chatId: ChatIdentifier,
gameShortName: String, gameShortName: String,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendGame( SendGame(
chatId, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
@ -33,12 +35,13 @@ suspend fun TelegramBot.sendGame(
chat: Chat, chat: Chat,
gameShortName: String, gameShortName: String,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chat.id, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -49,12 +52,13 @@ suspend fun TelegramBot.sendGame(
chatId: ChatIdentifier, chatId: ChatIdentifier,
game: Game, game: Game,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chatId, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -65,10 +69,11 @@ suspend fun TelegramBot.sendGame(
chat: Chat, chat: Chat,
game: Game, game: Game,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendGame( ) = sendGame(
chat.id, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendAnimation import dev.inmo.tgbotapi.requests.send.media.SendAnimation
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -25,6 +26,7 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -41,6 +43,7 @@ suspend fun TelegramBot.sendAnimation(
width, width,
height, height,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -62,12 +65,13 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation( ) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -85,11 +89,12 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -105,11 +110,12 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -126,6 +132,7 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -141,6 +148,7 @@ suspend fun TelegramBot.sendAnimation(
width, width,
height, height,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -161,12 +169,13 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation( ) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -183,11 +192,12 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -202,8 +212,9 @@ suspend fun TelegramBot.sendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendAudio import dev.inmo.tgbotapi.requests.send.media.SendAudio
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -24,6 +25,7 @@ suspend fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -39,6 +41,7 @@ suspend fun TelegramBot.sendAudio(
performer, performer,
title, title,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -60,11 +63,12 @@ suspend fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -77,11 +81,12 @@ suspend fun TelegramBot.sendAudio(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -94,11 +99,12 @@ suspend fun TelegramBot.sendAudio(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -114,6 +120,7 @@ suspend inline fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -128,6 +135,7 @@ suspend inline fun TelegramBot.sendAudio(
performer, performer,
title, title,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -148,11 +156,12 @@ suspend inline fun TelegramBot.sendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -164,11 +173,12 @@ suspend inline fun TelegramBot.sendAudio(
entities: TextSourcesList, entities: TextSourcesList,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -180,8 +190,9 @@ suspend inline fun TelegramBot.sendAudio(
entities: TextSourcesList, entities: TextSourcesList,
title: String? = audio.title, title: String? = audio.title,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendDocument import dev.inmo.tgbotapi.requests.send.media.SendDocument
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -21,6 +22,7 @@ suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -34,6 +36,7 @@ suspend fun TelegramBot.sendDocument(
text, text,
parseMode, parseMode,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -53,12 +56,13 @@ suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -70,13 +74,14 @@ suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument( ) = sendDocument(
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
) )
/** /**
@ -89,12 +94,13 @@ suspend fun TelegramBot.sendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -106,6 +112,7 @@ suspend inline fun TelegramBot.sendDocument(
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -118,6 +125,7 @@ suspend inline fun TelegramBot.sendDocument(
thumb, thumb,
entities, entities,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -136,12 +144,13 @@ suspend inline fun TelegramBot.sendDocument(
thumb: InputFile? = null, thumb: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -152,13 +161,14 @@ suspend inline fun TelegramBot.sendDocument(
document: DocumentFile, document: DocumentFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument( ) = sendDocument(
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
) )
/** /**
@ -170,9 +180,10 @@ suspend inline fun TelegramBot.sendDocument(
document: DocumentFile, document: DocumentFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) ) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send.media
import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.media.* import dev.inmo.tgbotapi.requests.send.media.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
@ -20,12 +21,13 @@ suspend fun TelegramBot.sendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendMediaGroup<MediaGroupPartContent>( SendMediaGroup<MediaGroupPartContent>(
chatId, media, threadId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
) )
@ -37,11 +39,12 @@ suspend fun TelegramBot.sendMediaGroup(
chat: Chat, chat: Chat,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -53,11 +56,12 @@ suspend fun TelegramBot.sendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupPartContent>, media: List<MediaGroupPartContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -69,11 +73,12 @@ suspend fun TelegramBot.sendMediaGroup(
chat: Chat, chat: Chat,
media: List<MediaGroupPartContent>, media: List<MediaGroupPartContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendMediaGroup( ) = sendMediaGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -83,12 +88,13 @@ suspend fun TelegramBot.sendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendPlaylist( SendPlaylist(
chatId, media, threadId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
) )
@ -99,11 +105,12 @@ suspend fun TelegramBot.sendPlaylist(
chat: Chat, chat: Chat,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -114,11 +121,12 @@ suspend fun TelegramBot.sendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioContent>, media: List<AudioContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -129,11 +137,12 @@ suspend fun TelegramBot.sendPlaylist(
chat: Chat, chat: Chat,
media: List<AudioContent>, media: List<AudioContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendPlaylist( ) = sendPlaylist(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -143,12 +152,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendDocumentsGroup( SendDocumentsGroup(
chatId, media, threadId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
) )
@ -159,11 +169,12 @@ suspend fun TelegramBot.sendDocumentsGroup(
chat: Chat, chat: Chat,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -174,11 +185,12 @@ suspend fun TelegramBot.sendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentContent>, media: List<DocumentContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -189,11 +201,12 @@ suspend fun TelegramBot.sendDocumentsGroup(
chat: Chat, chat: Chat,
media: List<DocumentContent>, media: List<DocumentContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendDocumentsGroup( ) = sendDocumentsGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -203,12 +216,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = execute( ) = execute(
SendVisualMediaGroup( SendVisualMediaGroup(
chatId, media, threadId, disableNotification, protectContent, replyParameters chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
) )
@ -219,11 +233,12 @@ suspend fun TelegramBot.sendVisualMediaGroup(
chat: Chat, chat: Chat,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -234,11 +249,12 @@ suspend fun TelegramBot.sendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupPartContent>, media: List<VisualMediaGroupPartContent>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )
/** /**
@ -249,9 +265,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
chat: Chat, chat: Chat,
media: List<VisualMediaGroupPartContent>, media: List<VisualMediaGroupPartContent>,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null replyParameters: ReplyParameters? = null
) = sendVisualMediaGroup( ) = sendVisualMediaGroup(
chat.id, media, threadId, disableNotification, protectContent, replyParameters chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
) )

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendPhoto import dev.inmo.tgbotapi.requests.send.media.SendPhoto
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -21,6 +22,7 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -33,6 +35,7 @@ suspend fun TelegramBot.sendPhoto(
parseMode, parseMode,
spoilered, spoilered,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -51,11 +54,12 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -68,11 +72,12 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -85,11 +90,12 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -102,11 +108,12 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -119,11 +126,12 @@ suspend fun TelegramBot.sendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -136,6 +144,7 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -147,6 +156,7 @@ suspend inline fun TelegramBot.sendPhoto(
entities, entities,
spoilered, spoilered,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -164,11 +174,12 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -180,11 +191,12 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -196,11 +208,12 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, photo, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -212,11 +225,12 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -228,8 +242,9 @@ suspend inline fun TelegramBot.sendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendSticker import dev.inmo.tgbotapi.requests.send.media.SendSticker
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.files.Sticker
@ -16,13 +17,14 @@ suspend fun TelegramBot.sendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
) )
/** /**
@ -33,12 +35,13 @@ suspend fun TelegramBot.sendSticker(
chat: Chat, chat: Chat,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -48,12 +51,13 @@ suspend fun TelegramBot.sendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: Sticker, sticker: Sticker,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -63,9 +67,10 @@ suspend fun TelegramBot.sendSticker(
chat: Chat, chat: Chat,
sticker: Sticker, sticker: Sticker,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendVideo import dev.inmo.tgbotapi.requests.send.media.SendVideo
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -25,6 +26,7 @@ suspend fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -42,6 +44,7 @@ suspend fun TelegramBot.sendVideo(
height, height,
null, null,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -60,11 +63,12 @@ suspend fun TelegramBot.sendVideo(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -81,11 +85,12 @@ suspend fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -99,11 +104,12 @@ suspend fun TelegramBot.sendVideo(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -119,6 +125,7 @@ suspend inline fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -135,6 +142,7 @@ suspend inline fun TelegramBot.sendVideo(
height, height,
null, null,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -152,11 +160,12 @@ suspend inline fun TelegramBot.sendVideo(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -172,11 +181,12 @@ suspend inline fun TelegramBot.sendVideo(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -189,8 +199,9 @@ suspend inline fun TelegramBot.sendVideo(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideo(chat.id, video, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.files.VideoNoteFile import dev.inmo.tgbotapi.types.files.VideoNoteFile
@ -19,6 +20,7 @@ suspend fun TelegramBot.sendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, size: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -31,6 +33,7 @@ suspend fun TelegramBot.sendVideoNote(
duration, duration,
size, size,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -46,12 +49,13 @@ suspend fun TelegramBot.sendVideoNote(
chatId: ChatIdentifier, chatId: ChatIdentifier,
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote( ) = sendVideoNote(
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -65,11 +69,12 @@ suspend fun TelegramBot.sendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, size: Int? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -79,8 +84,9 @@ suspend fun TelegramBot.sendVideoNote(
chat: Chat, chat: Chat,
videoNote: VideoNoteFile, videoNote: VideoNoteFile,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendVoice import dev.inmo.tgbotapi.requests.send.media.SendVoice
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -21,6 +22,7 @@ suspend fun TelegramBot.sendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -33,6 +35,7 @@ suspend fun TelegramBot.sendVoice(
parseMode, parseMode,
duration, duration,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -51,11 +54,12 @@ suspend fun TelegramBot.sendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -67,12 +71,13 @@ suspend fun TelegramBot.sendVoice(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice( ) = sendVoice(
chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -85,11 +90,12 @@ suspend fun TelegramBot.sendVoice(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
@ -102,6 +108,7 @@ suspend inline fun TelegramBot.sendVoice(
entities: TextSourcesList, entities: TextSourcesList,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -112,6 +119,7 @@ suspend inline fun TelegramBot.sendVoice(
voice = voice, voice = voice,
entities = entities, entities = entities,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
duration = duration, duration = duration,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
@ -130,11 +138,12 @@ suspend inline fun TelegramBot.sendVoice(
entities: TextSourcesList, entities: TextSourcesList,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, entities, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -145,12 +154,13 @@ suspend inline fun TelegramBot.sendVoice(
voice: VoiceFile, voice: VoiceFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice( ) = sendVoice(
chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -161,8 +171,9 @@ suspend inline fun TelegramBot.sendVoice(
voice: VoiceFile, voice: VoiceFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -23,13 +24,14 @@ suspend fun TelegramBot.sendRegularPoll(
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendRegularPoll( SendRegularPoll(
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
/** /**
@ -46,11 +48,12 @@ suspend fun TelegramBot.sendRegularPoll(
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
/** /**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -65,12 +68,13 @@ suspend fun TelegramBot.sendRegularPoll(
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll( ) = sendRegularPoll(
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -87,12 +91,13 @@ suspend fun TelegramBot.sendRegularPoll(
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendRegularPoll( ) = sendRegularPoll(
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
@ -111,13 +116,14 @@ suspend fun TelegramBot.sendQuizPoll(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendQuizPoll( SendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
@ -136,12 +142,13 @@ suspend fun TelegramBot.sendQuizPoll(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -160,12 +167,13 @@ suspend fun TelegramBot.sendQuizPoll(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -184,12 +192,13 @@ suspend fun TelegramBot.sendQuizPoll(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
@ -207,13 +216,14 @@ suspend inline fun TelegramBot.sendQuizPoll(
entities: TextSourcesList, entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = execute( ) = execute(
SendQuizPoll( SendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
) )
@ -231,12 +241,13 @@ suspend inline fun TelegramBot.sendQuizPoll(
entities: TextSourcesList, entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -254,12 +265,13 @@ suspend inline fun TelegramBot.sendQuizPoll(
entities: TextSourcesList, entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )
/** /**
@ -277,10 +289,11 @@ suspend inline fun TelegramBot.sendQuizPoll(
entities: TextSourcesList, entities: TextSourcesList,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chat.id.threadId, threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = sendQuizPoll( ) = sendQuizPoll(
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
) )

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
import dev.inmo.tgbotapi.requests.stickers.InputSticker import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.StickerFormat
import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.StickerSetName
import dev.inmo.tgbotapi.types.StickerType import dev.inmo.tgbotapi.types.StickerType
import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.CommonUser
@ -39,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
userId: UserId, userId: UserId,
stickerSet: StickerSet, stickerSet: StickerSet,
sticker: InputFile, sticker: InputFile,
format: StickerFormat,
emojis: List<String>, emojis: List<String>,
keywords: List<String> = emptyList() keywords: List<String> = emptyList()
) = addStickerToSet( ) = addStickerToSet(
@ -47,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
when (stickerSet.stickerType) { when (stickerSet.stickerType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji( StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
sticker, sticker,
format,
emojis, emojis,
keywords keywords
) )
StickerType.Mask -> InputSticker.Mask( StickerType.Mask -> InputSticker.Mask(
sticker, sticker,
format,
emojis emojis
) )
StickerType.Regular -> InputSticker.WithKeywords.Regular( StickerType.Regular -> InputSticker.WithKeywords.Regular(
sticker, sticker,
format,
emojis, emojis,
keywords keywords
) )
@ -67,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
userId: UserId, userId: UserId,
stickerSet: StickerSet, stickerSet: StickerSet,
sticker: InputFile, sticker: InputFile,
format: StickerFormat,
emojis: List<String>, emojis: List<String>,
maskPosition: MaskPosition? = null maskPosition: MaskPosition? = null
) = addStickerToSet( ) = addStickerToSet(
@ -75,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
when (stickerSet.stickerType) { when (stickerSet.stickerType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji( StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
sticker, sticker,
format,
emojis, emojis,
emptyList() emptyList()
) )
StickerType.Mask -> InputSticker.Mask( StickerType.Mask -> InputSticker.Mask(
sticker, sticker,
format,
emojis, emojis,
maskPosition maskPosition
) )
StickerType.Regular -> InputSticker.WithKeywords.Regular( StickerType.Regular -> InputSticker.WithKeywords.Regular(
sticker, sticker,
format,
emojis, emojis,
emptyList() emptyList()
) )
@ -106,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
user: CommonUser, user: CommonUser,
stickerSet: StickerSet, stickerSet: StickerSet,
sticker: InputFile, sticker: InputFile,
format: StickerFormat,
emojis: List<String>, emojis: List<String>,
keywords: List<String> = emptyList() keywords: List<String> = emptyList()
) = addStickerToSet( ) = addStickerToSet(
user.id, stickerSet, sticker, emojis, keywords user.id, stickerSet, sticker, format, emojis, keywords
) )
suspend fun TelegramBot.addStickerToSet( suspend fun TelegramBot.addStickerToSet(
user: CommonUser, user: CommonUser,
stickerSet: StickerSet, stickerSet: StickerSet,
sticker: InputFile, sticker: InputFile,
format: StickerFormat,
emojis: List<String>, emojis: List<String>,
maskPosition: MaskPosition? = null maskPosition: MaskPosition? = null
) = addStickerToSet( ) = addStickerToSet(
user.id, stickerSet, sticker, emojis, maskPosition user.id, stickerSet, sticker, format, emojis, maskPosition
) )

View File

@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
userId: UserId, userId: UserId,
name: String, name: String,
title: String, title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>, stickers: List<InputSticker>,
needsRepainting: Boolean = false needsRepainting: Boolean = false
) = execute( ) = execute(
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting) CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
) )
@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
user: CommonUser, user: CommonUser,
name: String, name: String,
title: String, title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>, stickers: List<InputSticker>,
needsRepainting: Boolean = false, needsRepainting: Boolean = false,
) = createNewStickerSet( ) = createNewStickerSet(
user.id, name, title, stickersFormat, stickers, needsRepainting user.id, name, title, stickers, needsRepainting
) )

View File

@ -0,0 +1,148 @@
package dev.inmo.tgbotapi.extensions.api.stickers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.requests.stickers.ReplaceStickerInSet
import dev.inmo.tgbotapi.types.StickerFormat
import dev.inmo.tgbotapi.types.StickerSetName
import dev.inmo.tgbotapi.types.StickerType
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.stickers.MaskPosition
import dev.inmo.tgbotapi.types.stickers.StickerSet
suspend fun TelegramBot.replaceStickerInSet(
userId: UserId,
stickerSetName: StickerSetName,
oldSticker: FileId,
newSticker: InputSticker
) = execute(
ReplaceStickerInSet(userId, stickerSetName, oldSticker, newSticker)
)
suspend fun TelegramBot.replaceStickerInSet(
userId: UserId,
stickerSetName: String,
oldSticker: FileId,
newSticker: InputSticker
) = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker)
suspend fun TelegramBot.replaceStickerInSet(
userId: UserId,
stickerSet: StickerSet,
oldSticker: FileId,
newSticker: InputSticker
) = replaceStickerInSet(
userId,
stickerSet.name,
oldSticker,
newSticker
)
suspend fun TelegramBot.replaceStickerInSet(
userId: UserId,
stickerSet: StickerSet,
oldSticker: FileId,
sticker: InputFile,
format: StickerFormat,
emojis: List<String>,
keywords: List<String> = emptyList()
) = replaceStickerInSet(
userId,
stickerSet,
oldSticker,
when (stickerSet.stickerType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
sticker,
format,
emojis,
keywords
)
StickerType.Mask -> InputSticker.Mask(
sticker,
format,
emojis
)
StickerType.Regular -> InputSticker.WithKeywords.Regular(
sticker,
format,
emojis,
keywords
)
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
}
)
suspend fun TelegramBot.replaceStickerInSet(
userId: UserId,
stickerSet: StickerSet,
oldSticker: FileId,
sticker: InputFile,
format: StickerFormat,
emojis: List<String>,
maskPosition: MaskPosition? = null
) = replaceStickerInSet(
userId,
stickerSet.name,
oldSticker,
when (stickerSet.stickerType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
sticker,
format,
emojis,
emptyList()
)
StickerType.Mask -> InputSticker.Mask(
sticker,
format,
emojis,
maskPosition
)
StickerType.Regular -> InputSticker.WithKeywords.Regular(
sticker,
format,
emojis,
emptyList()
)
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
}
)
suspend fun TelegramBot.replaceStickerInSet(
user: CommonUser,
stickerSet: StickerSet,
oldSticker: FileId,
newSticker: InputSticker
) = replaceStickerInSet(
user.id,
stickerSet.name,
oldSticker,
newSticker
)
suspend fun TelegramBot.replaceStickerInSet(
user: CommonUser,
stickerSet: StickerSet,
oldSticker: FileId,
sticker: InputFile,
format: StickerFormat,
emojis: List<String>,
keywords: List<String> = emptyList()
) = replaceStickerInSet(
user.id, stickerSet, oldSticker, sticker, format, emojis, keywords
)
suspend fun TelegramBot.replaceStickerInSet(
user: CommonUser,
stickerSet: StickerSet,
oldSticker: FileId,
sticker: InputFile,
format: StickerFormat,
emojis: List<String>,
maskPosition: MaskPosition? = null
) = replaceStickerInSet(
user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition
)

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
import dev.inmo.tgbotapi.types.StickerFormat
import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.StickerSetName
import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.UserId
@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSetName: StickerSetName, stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: FileId thumbnail: FileId
) = execute( ) = execute(
SetStickerSetThumbnail(userId, stickerSetName, thumbnail) SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSetName: StickerSetName, stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
) = execute( ) = execute(
SetStickerSetThumbnail(userId, stickerSetName, thumbnail) SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser, user: CommonUser,
stickerSetName: StickerSetName, stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: FileId thumbnail: FileId
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
user.id, stickerSetName, thumbnail user.id, stickerSetName, format, thumbnail
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser, user: CommonUser,
stickerSetName: StickerSetName, stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
user.id, stickerSetName, thumbnail user.id, stickerSetName, format, thumbnail
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSet: StickerSet, stickerSet: StickerSet,
format: StickerFormat,
thumbnail: FileId thumbnail: FileId
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
userId, stickerSet.name, thumbnail userId, stickerSet.name, format, thumbnail
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSet: StickerSet, stickerSet: StickerSet,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
userId, stickerSet.name, thumbnail userId, stickerSet.name, format, thumbnail
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser, user: CommonUser,
stickerSet: StickerSet, stickerSet: StickerSet,
format: StickerFormat,
thumbnail: FileId thumbnail: FileId
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
user.id, stickerSet, thumbnail user.id, stickerSet, format, thumbnail
) )
suspend fun TelegramBot.setStickerSetThumbnail( suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser, user: CommonUser,
stickerSet: StickerSet, stickerSet: StickerSet,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
) = setStickerSetThumbnail( ) = setStickerSetThumbnail(
user.id, stickerSet, thumbnail user.id, stickerSet, format, thumbnail
) )

View File

@ -92,6 +92,15 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/B
public static synthetic fun expectOne$default (Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun expectOne$default (Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitBusinessConnectionKt {
public static final fun waitBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitBusinessConnectionDisabled (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitBusinessConnectionDisabled$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun waitBusinessConnectionEnabled (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitBusinessConnectionEnabled$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQueryKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQueryKt {
public static final fun waitDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitDataCallbackQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitDataCallbackQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
@ -323,6 +332,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt {
public static final fun waitDeletedBusinessMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitDeletedBusinessMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentKt {
public static final fun waitEditedAnimation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun waitEditedAnimation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun waitEditedAnimation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun waitEditedAnimation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
@ -722,6 +736,15 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/filters/Messag
public static final fun getMessageFilterForums ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter; public static final fun getMessageFilterForums ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggersKt {
public static final fun onBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onBusinessConnectionDisabled (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onBusinessConnectionDisabled$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun onBusinessConnectionEnabled (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onBusinessConnectionEnabled$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersKt {
public static final fun onDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun onDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onDataCallbackQuery (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@ -933,6 +956,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onDeepLink$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun onDeepLink$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggersKt {
public static final fun onBusinessMessagesDeleted (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onBusinessMessagesDeleted$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggersKt {
public static final fun onEditedAnimation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun onEditedAnimation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun onEditedAnimation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun onEditedAnimation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
@ -1265,6 +1293,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
public static final fun AnyMarkerFactory ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory; public static final fun AnyMarkerFactory ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory;
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun invoke-__cXnbI (Ldev/inmo/tgbotapi/types/business_connection/BusinessMessagesDeleted;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatChatJoinRequestMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatChatJoinRequestMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatChatJoinRequestMarkerFactory; public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatChatJoinRequestMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun invoke (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@ -1337,6 +1371,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
public fun invoke-ErVIubg (Ldev/inmo/tgbotapi/types/polls/Poll;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun invoke-ErVIubg (Ldev/inmo/tgbotapi/types/polls/Poll;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserCallbackQueryMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserCallbackQueryMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserCallbackQueryMarkerFactory; public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserCallbackQueryMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun invoke (Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@ -0,0 +1,41 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.businessConnectionUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.disabledOrNull
import dev.inmo.tgbotapi.extensions.utils.enabledOrNull
import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
import dev.inmo.tgbotapi.types.payments.ShippingQuery
import kotlinx.coroutines.flow.Flow
suspend fun BehaviourContext.waitBusinessConnection(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
): Flow<BusinessConnection> = expectFlow(
initRequest,
errorFactory
) {
(it.businessConnectionUpdateOrNull() ?.data).let(::listOfNotNull)
}
suspend fun BehaviourContext.waitBusinessConnectionEnabled(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
): Flow<BusinessConnection> = expectFlow(
initRequest,
errorFactory
) {
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()).let(::listOfNotNull)
}
suspend fun BehaviourContext.waitBusinessConnectionDisabled(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
): Flow<BusinessConnection> = expectFlow(
initRequest,
errorFactory
) {
(it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()).let(::listOfNotNull)
}

View File

@ -0,0 +1,19 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
import dev.inmo.tgbotapi.types.business_connection.BusinessMessagesDeleted
import dev.inmo.tgbotapi.types.payments.ShippingQuery
import kotlinx.coroutines.flow.Flow
suspend fun BehaviourContext.waitDeletedBusinessMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
): Flow<BusinessMessagesDeleted> = expectFlow(
initRequest,
errorFactory
) {
(it.deletedBusinessMessageUpdateOrNull() ?.data).let(::listOfNotNull)
}

View File

@ -0,0 +1,76 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBusinessConnectionUpdatedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.businessConnectionUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.disabledOrNull
import dev.inmo.tgbotapi.extensions.utils.enabledOrNull
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
import dev.inmo.tgbotapi.types.update.abstracts.Update
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
suspend fun <BC : BehaviourContext> BC.onBusinessConnection(
initialFilter: SimpleFilter<BusinessConnection>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection, Any> = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data) ?.let(::listOfNotNull)
}
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionEnabled(
initialFilter: SimpleFilter<BusinessConnection.Enabled>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Enabled, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection.Enabled, Any> = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Enabled>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()) ?.let(::listOfNotNull)
}
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionDisabled(
initialFilter: SimpleFilter<BusinessConnection.Disabled>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Disabled, Update>? = null,
markerFactory: MarkerFactory<in BusinessConnection.Disabled, Any> = ByUserBusinessConnectionUpdatedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Disabled>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()) ?.let(::listOfNotNull)
}

View File

@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatMemberUpdatedFilterByChat import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatMemberUpdatedFilterByChat
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatMemberUpdatedMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatMemberUpdatedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBusinessConnectionUpdatedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate

View File

@ -0,0 +1,38 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBusinessConnectionUpdatedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.businessConnectionUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.deletedBusinessMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.disabledOrNull
import dev.inmo.tgbotapi.extensions.utils.enabledOrNull
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
import dev.inmo.tgbotapi.types.business_connection.BusinessMessagesDeleted
import dev.inmo.tgbotapi.types.update.abstracts.Update
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
suspend fun <BC : BehaviourContext> BC.onBusinessMessagesDeleted(
initialFilter: SimpleFilter<BusinessMessagesDeleted>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessMessagesDeleted, Update>? = null,
markerFactory: MarkerFactory<in BusinessMessagesDeleted, Any> = ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessMessagesDeleted>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
(it.deletedBusinessMessageUpdateOrNull() ?.data) ?.let(::listOfNotNull)
}

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilte
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.baseEditMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.editMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.editMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.extensions.utils.withContent
import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile
@ -19,10 +20,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
markerFactory: MarkerFactory<in CommonMessage<T>, Any> = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in CommonMessage<T>, Any> = ByChatMessageMarkerFactory,
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>> noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<T>>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
when (it) { it.baseEditMessageUpdateOrNull() ?.data ?.withContent<T>() ?.let(::listOfNotNull)
is BaseEditMessageUpdate -> (it.data.withContent<T>())
else -> null
} ?.let(::listOfNotNull)
} }

View File

@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
import dev.inmo.tgbotapi.types.business_connection.BusinessMessagesDeleted
object ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory : MarkerFactory<BusinessMessagesDeleted, Any> {
override suspend fun invoke(data: BusinessMessagesDeleted) = data.businessConnectionId
}

View File

@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
import dev.inmo.tgbotapi.types.boosts.ChatBoostUpdated
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
object ByUserBusinessConnectionUpdatedMarkerFactory : MarkerFactory<BusinessConnection, Any> {
override suspend fun invoke(data: BusinessConnection) = data.user
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
interface OptionallyBusinessConnectionRequest {
val businessConnectionId: BusinessConnectionId?
}

View File

@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
interface WithBusinessConnectionId : WithOptionalBusinessConnectionId {
override val businessConnectionId: BusinessConnectionId
}

View File

@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
interface WithOptionalBusinessConnectionId {
val businessConnectionId: BusinessConnectionId?
}

View File

@ -102,7 +102,7 @@ class DefaultKtorRequestsExecutor internal constructor(
is BotException -> e is BotException -> e
else -> CommonBotException(cause = e) else -> CommonBotException(cause = e)
}.also { newException -> }.also { newException ->
logger.v(newException) { "Result exception on handling of $request is an exception" } logger.v(newException) { "Result exception on handling of $request is an exception: ${newException.stackTraceToString()}" }
if (newException is GetUpdatesConflict) { if (newException is GetUpdatesConflict) {
logger.w(newException) { logger.w(newException) {
"Warning!!! Other bot with the same bot token requests updates with getUpdate in parallel" "Warning!!! Other bot with the same bot token requests updates with getUpdate in parallel"

View File

@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.chat.get
import dev.inmo.tgbotapi.abstracts.types.ChatRequest import dev.inmo.tgbotapi.abstracts.types.ChatRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.BusinessChatId
import dev.inmo.tgbotapi.types.ChatIdWithThreadId import dev.inmo.tgbotapi.types.ChatIdWithThreadId
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.ExtendedChatSerializer import dev.inmo.tgbotapi.types.chat.ExtendedChatSerializer
@ -16,10 +17,10 @@ data class GetChat(
): ChatRequest, SimpleRequest<ExtendedChat> { ): ChatRequest, SimpleRequest<ExtendedChat> {
override fun method(): String = "getChat" override fun method(): String = "getChat"
@Transient @Transient
override val resultDeserializer: DeserializationStrategy<ExtendedChat> = if (chatId is ChatIdWithThreadId) { override val resultDeserializer: DeserializationStrategy<ExtendedChat> = when {
ExtendedChatSerializer.BasedOnForumThread(chatId.threadId) chatId is ChatIdWithThreadId -> ExtendedChatSerializer.BasedOnForumThread(chatId.threadId)
} else { chatId is BusinessChatId -> ExtendedChatSerializer.BasedOnBusinessConnection(chatId.businessConnectionId)
ExtendedChatSerializer.Companion else -> ExtendedChatSerializer.Companion
} }
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()

View File

@ -0,0 +1,26 @@
package dev.inmo.tgbotapi.requests.get
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.businessConnectionIdField
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
@Serializable
data class GetBusinessConnection(
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId
) : SimpleRequest<BusinessConnection>, WithBusinessConnectionId {
override fun method(): String {
return "getBusinessConnection"
}
override val resultDeserializer: DeserializationStrategy<BusinessConnection>
get() = BusinessConnection.Companion
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField

View File

@ -2,10 +2,12 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.types.DisableNotification import dev.inmo.tgbotapi.abstracts.types.DisableNotification
import dev.inmo.tgbotapi.abstracts.types.MessagesAction import dev.inmo.tgbotapi.abstracts.types.MessagesAction
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.abstracts.types.ProtectContent import dev.inmo.tgbotapi.abstracts.types.ProtectContent
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup

View File

@ -1,9 +1,11 @@
package dev.inmo.tgbotapi.requests.send package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendChatMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendChatMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.actions.BotAction import dev.inmo.tgbotapi.types.actions.BotAction
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer import kotlinx.serialization.builtins.serializer
@ -17,8 +19,10 @@ data class SendAction(
@SerialName(actionField) @SerialName(actionField)
val action: BotAction, val action: BotAction,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId override val threadId: MessageThreadId? = chatId.threadId,
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest { @SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest, OptionallyBusinessConnectionRequest {
override fun method(): String = "sendChatAction" override fun method(): String = "sendChatAction"
override val resultDeserializer: DeserializationStrategy<Boolean> override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer() get() = Boolean.serializer()

View File

@ -1,8 +1,10 @@
package dev.inmo.tgbotapi.requests.send package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -24,6 +26,8 @@ data class SendContact(
val lastName: String? = null, val lastName: String? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -32,13 +36,14 @@ data class SendContact(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<ContactContent>>, ) : SendContentMessageRequest<ContentMessage<ContactContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<ContactContent>> ReplyingMarkupSendMessageRequest<ContentMessage<ContactContent>>
{ {
constructor( constructor(
chatId: ChatIdentifier, chatId: ChatIdentifier,
contact: Contact, contact: Contact,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -49,6 +54,7 @@ data class SendContact(
contact.firstName, contact.firstName,
contact.lastName, contact.lastName,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -65,6 +71,7 @@ data class SendContact(
fun Contact.toRequest( fun Contact.toRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -73,6 +80,7 @@ fun Contact.toRequest(
chatId, chatId,
this, this,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,

View File

@ -1,9 +1,11 @@
package dev.inmo.tgbotapi.requests.send package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.types.DisableNotification import dev.inmo.tgbotapi.abstracts.types.DisableNotification
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.dice.DiceAnimationType import dev.inmo.tgbotapi.types.dice.DiceAnimationType
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@ -21,7 +23,9 @@ data class SendDice(
@SerialName(emojiField) @SerialName(emojiField)
val animationType: DiceAnimationType? = null, val animationType: DiceAnimationType? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId?, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -30,7 +34,8 @@ data class SendDice(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification { ) : ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification,
OptionallyBusinessConnectionRequest {
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.* import dev.inmo.tgbotapi.abstracts.*
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -19,6 +20,7 @@ fun SendLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -32,6 +34,7 @@ fun SendLocation(
null, null,
null, null,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -43,11 +46,12 @@ fun SendStaticLocation(
latitude: Double, latitude: Double,
longitude: Double, longitude: Double,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
fun SendLiveLocation( fun SendLiveLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
@ -58,6 +62,7 @@ fun SendLiveLocation(
heading: Degrees? = null, heading: Degrees? = null,
proximityAlertRadius: Meters? = null, proximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -71,6 +76,7 @@ fun SendLiveLocation(
heading, heading,
proximityAlertRadius, proximityAlertRadius,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -95,6 +101,8 @@ data class SendLocation internal constructor(
override val proximityAlertRadius: Meters? = null, override val proximityAlertRadius: Meters? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -103,7 +111,7 @@ data class SendLocation internal constructor(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<LocationContent>>, ) : SendContentMessageRequest<ContentMessage<LocationContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<LocationContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<LocationContent>>,
PositionedSendMessageRequest<ContentMessage<LocationContent>>, PositionedSendMessageRequest<ContentMessage<LocationContent>>,
HorizontallyAccured, HorizontallyAccured,

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.abstracts.types.LinkPreviewOptionsContainer import dev.inmo.tgbotapi.abstracts.types.LinkPreviewOptionsContainer
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -26,6 +27,7 @@ fun SendTextMessage(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -36,6 +38,7 @@ fun SendTextMessage(
parseMode, parseMode,
null, null,
threadId, threadId,
businessConnectionId,
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
@ -48,6 +51,7 @@ fun SendTextMessage(
entities: TextSourcesList, entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null, linkPreviewOptions: LinkPreviewOptions? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -58,6 +62,7 @@ fun SendTextMessage(
null, null,
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
threadId, threadId,
businessConnectionId,
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
@ -77,6 +82,8 @@ data class SendTextMessage internal constructor(
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(linkPreviewOptionsField) @SerialName(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null, override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
@ -87,7 +94,7 @@ data class SendTextMessage internal constructor(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<TextContent>>, ) : SendContentMessageRequest<ContentMessage<TextContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<TextContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<TextContent>>,
TextableSendMessageRequest<ContentMessage<TextContent>>, TextableSendMessageRequest<ContentMessage<TextContent>>,
LinkPreviewOptionsContainer LinkPreviewOptionsContainer

View File

@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -34,6 +35,8 @@ data class SendVenue(
val googlePlaceType: GooglePlaceType? = null, val googlePlaceType: GooglePlaceType? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -42,7 +45,7 @@ data class SendVenue(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<VenueContent>>, ) : SendContentMessageRequest<ContentMessage<VenueContent>>,
PositionedSendMessageRequest<ContentMessage<VenueContent>>, PositionedSendMessageRequest<ContentMessage<VenueContent>>,
TitledSendMessageRequest<ContentMessage<VenueContent>>, TitledSendMessageRequest<ContentMessage<VenueContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<VenueContent>> ReplyingMarkupSendMessageRequest<ContentMessage<VenueContent>>
@ -51,6 +54,7 @@ data class SendVenue(
chatId: ChatIdentifier, chatId: ChatIdentifier,
venue: Venue, venue: Venue,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -82,6 +86,7 @@ data class SendVenue(
fun Venue.toRequest( fun Venue.toRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -90,6 +95,7 @@ fun Venue.toRequest(
chatId, chatId,
this, this,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,

View File

@ -0,0 +1,5 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
interface SendContentMessageRequest<T: Any> : SendMessageRequest<T>, OptionallyBusinessConnectionRequest

View File

@ -1,8 +1,10 @@
package dev.inmo.tgbotapi.requests.send.games package dev.inmo.tgbotapi.requests.send.games
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -20,6 +22,8 @@ data class SendGame (
val gameShortName: String, val gameShortName: String,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -28,7 +32,7 @@ data class SendGame (
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<GameContent>>, ) : SendContentMessageRequest<ContentMessage<GameContent>>,
WithReplyMarkup { WithReplyMarkup {
override fun method(): String = "sendGame" override fun method(): String = "sendGame"
override val resultDeserializer: DeserializationStrategy<ContentMessage<GameContent>> override val resultDeserializer: DeserializationStrategy<ContentMessage<GameContent>>

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -31,6 +32,7 @@ fun SendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -51,6 +53,7 @@ fun SendAnimation(
width, width,
height, height,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -77,6 +80,7 @@ fun SendAnimation(
width: Int? = null, width: Int? = null,
height: Int? = null, height: Int? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -97,6 +101,7 @@ fun SendAnimation(
width, width,
height, height,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -140,6 +145,8 @@ data class SendAnimationData internal constructor(
override val height: Int? = null, override val height: Int? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -149,7 +156,7 @@ data class SendAnimationData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<AnimationContent>>, ) : DataRequest<ContentMessage<AnimationContent>>,
SendMessageRequest<ContentMessage<AnimationContent>>, SendContentMessageRequest<ContentMessage<AnimationContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<AnimationContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<AnimationContent>>,
TextableSendMessageRequest<ContentMessage<AnimationContent>>, TextableSendMessageRequest<ContentMessage<AnimationContent>>,
ThumbedSendMessageRequest<ContentMessage<AnimationContent>>, ThumbedSendMessageRequest<ContentMessage<AnimationContent>>,

View File

@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -31,6 +32,7 @@ fun SendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -50,6 +52,7 @@ fun SendAudio(
performer, performer,
title, title,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -75,6 +78,7 @@ fun SendAudio(
performer: String? = null, performer: String? = null,
title: String? = null, title: String? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -94,6 +98,7 @@ fun SendAudio(
performer, performer,
title, title,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -135,6 +140,8 @@ data class SendAudioData internal constructor(
override val title: String? = null, override val title: String? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -144,7 +151,7 @@ data class SendAudioData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<AudioContent>>, ) : DataRequest<ContentMessage<AudioContent>>,
SendMessageRequest<ContentMessage<AudioContent>>, SendContentMessageRequest<ContentMessage<AudioContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<AudioContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<AudioContent>>,
TextableSendMessageRequest<ContentMessage<AudioContent>>, TextableSendMessageRequest<ContentMessage<AudioContent>>,
ThumbedSendMessageRequest<ContentMessage<AudioContent>>, ThumbedSendMessageRequest<ContentMessage<AudioContent>>,

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -36,6 +37,7 @@ fun SendDocument(
text: String? = null, text: String? = null,
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -53,6 +55,7 @@ fun SendDocument(
parseMode, parseMode,
null, null,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -85,6 +88,7 @@ fun SendDocument(
thumbnail: InputFile? = null, thumbnail: InputFile? = null,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -102,6 +106,7 @@ fun SendDocument(
null, null,
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -147,6 +152,8 @@ data class SendDocumentData internal constructor(
private val rawEntities: List<RawMessageEntity>? = null, private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -158,7 +165,7 @@ data class SendDocumentData internal constructor(
@SerialName(disableContentTypeDetectionField) @SerialName(disableContentTypeDetectionField)
val disableContentTypeDetection: Boolean? = null val disableContentTypeDetection: Boolean? = null
) : DataRequest<ContentMessage<DocumentContent>>, ) : DataRequest<ContentMessage<DocumentContent>>,
SendMessageRequest<ContentMessage<DocumentContent>>, SendContentMessageRequest<ContentMessage<DocumentContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<DocumentContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<DocumentContent>>,
TextableSendMessageRequest<ContentMessage<DocumentContent>>, TextableSendMessageRequest<ContentMessage<DocumentContent>>,
ThumbedSendMessageRequest<ContentMessage<DocumentContent>> ThumbedSendMessageRequest<ContentMessage<DocumentContent>>

View File

@ -3,9 +3,11 @@ package dev.inmo.tgbotapi.requests.send.media
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
@ -32,6 +34,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<MediaGroupMemberTelegramMedia>, media: List<MediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -56,6 +59,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
chatId, chatId,
media, media,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters replyParameters
@ -81,11 +85,12 @@ inline fun SendPlaylist(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<AudioMediaGroupMemberTelegramMedia>, media: List<AudioMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = SendMediaGroup<AudioContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) ) = SendMediaGroup<AudioContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
/** /**
* Use this method to be sure that you are correctly sending documents media group * Use this method to be sure that you are correctly sending documents media group
@ -97,11 +102,12 @@ inline fun SendDocumentsGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<DocumentMediaGroupMemberTelegramMedia>, media: List<DocumentMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) ) = SendMediaGroup<DocumentContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
/** /**
* Use this method to be sure that you are correctly sending visual media group * Use this method to be sure that you are correctly sending visual media group
@ -114,11 +120,12 @@ inline fun SendVisualMediaGroup(
chatId: ChatIdentifier, chatId: ChatIdentifier,
media: List<VisualMediaGroupMemberTelegramMedia>, media: List<VisualMediaGroupMemberTelegramMedia>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
allowSendingWithoutReply: Boolean? = null allowSendingWithoutReply: Boolean? = null
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) ) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> { private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> {
private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>()) private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>())
@ -142,6 +149,8 @@ data class SendMediaGroupData internal constructor(
val media: List<MediaGroupMemberTelegramMedia> = emptyList(), val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -149,7 +158,7 @@ data class SendMediaGroupData internal constructor(
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>, ) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,
SendMessageRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> { SendContentMessageRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> {
@SerialName(mediaField) @SerialName(mediaField)
private val convertedMedia: String private val convertedMedia: String
get() = buildJsonArray { get() = buildJsonArray {

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -26,6 +27,7 @@ fun SendPhoto(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -39,6 +41,7 @@ fun SendPhoto(
null, null,
spoilered, spoilered,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -60,6 +63,7 @@ fun SendPhoto(
entities: TextSourcesList, entities: TextSourcesList,
spoilered: Boolean = false, spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -73,6 +77,7 @@ fun SendPhoto(
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
spoilered, spoilered,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -108,6 +113,8 @@ data class SendPhotoData internal constructor(
override val spoilered: Boolean = false, override val spoilered: Boolean = false,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -117,7 +124,7 @@ data class SendPhotoData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<PhotoContent>>, ) : DataRequest<ContentMessage<PhotoContent>>,
SendMessageRequest<ContentMessage<PhotoContent>>, SendContentMessageRequest<ContentMessage<PhotoContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<PhotoContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<PhotoContent>>,
TextableSendMessageRequest<ContentMessage<PhotoContent>>, TextableSendMessageRequest<ContentMessage<PhotoContent>>,
OptionallyWithSpoilerRequest OptionallyWithSpoilerRequest

View File

@ -3,8 +3,10 @@ package dev.inmo.tgbotapi.requests.send.media
import dev.inmo.tgbotapi.requests.abstracts.* import dev.inmo.tgbotapi.requests.abstracts.*
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -15,6 +17,7 @@ fun SendSticker(
chatId: ChatIdentifier, chatId: ChatIdentifier,
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null, emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@ -24,6 +27,7 @@ fun SendSticker(
chatId, chatId,
sticker, sticker,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -49,6 +53,8 @@ data class SendStickerByFileId internal constructor(
val sticker: InputFile, val sticker: InputFile,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -57,7 +63,7 @@ data class SendStickerByFileId internal constructor(
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<ContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<StickerContent>> { ) : SendContentMessageRequest<ContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<StickerContent>> {
override fun method(): String = "sendSticker" override fun method(): String = "sendSticker"
override val resultDeserializer: DeserializationStrategy<ContentMessage<StickerContent>> override val resultDeserializer: DeserializationStrategy<ContentMessage<StickerContent>>
get() = commonResultDeserializer get() = commonResultDeserializer

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -32,6 +33,7 @@ fun SendVideo(
height: Int? = null, height: Int? = null,
supportStreaming: Boolean? = null, supportStreaming: Boolean? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -53,6 +55,7 @@ fun SendVideo(
height, height,
supportStreaming, supportStreaming,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -80,6 +83,7 @@ fun SendVideo(
height: Int? = null, height: Int? = null,
supportStreaming: Boolean? = null, supportStreaming: Boolean? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -101,6 +105,7 @@ fun SendVideo(
height, height,
supportStreaming, supportStreaming,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -146,6 +151,8 @@ data class SendVideoData internal constructor(
val supportStreaming: Boolean? = null, val supportStreaming: Boolean? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -155,7 +162,7 @@ data class SendVideoData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<VideoContent>>, ) : DataRequest<ContentMessage<VideoContent>>,
SendMessageRequest<ContentMessage<VideoContent>>, SendContentMessageRequest<ContentMessage<VideoContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<VideoContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<VideoContent>>,
TextableSendMessageRequest<ContentMessage<VideoContent>>, TextableSendMessageRequest<ContentMessage<VideoContent>>,
ThumbedSendMessageRequest<ContentMessage<VideoContent>>, ThumbedSendMessageRequest<ContentMessage<VideoContent>>,

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
@ -19,6 +20,7 @@ fun SendVideoNote(
duration: Long? = null, duration: Long? = null,
size: Int? = null, // in documentation - length (size of video side) size: Int? = null, // in documentation - length (size of video side)
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -34,6 +36,7 @@ fun SendVideoNote(
duration, duration,
size, size,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -67,6 +70,8 @@ data class SendVideoNoteData internal constructor(
override val width: Int? = null, override val width: Int? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -76,7 +81,7 @@ data class SendVideoNoteData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<VideoNoteContent>>, ) : DataRequest<ContentMessage<VideoNoteContent>>,
SendMessageRequest<ContentMessage<VideoNoteContent>>, SendContentMessageRequest<ContentMessage<VideoNoteContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<VideoNoteContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<VideoNoteContent>>,
ThumbedSendMessageRequest<ContentMessage<VideoNoteContent>>, ThumbedSendMessageRequest<ContentMessage<VideoNoteContent>>,
DuratedSendMessageRequest<ContentMessage<VideoNoteContent>>, DuratedSendMessageRequest<ContentMessage<VideoNoteContent>>,

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.* import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField import dev.inmo.tgbotapi.types.message.parseModeField
@ -27,6 +28,7 @@ fun SendVoice(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
duration: Long? = null, duration: Long? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -42,6 +44,7 @@ fun SendVoice(
null, null,
duration, duration,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -63,6 +66,7 @@ fun SendVoice(
voice: InputFile, voice: InputFile,
entities: TextSourcesList, entities: TextSourcesList,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
duration: Long? = null, duration: Long? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
@ -79,6 +83,7 @@ fun SendVoice(
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
duration, duration,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -114,6 +119,8 @@ data class SendVoiceData internal constructor(
override val duration: Long? = null, override val duration: Long? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -123,7 +130,7 @@ data class SendVoiceData internal constructor(
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<VoiceContent>>, ) : DataRequest<ContentMessage<VoiceContent>>,
SendMessageRequest<ContentMessage<VoiceContent>>, SendContentMessageRequest<ContentMessage<VoiceContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<VoiceContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<VoiceContent>>,
TextableSendMessageRequest<ContentMessage<VoiceContent>>, TextableSendMessageRequest<ContentMessage<VoiceContent>>,
DuratedSendMessageRequest<ContentMessage<VoiceContent>> DuratedSendMessageRequest<ContentMessage<VoiceContent>>

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
import dev.inmo.tgbotapi.abstracts.types.* import dev.inmo.tgbotapi.abstracts.types.*
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass

View File

@ -3,8 +3,10 @@ package dev.inmo.tgbotapi.requests.send.polls
import korlibs.time.DateTime import korlibs.time.DateTime
import dev.inmo.tgbotapi.abstracts.TextedOutput import dev.inmo.tgbotapi.abstracts.TextedOutput
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@ -51,6 +53,7 @@ fun SendPoll(
isAnonymous: Boolean = true, isAnonymous: Boolean = true,
isClosed: Boolean = false, isClosed: Boolean = false,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -62,6 +65,7 @@ fun SendPoll(
isAnonymous, isAnonymous,
isClosed, isClosed,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
protectContent = protectContent, protectContent = protectContent,
disableNotification = disableNotification, disableNotification = disableNotification,
replyParameters = replyParameters, replyParameters = replyParameters,
@ -75,6 +79,7 @@ fun SendPoll(
fun Poll.createRequest( fun Poll.createRequest(
chatId: ChatIdentifier, chatId: ChatIdentifier,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -89,6 +94,7 @@ fun Poll.createRequest(
allowMultipleAnswers, allowMultipleAnswers,
scheduledCloseInfo, scheduledCloseInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -105,6 +111,7 @@ fun Poll.createRequest(
textSources, textSources,
scheduledCloseInfo, scheduledCloseInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -119,6 +126,7 @@ fun Poll.createRequest(
false, false,
scheduledCloseInfo, scheduledCloseInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -133,6 +141,7 @@ fun Poll.createRequest(
false, false,
scheduledCloseInfo, scheduledCloseInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -150,7 +159,7 @@ private fun ScheduledCloseInfo.checkSendData() {
} }
} }
sealed class SendPoll : SendMessageRequest<ContentMessage<PollContent>>, sealed class SendPoll : SendContentMessageRequest<ContentMessage<PollContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>> { ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>> {
abstract val question: String abstract val question: String
abstract val options: List<String> abstract val options: List<String>
@ -198,6 +207,8 @@ data class SendRegularPoll(
override val closeDate: LongSeconds?, override val closeDate: LongSeconds?,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
@ -226,6 +237,7 @@ fun SendRegularPoll(
allowMultipleAnswers: Boolean = false, allowMultipleAnswers: Boolean = false,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -240,6 +252,7 @@ fun SendRegularPoll(
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate, (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -257,6 +270,7 @@ fun SendQuizPoll(
parseMode: ParseMode? = null, parseMode: ParseMode? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -273,6 +287,7 @@ fun SendQuizPoll(
null, null,
closeInfo, closeInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -289,6 +304,7 @@ fun SendQuizPoll(
entities: List<TextSource>, entities: List<TextSource>,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -305,6 +321,7 @@ fun SendQuizPoll(
entities.toRawMessageEntities(), entities.toRawMessageEntities(),
closeInfo, closeInfo,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -323,6 +340,7 @@ internal fun SendQuizPoll(
rawEntities: List<RawMessageEntity>? = null, rawEntities: List<RawMessageEntity>? = null,
closeInfo: ScheduledCloseInfo? = null, closeInfo: ScheduledCloseInfo? = null,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
@ -340,6 +358,7 @@ internal fun SendQuizPoll(
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate, (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId, threadId,
businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
replyParameters, replyParameters,
@ -372,6 +391,8 @@ data class SendQuizPoll internal constructor(
override val closeDate: LongSeconds? = null, override val closeDate: LongSeconds? = null,
@SerialName(messageThreadIdField) @SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId, override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField) @SerialName(disableNotificationField)
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)

View File

@ -38,7 +38,7 @@ data class AddStickerToSetData internal constructor(
@SerialName(nameField) @SerialName(nameField)
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(stickerField) @SerialName(stickerField)
override val inputSticker: InputSticker override val newSticker: InputSticker
) : StandardStickerSetAction { ) : StandardStickerSetAction {
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()

View File

@ -21,14 +21,13 @@ fun CreateNewStickerSet(
userId: UserId, userId: UserId,
name: StickerSetName, name: StickerSetName,
title: String, title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>, stickers: List<InputSticker>,
needsRepainting: Boolean? = null needsRepainting: Boolean? = null
): Request<Boolean> { ): Request<Boolean> {
val data = when(stickers.first()) { val data = when(stickers.first()) {
is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.Mask>()) is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickers.filterIsInstance<InputSticker.Mask>())
is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting) is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting)
is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>()) is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>())
} }
val multipartParts = stickers.mapNotNull { val multipartParts = stickers.mapNotNull {
(it.sticker as? MultipartFile) (it.sticker as? MultipartFile)
@ -63,14 +62,12 @@ fun CreateNewStickerSet(
userId: UserId, userId: UserId,
name: String, name: String,
title: String, title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>, stickers: List<InputSticker>,
needsRepainting: Boolean? = null needsRepainting: Boolean? = null
) = CreateNewStickerSet( ) = CreateNewStickerSet(
userId = userId, userId = userId,
name = StickerSetName(name), name = StickerSetName(name),
title = title, title = title,
stickersFormat = stickersFormat,
stickers = stickers, stickers = stickers,
needsRepainting = needsRepainting needsRepainting = needsRepainting
) )
@ -79,7 +76,6 @@ fun CreateNewStickerSet(
sealed interface CreateNewStickerSet : CreateStickerSetAction { sealed interface CreateNewStickerSet : CreateStickerSetAction {
val stickerType: StickerType val stickerType: StickerType
val stickers: List<InputSticker> val stickers: List<InputSticker>
val stickersFormat: StickerFormat
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()
@ -94,8 +90,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(titleField) @SerialName(titleField)
override val title: String, override val title: String,
@SerialName(stickerFormatField)
override val stickersFormat: StickerFormat,
@SerialName(stickersField) @SerialName(stickersField)
override val stickers: List<InputSticker.WithKeywords.Regular> override val stickers: List<InputSticker.WithKeywords.Regular>
) : CreateNewStickerSet { ) : CreateNewStickerSet {
@ -111,8 +105,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(titleField) @SerialName(titleField)
override val title: String, override val title: String,
@SerialName(stickerFormatField)
override val stickersFormat: StickerFormat,
@SerialName(stickersField) @SerialName(stickersField)
override val stickers: List<InputSticker.Mask> override val stickers: List<InputSticker.Mask>
) : CreateNewStickerSet { ) : CreateNewStickerSet {
@ -128,8 +120,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(titleField) @SerialName(titleField)
override val title: String, override val title: String,
@SerialName(stickerFormatField)
override val stickersFormat: StickerFormat,
@SerialName(stickersField) @SerialName(stickersField)
override val stickers: List<InputSticker.WithKeywords.CustomEmoji>, override val stickers: List<InputSticker.WithKeywords.CustomEmoji>,
@SerialName(needsRepaintingField) @SerialName(needsRepaintingField)
@ -148,8 +138,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(titleField) @SerialName(titleField)
override val title: String, override val title: String,
@SerialName(stickerFormatField)
val stickersFormat: StickerFormat,
@SerialName(stickersField) @SerialName(stickersField)
val stickers: List<InputSticker>, val stickers: List<InputSticker>,
@SerialName(stickerTypeField) @SerialName(stickerTypeField)
@ -172,7 +160,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
it.userId, it.userId,
it.name, it.name,
it.title, it.title,
it.stickersFormat,
it.stickers, it.stickers,
it.stickerType, it.stickerType,
(it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting (it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting
@ -184,7 +171,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
it.userId, it.userId,
it.name, it.name,
it.title, it.title,
it.stickersFormat,
it.stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), it.stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(),
it.needsRepainting it.needsRepainting
) )
@ -192,14 +178,12 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
it.userId, it.userId,
it.name, it.name,
it.title, it.title,
it.stickersFormat,
it.stickers.filterIsInstance<InputSticker.Mask>(), it.stickers.filterIsInstance<InputSticker.Mask>(),
) )
StickerType.Regular -> CreateNewStickerSet.Regular( StickerType.Regular -> CreateNewStickerSet.Regular(
it.userId, it.userId,
it.name, it.name,
it.title, it.title,
it.stickersFormat,
it.stickers.filterIsInstance<InputSticker.WithKeywords.Regular>(), it.stickers.filterIsInstance<InputSticker.WithKeywords.Regular>(),
) )
is StickerType.Unknown -> error("Unable to create new sticker set due to error in type format: ${it.stickerType}") is StickerType.Unknown -> error("Unable to create new sticker set due to error in type format: ${it.stickerType}")

View File

@ -2,11 +2,7 @@ package dev.inmo.tgbotapi.requests.stickers
import dev.inmo.micro_utils.serialization.mapper.MapperSerializer import dev.inmo.micro_utils.serialization.mapper.MapperSerializer
import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.types.StickerType import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.emojiListField
import dev.inmo.tgbotapi.types.keywordsField
import dev.inmo.tgbotapi.types.maskPositionField
import dev.inmo.tgbotapi.types.stickerField
import dev.inmo.tgbotapi.types.stickers.MaskPosition import dev.inmo.tgbotapi.types.stickers.MaskPosition
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
import kotlinx.serialization.KSerializer import kotlinx.serialization.KSerializer
@ -17,12 +13,15 @@ import kotlinx.serialization.Serializable
@Serializable(InputStickerSerializer::class) @Serializable(InputStickerSerializer::class)
sealed interface InputSticker { sealed interface InputSticker {
val sticker: InputFile val sticker: InputFile
val format: StickerFormat
val emojisList: List<String> val emojisList: List<String>
@Serializable @Serializable
data class Mask( data class Mask(
@SerialName(stickerField) @SerialName(stickerField)
override val sticker: InputFile, override val sticker: InputFile,
@SerialName(formatField)
override val format: StickerFormat,
@SerialName(emojiListField) @SerialName(emojiListField)
override val emojisList: List<String>, override val emojisList: List<String>,
@SerialName(maskPositionField) @SerialName(maskPositionField)
@ -37,6 +36,8 @@ sealed interface InputSticker {
data class Regular( data class Regular(
@SerialName(stickerField) @SerialName(stickerField)
override val sticker: InputFile, override val sticker: InputFile,
@SerialName(formatField)
override val format: StickerFormat,
@SerialName(emojiListField) @SerialName(emojiListField)
override val emojisList: List<String>, override val emojisList: List<String>,
@SerialName(keywordsField) @SerialName(keywordsField)
@ -47,6 +48,8 @@ sealed interface InputSticker {
data class CustomEmoji( data class CustomEmoji(
@SerialName(stickerField) @SerialName(stickerField)
override val sticker: InputFile, override val sticker: InputFile,
@SerialName(formatField)
override val format: StickerFormat,
@SerialName(emojiListField) @SerialName(emojiListField)
override val emojisList: List<String>, override val emojisList: List<String>,
@SerialName(keywordsField) @SerialName(keywordsField)
@ -61,6 +64,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
when (it) { when (it) {
is InputSticker.Mask -> SurrogateInputSticker( is InputSticker.Mask -> SurrogateInputSticker(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
emptyList(), emptyList(),
it.maskPosition, it.maskPosition,
@ -68,6 +72,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
) )
is InputSticker.WithKeywords.CustomEmoji -> SurrogateInputSticker( is InputSticker.WithKeywords.CustomEmoji -> SurrogateInputSticker(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.keywords, it.keywords,
null, null,
@ -75,6 +80,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
) )
is InputSticker.WithKeywords.Regular -> SurrogateInputSticker( is InputSticker.WithKeywords.Regular -> SurrogateInputSticker(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.keywords, it.keywords,
null, null,
@ -86,21 +92,25 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
when (it.internalType) { when (it.internalType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji( StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.keywords it.keywords
) )
StickerType.Mask -> InputSticker.Mask( StickerType.Mask -> InputSticker.Mask(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.maskPosition it.maskPosition
) )
StickerType.Regular -> InputSticker.WithKeywords.Regular( StickerType.Regular -> InputSticker.WithKeywords.Regular(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.keywords it.keywords
) )
is StickerType.Unknown -> InputSticker.WithKeywords.Regular( is StickerType.Unknown -> InputSticker.WithKeywords.Regular(
it.sticker, it.sticker,
it.format,
it.emojisList, it.emojisList,
it.keywords it.keywords
) )
@ -111,6 +121,8 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
data class SurrogateInputSticker internal constructor( data class SurrogateInputSticker internal constructor(
@SerialName(stickerField) @SerialName(stickerField)
val sticker: InputFile, val sticker: InputFile,
@SerialName(formatField)
val format: StickerFormat,
@SerialName(emojiListField) @SerialName(emojiListField)
val emojisList: List<String>, val emojisList: List<String>,
@SerialName(keywordsField) @SerialName(keywordsField)

View File

@ -0,0 +1,59 @@
package dev.inmo.tgbotapi.requests.stickers
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.stickers.abstracts.StandardStickerSetAction
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.files.File
import kotlinx.serialization.*
fun ReplaceStickerInSet(
userId: UserId,
stickerSetName: StickerSetName,
oldSticker: FileId,
newSticker: InputSticker
): Request<Boolean> {
val data = ReplaceStickerInSetData(
userId = userId,
name = stickerSetName,
oldSticker = oldSticker,
newSticker = newSticker
)
return when (val sticker = newSticker.sticker) {
is MultipartFile -> CommonMultipartFileRequest(
data,
mapOf(sticker.fileId to sticker)
)
is FileId -> data
}
}
fun ReplaceStickerInSet(
userId: UserId,
stickerSetName: String,
oldSticker: FileId,
newSticker: InputSticker
): Request<Boolean> = ReplaceStickerInSetData(
userId = userId,
name = StickerSetName(stickerSetName),
oldSticker = oldSticker,
newSticker = newSticker
)
@Serializable
data class ReplaceStickerInSetData internal constructor(
@SerialName(userIdField)
override val userId: UserId,
@SerialName(nameField)
override val name: StickerSetName,
@SerialName(oldStickerField)
val oldSticker: FileId,
@SerialName(stickerField)
override val newSticker: InputSticker
) : StandardStickerSetAction {
override fun method(): String = "replaceStickerInSet"
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@ -9,10 +9,11 @@ import kotlinx.serialization.*
fun SetStickerSetThumbnail( fun SetStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSetName: StickerSetName, stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
): Request<Boolean> { ): Request<Boolean> {
return CommonMultipartFileRequest( return CommonMultipartFileRequest(
SetStickerSetThumbnail(userId, stickerSetName), SetStickerSetThumbnail(userId, stickerSetName, format),
mapOf(thumbnailField to thumbnail) mapOf(thumbnailField to thumbnail)
) )
} }
@ -20,10 +21,12 @@ fun SetStickerSetThumbnail(
fun SetStickerSetThumbnail( fun SetStickerSetThumbnail(
userId: UserId, userId: UserId,
stickerSetName: String, stickerSetName: String,
format: StickerFormat,
thumbnail: MultipartFile thumbnail: MultipartFile
): Request<Boolean> = SetStickerSetThumbnail( ): Request<Boolean> = SetStickerSetThumbnail(
userId = userId, userId = userId,
stickerSetName = StickerSetName(stickerSetName), stickerSetName = StickerSetName(stickerSetName, ),
format = format,
thumbnail = thumbnail thumbnail = thumbnail
) )
@ -33,6 +36,8 @@ data class SetStickerSetThumbnail (
override val userId: UserId, override val userId: UserId,
@SerialName(nameField) @SerialName(nameField)
override val name: StickerSetName, override val name: StickerSetName,
@SerialName(formatField)
val format: StickerFormat,
@SerialName(thumbnailField) @SerialName(thumbnailField)
val thumbnail: FileId? = null val thumbnail: FileId? = null
) : OwnerStickerSetAction { ) : OwnerStickerSetAction {

View File

@ -1,8 +1,7 @@
package dev.inmo.tgbotapi.requests.stickers.abstracts package dev.inmo.tgbotapi.requests.stickers.abstracts
import dev.inmo.tgbotapi.requests.stickers.InputSticker import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.stickers.MaskPosition
interface StandardStickerSetAction : OwnerStickerSetAction { interface StandardStickerSetAction : OwnerStickerSetAction {
val inputSticker: InputSticker val newSticker: InputSticker
} }

View File

@ -0,0 +1,19 @@
package dev.inmo.tgbotapi.types
import korlibs.time.Date
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Birthdate(
@SerialName(dayField)
val day: Int,
@SerialName(monthField)
val month: Int,
@SerialName(yearField)
val year: Int
) {
val date: Date by lazy {
Date(year, month, day)
}
}

View File

@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.types package dev.inmo.tgbotapi.types
import dev.inmo.micro_utils.common.Warning import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
@ -29,12 +30,17 @@ sealed interface IdChatIdentifier : ChatIdentifier {
abstract val chatId: RawChatId abstract val chatId: RawChatId
val threadId: MessageThreadId? val threadId: MessageThreadId?
get() = null get() = null
val businessConnectionId: BusinessConnectionId?
get() = null
companion object { companion object {
operator fun invoke(chatId: RawChatId) = ChatId(chatId) operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId?) = threadId ?.let {
ChatIdWithThreadId(chatId, threadId) ChatIdWithThreadId(chatId, threadId)
} ?: businessConnectionId ?.let {
BusinessChatId(chatId, businessConnectionId)
} ?: ChatId(chatId) } ?: ChatId(chatId)
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId) = ChatIdWithThreadId(chatId, threadId)
operator fun invoke(chatId: RawChatId, businessConnectionId: BusinessConnectionId) = BusinessChatId(chatId, businessConnectionId)
} }
} }
@ -52,16 +58,31 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair<RawChatId, MessageTh
constructor(chatId: RawChatId, threadId: MessageThreadId): this(chatId to threadId) constructor(chatId: RawChatId, threadId: MessageThreadId): this(chatId to threadId)
} }
@Serializable(ChatIdentifierSerializer::class)
@JvmInline
value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, BusinessConnectionId>) : IdChatIdentifier {
override val chatId: RawChatId
get() = chatIdWithBusinessConnectionId.first
override val businessConnectionId: BusinessConnectionId
get() = chatIdWithBusinessConnectionId.second
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
}
val ChatIdentifier.threadId: MessageThreadId? val ChatIdentifier.threadId: MessageThreadId?
get() = (this as? IdChatIdentifier) ?.threadId get() = (this as? IdChatIdentifier) ?.threadId
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
get() = (this as? IdChatIdentifier) ?.businessConnectionId
fun IdChatIdentifier.toChatId() = when (this) { fun IdChatIdentifier.toChatId() = when (this) {
is ChatId -> this is ChatId -> this
is ChatIdWithThreadId -> ChatId(chatId) is ChatIdWithThreadId -> ChatId(chatId)
is BusinessChatId -> ChatId(chatId)
} }
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId) fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
/** /**
* https://core.telegram.org/bots/api#formatting-options * https://core.telegram.org/bots/api#formatting-options
@ -145,14 +166,22 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
ChatId(RawChatId(it)) ChatId(RawChatId(it))
} ?:let { } ?:let {
val splitted = id.content.split("/") val splitted = id.content.split("/")
if (splitted.size == 2) { when (splitted.size) {
val (chatId, threadId) = splitted 2 -> {
ChatIdWithThreadId( val (chatId, threadId) = splitted
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null, ChatIdWithThreadId(
threadId.toLongOrNull() ?.let(::MessageThreadId) ?: return@let null chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
) threadId.toLongOrNull() ?.let(::MessageThreadId) ?: return@let null
} else { )
null }
3 -> {
val (chatId, _, businessConnectionId) = splitted
BusinessChatId(
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
businessConnectionId.let(::BusinessConnectionId) ?: return@let null
)
}
else -> null
} }
} ?: id.content.let { } ?: id.content.let {
if (!it.startsWith("@")) { if (!it.startsWith("@")) {
@ -167,6 +196,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
when (value) { when (value) {
is ChatId -> encoder.encodeLong(value.chatId.long) is ChatId -> encoder.encodeLong(value.chatId.long)
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}") is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessConnectionId}")
is Username -> encoder.encodeString(value.full) is Username -> encoder.encodeString(value.full)
} }
} }

View File

@ -150,13 +150,17 @@ const val accentColorIdField = "accent_color_id"
const val profileAccentColorIdField = "profile_accent_color_id" const val profileAccentColorIdField = "profile_accent_color_id"
const val backgroundCustomEmojiIdField = "background_custom_emoji_id" const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id" const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
const val personalChatField = "personal_chat"
const val birthdateField = "birthdate"
const val hasVisibleHistoryField = "has_visible_history" const val hasVisibleHistoryField = "has_visible_history"
const val unrestrictBoostsCountField = "unrestrict_boost_count" const val unrestrictBoostsCountField = "unrestrict_boost_count"
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name" const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
const val iconCustomEmojiIdField = "icon_custom_emoji_id" const val iconCustomEmojiIdField = "icon_custom_emoji_id"
const val canJoinGroupsField = "can_join_groups" const val canJoinGroupsField = "can_join_groups"
const val canReadAllGroupMessagesField = "can_read_all_group_messages" const val canReadAllGroupMessagesField = "can_read_all_group_messages"
const val canReplyField = "can_reply"
const val supportInlineQueriesField = "supports_inline_queries" const val supportInlineQueriesField = "supports_inline_queries"
const val canConnectToBusinessField = "can_connect_to_business"
const val textEntitiesField = "text_entities" const val textEntitiesField = "text_entities"
const val entitiesField = "entities" const val entitiesField = "entities"
const val stickerSetNameField = "set_name" const val stickerSetNameField = "set_name"
@ -190,6 +194,7 @@ const val untilDateField = "until_date"
const val errorMessageField = "error_message" const val errorMessageField = "error_message"
const val messageTextField = "message_text" const val messageTextField = "message_text"
const val isPersonalField = "is_personal" const val isPersonalField = "is_personal"
const val isEnabledField = "is_enabled"
const val nextOffsetField = "next_offset" const val nextOffsetField = "next_offset"
const val buttonField = "button" const val buttonField = "button"
const val switchPmTextField = "switch_pm_text" const val switchPmTextField = "switch_pm_text"
@ -259,6 +264,10 @@ const val requestUserField = "request_user"
const val requestUsersField = "request_users" const val requestUsersField = "request_users"
const val requestChatField = "request_chat" const val requestChatField = "request_chat"
const val requestIdField = "request_id" const val requestIdField = "request_id"
const val requestTitleField = "request_title"
const val requestUsernameField = "request_username"
const val requestPhotoField = "request_photo"
const val requestNameField = "request_name"
const val maxQuantityField = "max_quantity" const val maxQuantityField = "max_quantity"
const val userIsBotField = "user_is_bot" const val userIsBotField = "user_is_bot"
@ -370,6 +379,7 @@ const val oldChatMemberField = "old_chat_member"
const val newChatMemberField = "new_chat_member" const val newChatMemberField = "new_chat_member"
const val stickerTypeField = "sticker_type" const val stickerTypeField = "sticker_type"
const val stickerFormatField = "sticker_format" const val stickerFormatField = "sticker_format"
const val formatField = "format"
const val needsRepaintingField = "needs_repainting" const val needsRepaintingField = "needs_repainting"
const val okField = "ok" const val okField = "ok"
@ -415,6 +425,7 @@ const val offsetField = "offset"
const val limitField = "limit" const val limitField = "limit"
const val stickersField = "stickers" const val stickersField = "stickers"
const val stickerField = "sticker" const val stickerField = "sticker"
const val oldStickerField = "old_sticker"
const val keywordsField = "keywords" const val keywordsField = "keywords"
const val urlField = "url" const val urlField = "url"
const val addressField = "address" const val addressField = "address"
@ -449,6 +460,10 @@ const val explanationEntitiesField = "explanation_entities"
const val explanationParseModeField = "explanation_parse_mode" const val explanationParseModeField = "explanation_parse_mode"
const val openPeriodField = "open_period" const val openPeriodField = "open_period"
const val closeDateField = "close_date" const val closeDateField = "close_date"
const val openingMinuteField = "opening_minute"
const val closingMinuteField = "closing_minute"
const val openingHoursField = "opening_hours"
const val timeZoneNameField = "time_zone_name"
const val smallFileIdField = "small_file_id" const val smallFileIdField = "small_file_id"
const val bigFileIdField = "big_file_id" const val bigFileIdField = "big_file_id"
@ -579,3 +594,12 @@ const val additionalChatCountField = "additional_chat_count"
const val unclaimedPrizeCountField = "unclaimed_prize_count" const val unclaimedPrizeCountField = "unclaimed_prize_count"
const val wasRefundedField = "was_refunded" const val wasRefundedField = "was_refunded"
const val isManualField = "is_manual" const val isManualField = "is_manual"
const val businessConnectionIdField = "business_connection_id"
const val businessIntroField = "business_intro"
const val businessLocationField = "business_location"
const val businessOpeningHoursField = "business_opening_hours"
const val dayField = "day"
const val monthField = "month"
const val yearField = "year"

View File

@ -18,6 +18,10 @@ const val UPDATE_MESSAGE_REACTION = "message_reaction"
const val UPDATE_MESSAGE_REACTION_COUNT = "message_reaction_count" const val UPDATE_MESSAGE_REACTION_COUNT = "message_reaction_count"
const val UPDATE_CHAT_BOOST = "chat_boost" const val UPDATE_CHAT_BOOST = "chat_boost"
const val UPDATE_REMOVE_CHAT_BOOST = "removed_chat_boost" const val UPDATE_REMOVE_CHAT_BOOST = "removed_chat_boost"
const val UPDATE_BUSINESS_CONNECTION = "business_connection"
const val UPDATE_BUSINESS_MESSAGE = "business_message"
const val UPDATE_EDITED_BUSINESS_MESSAGE = "edited_business_message"
const val UPDATE_DELETED_BUSINESS_MESSAGES = "deleted_business_messages"
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf( val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
UPDATE_MESSAGE, UPDATE_MESSAGE,
@ -35,7 +39,11 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
UPDATE_CHAT_MEMBER, UPDATE_CHAT_MEMBER,
UPDATE_CHAT_JOIN_REQUEST, UPDATE_CHAT_JOIN_REQUEST,
UPDATE_CHAT_BOOST, UPDATE_CHAT_BOOST,
UPDATE_REMOVE_CHAT_BOOST UPDATE_REMOVE_CHAT_BOOST,
UPDATE_BUSINESS_CONNECTION,
UPDATE_BUSINESS_MESSAGE,
UPDATE_EDITED_BUSINESS_MESSAGE,
UPDATE_DELETED_BUSINESS_MESSAGES
) )
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf( val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(

View File

@ -0,0 +1,73 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.PreviewUser
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
@Serializable(BusinessConnection.Companion::class)
@ClassCastsIncluded
sealed interface BusinessConnection : WithBusinessConnectionId {
val id: BusinessConnectionId
val user: PreviewUser
val userChatId: ChatId
val date: TelegramDate
val canReply: Boolean
val isEnabled: Boolean
override val businessConnectionId: BusinessConnectionId
get() = id
@Serializable
data class Enabled(
@SerialName(idField)
override val id: BusinessConnectionId,
@SerialName(userField)
override val user: PreviewUser,
@SerialName(userChatIdField)
override val userChatId: ChatId,
@SerialName(dateField)
override val date: TelegramDate,
@SerialName(canReplyField)
override val canReply: Boolean,
) : BusinessConnection {
@EncodeDefault
override val isEnabled: Boolean = true
}
@Serializable
data class Disabled(
@SerialName(idField)
override val id: BusinessConnectionId,
@SerialName(userField)
override val user: PreviewUser,
@SerialName(userChatIdField)
override val userChatId: ChatId,
@SerialName(dateField)
override val date: TelegramDate,
@SerialName(canReplyField)
override val canReply: Boolean,
) : BusinessConnection {
@EncodeDefault
override val isEnabled: Boolean = false
}
@Serializer(BusinessConnection::class)
companion object : KSerializer<BusinessConnection> {
override val descriptor: SerialDescriptor
get() = RawBusinessConnection.serializer().descriptor
override fun deserialize(decoder: Decoder): BusinessConnection {
return RawBusinessConnection.serializer().deserialize(decoder).asBusinessConnection
}
override fun serialize(encoder: Encoder, value: BusinessConnection) {
RawBusinessConnection.serializer().serialize(encoder, RawBusinessConnection(value))
}
}
}

View File

@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.types.business_connection
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
@Serializable
@JvmInline
value class BusinessConnectionId(
val string: String
) {
override fun toString(): String {
return string
}
}

View File

@ -0,0 +1,18 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.types.files.Sticker
import dev.inmo.tgbotapi.types.messageField
import dev.inmo.tgbotapi.types.stickerField
import dev.inmo.tgbotapi.types.titleField
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BusinessIntro(
@SerialName(titleField)
val title: String? = null,
@SerialName(messageField)
val message: String? = null,
@SerialName(stickerField)
val sticker: Sticker? = null,
)

View File

@ -0,0 +1,15 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.types.addressField
import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.locationField
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BusinessLocation(
@SerialName(addressField)
val address: String,
@SerialName(locationField)
val location: StaticLocation
)

View File

@ -0,0 +1,18 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
import dev.inmo.tgbotapi.abstracts.types.WithOptionalBusinessConnectionId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.PreviewChat
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BusinessMessagesDeleted(
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId,
@SerialName(chatField)
val chat: PreviewChat,
@SerialName(messageIdsField)
val messageIds: List<MessageId>
) : WithBusinessConnectionId

View File

@ -0,0 +1,15 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.types.openingHoursField
import dev.inmo.tgbotapi.types.timeZoneNameField
import korlibs.time.Timezone
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BusinessOpeningHours(
@SerialName(timeZoneNameField)
val timeZoneName: String,
@SerialName(openingHoursField)
val openingHours: List<BusinessOpeningHoursInterval>
)

View File

@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.types.closingMinuteField
import dev.inmo.tgbotapi.types.openingMinuteField
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BusinessOpeningHoursInterval(
@SerialName(openingMinuteField)
val opening: MinutesInterval,
@SerialName(closingMinuteField)
val closing: MinutesInterval
)

View File

@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.types.business_connection
import korlibs.time.TimeSpan
import korlibs.time.minutes
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
@Serializable
@JvmInline
value class MinutesInterval(
val int: Int
) {
val dayTimeSpan: TimeSpan
get() = int.minutes
val weekDay0: Int
get() = dayTimeSpan.inWholeDays.toInt()
}

View File

@ -0,0 +1,49 @@
package dev.inmo.tgbotapi.types.business_connection
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.PreviewUser
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
internal data class RawBusinessConnection(
@SerialName(idField)
val id: BusinessConnectionId,
@SerialName(userField)
val user: PreviewUser,
@SerialName(userChatIdField)
val userChatId: ChatId,
@SerialName(dateField)
val date: TelegramDate,
@SerialName(canReplyField)
val canReply: Boolean,
@SerialName(isEnabledField)
val isEnabled: Boolean
) {
val asBusinessConnection
get() = when (isEnabled) {
true -> BusinessConnection.Enabled(
id = id,
user = user,
userChatId = userChatId,
date = date,
canReply = canReply
)
false -> BusinessConnection.Disabled(
id = id,
user = user,
userChatId = userChatId,
date = date,
canReply = canReply
)
}
constructor(businessConnection: BusinessConnection) : this(
id = businessConnection.id,
user = businessConnection.user,
userChatId = businessConnection.userChatId,
date = businessConnection.date,
canReply = businessConnection.canReply,
isEnabled = businessConnection.isEnabled,
)
}

View File

@ -1,15 +1,8 @@
package dev.inmo.tgbotapi.types.buttons package dev.inmo.tgbotapi.types.buttons
import dev.inmo.tgbotapi.types.botAdministratorRightsField import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.botIsMemberField
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
import dev.inmo.tgbotapi.types.chatHasUsernameField
import dev.inmo.tgbotapi.types.chatIsChannelField
import dev.inmo.tgbotapi.types.chatIsCreatedField
import dev.inmo.tgbotapi.types.chatIsForumField
import dev.inmo.tgbotapi.types.request.RequestId import dev.inmo.tgbotapi.types.request.RequestId
import dev.inmo.tgbotapi.types.requestIdField
import dev.inmo.tgbotapi.types.userAdministratorRightsField
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@ -34,7 +27,13 @@ data class KeyboardButtonRequestChat(
@SerialName(botAdministratorRightsField) @SerialName(botAdministratorRightsField)
val botRightsInChat: ChatCommonAdministratorRights? = null, val botRightsInChat: ChatCommonAdministratorRights? = null,
@SerialName(botIsMemberField) @SerialName(botIsMemberField)
val botIsMember: Boolean? = null val botIsMember: Boolean? = null,
@SerialName(requestTitleField)
val requestTitle: Boolean? = null,
@SerialName(requestUsernameField)
val requestUsername: Boolean? = null,
@SerialName(requestPhotoField)
val requestPhoto: Boolean? = null
) { ) {
companion object { companion object {
fun Channel( fun Channel(
@ -43,7 +42,10 @@ data class KeyboardButtonRequestChat(
isOwnedBy: Boolean? = null, isOwnedBy: Boolean? = null,
userRightsInChat: ChatCommonAdministratorRights? = null, userRightsInChat: ChatCommonAdministratorRights? = null,
botRightsInChat: ChatCommonAdministratorRights? = null, botRightsInChat: ChatCommonAdministratorRights? = null,
botIsMember: Boolean? = null botIsMember: Boolean? = null,
requestTitle: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = KeyboardButtonRequestChat( ) = KeyboardButtonRequestChat(
requestId = requestId, requestId = requestId,
isChannel = true, isChannel = true,
@ -52,7 +54,10 @@ data class KeyboardButtonRequestChat(
isOwnedBy = isOwnedBy, isOwnedBy = isOwnedBy,
userRightsInChat = userRightsInChat, userRightsInChat = userRightsInChat,
botRightsInChat = botRightsInChat, botRightsInChat = botRightsInChat,
botIsMember = botIsMember botIsMember = botIsMember,
requestTitle = requestTitle,
requestUsername = requestUsername,
requestPhoto = requestPhoto,
) )
fun Group( fun Group(
@ -62,7 +67,10 @@ data class KeyboardButtonRequestChat(
isOwnedBy: Boolean? = null, isOwnedBy: Boolean? = null,
userRightsInChat: ChatCommonAdministratorRights? = null, userRightsInChat: ChatCommonAdministratorRights? = null,
botRightsInChat: ChatCommonAdministratorRights? = null, botRightsInChat: ChatCommonAdministratorRights? = null,
botIsMember: Boolean? = null botIsMember: Boolean? = null,
requestTitle: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = KeyboardButtonRequestChat( ) = KeyboardButtonRequestChat(
requestId = requestId, requestId = requestId,
isChannel = false, isChannel = false,
@ -71,7 +79,10 @@ data class KeyboardButtonRequestChat(
isOwnedBy = isOwnedBy, isOwnedBy = isOwnedBy,
userRightsInChat = userRightsInChat, userRightsInChat = userRightsInChat,
botRightsInChat = botRightsInChat, botRightsInChat = botRightsInChat,
botIsMember = botIsMember botIsMember = botIsMember,
requestTitle = requestTitle,
requestUsername = requestUsername,
requestPhoto = requestPhoto,
) )
} }
} }

View File

@ -19,6 +19,9 @@ sealed interface KeyboardButtonRequestUsers {
val isBot: Boolean? val isBot: Boolean?
val isPremium: Boolean? val isPremium: Boolean?
val maxCount: Int val maxCount: Int
val requestName: Boolean?
val requestUsername: Boolean?
val requestPhoto: Boolean?
@Serializable @Serializable
data class Any( data class Any(
@ -27,7 +30,13 @@ sealed interface KeyboardButtonRequestUsers {
@SerialName(userIsPremiumField) @SerialName(userIsPremiumField)
override val isPremium: Boolean? = null, override val isPremium: Boolean? = null,
@SerialName(maxQuantityField) @SerialName(maxQuantityField)
override val maxCount: Int = keyboardButtonRequestUserLimit.first override val maxCount: Int = keyboardButtonRequestUserLimit.first,
@SerialName(requestNameField)
override val requestName: Boolean? = null,
@SerialName(requestUsernameField)
override val requestUsername: Boolean? = null,
@SerialName(requestPhotoField)
override val requestPhoto: Boolean? = null,
) : KeyboardButtonRequestUsers { ) : KeyboardButtonRequestUsers {
@SerialName(userIsBotField) @SerialName(userIsBotField)
@EncodeDefault @EncodeDefault
@ -41,7 +50,13 @@ sealed interface KeyboardButtonRequestUsers {
@SerialName(userIsPremiumField) @SerialName(userIsPremiumField)
override val isPremium: Boolean? = null, override val isPremium: Boolean? = null,
@SerialName(maxQuantityField) @SerialName(maxQuantityField)
override val maxCount: Int = keyboardButtonRequestUserLimit.first override val maxCount: Int = keyboardButtonRequestUserLimit.first,
@SerialName(requestNameField)
override val requestName: Boolean? = null,
@SerialName(requestUsernameField)
override val requestUsername: Boolean? = null,
@SerialName(requestPhotoField)
override val requestPhoto: Boolean? = null,
) : KeyboardButtonRequestUsers { ) : KeyboardButtonRequestUsers {
@SerialName(userIsBotField) @SerialName(userIsBotField)
@EncodeDefault @EncodeDefault
@ -53,7 +68,13 @@ sealed interface KeyboardButtonRequestUsers {
@SerialName(requestIdField) @SerialName(requestIdField)
override val requestId: RequestId, override val requestId: RequestId,
@SerialName(maxQuantityField) @SerialName(maxQuantityField)
override val maxCount: Int = keyboardButtonRequestUserLimit.first override val maxCount: Int = keyboardButtonRequestUserLimit.first,
@SerialName(requestNameField)
override val requestName: Boolean? = null,
@SerialName(requestUsernameField)
override val requestUsername: Boolean? = null,
@SerialName(requestPhotoField)
override val requestPhoto: Boolean? = null,
) : KeyboardButtonRequestUsers { ) : KeyboardButtonRequestUsers {
@SerialName(userIsBotField) @SerialName(userIsBotField)
@EncodeDefault @EncodeDefault
@ -73,7 +94,13 @@ sealed interface KeyboardButtonRequestUsers {
@SerialName(userIsPremiumField) @SerialName(userIsPremiumField)
val userIsPremium: Boolean? = null, val userIsPremium: Boolean? = null,
@SerialName(maxQuantityField) @SerialName(maxQuantityField)
val maxCount: Int = keyboardButtonRequestUserLimit.first val maxCount: Int = keyboardButtonRequestUserLimit.first,
@SerialName(requestNameField)
val requestName: Boolean? = null,
@SerialName(requestUsernameField)
val requestUsername: Boolean? = null,
@SerialName(requestPhotoField)
val requestPhoto: Boolean? = null,
) )
private val realSerializer = Surrogate.serializer() private val realSerializer = Surrogate.serializer()
@ -83,9 +110,29 @@ sealed interface KeyboardButtonRequestUsers {
val surrogate = realSerializer.deserialize(decoder) val surrogate = realSerializer.deserialize(decoder)
return when (surrogate.userIsBot) { return when (surrogate.userIsBot) {
true -> Bot(surrogate.requestId, surrogate.maxCount) true -> Bot(
false -> Common(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount) requestId = surrogate.requestId,
null -> Any(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount) maxCount = surrogate.maxCount,
requestName = surrogate.requestName,
requestUsername = surrogate.requestUsername,
requestPhoto = surrogate.requestPhoto
)
false -> Common(
requestId = surrogate.requestId,
isPremium = surrogate.userIsPremium,
maxCount = surrogate.maxCount,
requestName = surrogate.requestName,
requestUsername = surrogate.requestUsername,
requestPhoto = surrogate.requestPhoto
)
null -> Any(
requestId = surrogate.requestId,
isPremium = surrogate.userIsPremium,
maxCount = surrogate.maxCount,
requestName = surrogate.requestName,
requestUsername = surrogate.requestUsername,
requestPhoto = surrogate.requestPhoto
)
} }
} }
@ -93,10 +140,13 @@ sealed interface KeyboardButtonRequestUsers {
realSerializer.serialize( realSerializer.serialize(
encoder, encoder,
Surrogate( Surrogate(
value.requestId, requestId = value.requestId,
value.isBot, userIsBot = value.isBot,
(value as? Common) ?.isPremium, userIsPremium = (value as? Common) ?.isPremium,
value.maxCount maxCount = value.maxCount,
requestName = value.requestName,
requestUsername = value.requestUsername,
requestPhoto = value.requestPhoto
) )
) )
} }

View File

@ -4,7 +4,11 @@ import dev.inmo.tgbotapi.types.buttons.*
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
import dev.inmo.tgbotapi.types.keyboardButtonRequestUserLimit import dev.inmo.tgbotapi.types.keyboardButtonRequestUserLimit
import dev.inmo.tgbotapi.types.request.RequestId import dev.inmo.tgbotapi.types.request.RequestId
import dev.inmo.tgbotapi.types.requestNameField
import dev.inmo.tgbotapi.types.requestPhotoField
import dev.inmo.tgbotapi.types.requestUsernameField
import dev.inmo.tgbotapi.types.webapps.WebAppInfo import dev.inmo.tgbotapi.types.webapps.WebAppInfo
import kotlinx.serialization.SerialName
import kotlin.math.max import kotlin.math.max
@ -71,10 +75,19 @@ inline fun requestUsersReplyButton(
inline fun requestBotsReplyButton( inline fun requestBotsReplyButton(
text: String, text: String,
requestId: RequestId, requestId: RequestId,
maxCount: Int = keyboardButtonRequestUserLimit.first maxCount: Int = keyboardButtonRequestUserLimit.first,
requestName: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestUsersReplyButton( ) = requestUsersReplyButton(
text, text,
KeyboardButtonRequestUsers.Bot(requestId, maxCount) KeyboardButtonRequestUsers.Bot(
requestId = requestId,
maxCount = maxCount,
requestName = requestName,
requestUsername = requestUsername,
requestPhoto = requestPhoto
)
) )
/** /**
@ -84,10 +97,20 @@ inline fun requestUsersReplyButton(
text: String, text: String,
requestId: RequestId, requestId: RequestId,
premiumUser: Boolean? = null, premiumUser: Boolean? = null,
maxCount: Int = keyboardButtonRequestUserLimit.first maxCount: Int = keyboardButtonRequestUserLimit.first,
requestName: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestUsersReplyButton( ) = requestUsersReplyButton(
text, text,
KeyboardButtonRequestUsers.Common(requestId, premiumUser, maxCount) KeyboardButtonRequestUsers.Common(
requestId = requestId,
isPremium = premiumUser,
maxCount = maxCount,
requestName = requestName,
requestUsername = requestUsername,
requestPhoto = requestPhoto
)
) )
/** /**
@ -97,12 +120,18 @@ inline fun requestUserReplyButton(
text: String, text: String,
requestId: RequestId, requestId: RequestId,
premiumUser: Boolean? = null, premiumUser: Boolean? = null,
maxCount: Int = keyboardButtonRequestUserLimit.first maxCount: Int = keyboardButtonRequestUserLimit.first,
requestName: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestUsersReplyButton( ) = requestUsersReplyButton(
text, text,
requestId, requestId,
premiumUser, premiumUser,
maxCount maxCount,
requestName = requestName,
requestUsername = requestUsername,
requestPhoto = requestPhoto
) )
/** /**
@ -112,10 +141,20 @@ inline fun requestUsersOrBotsReplyButton(
text: String, text: String,
requestId: RequestId, requestId: RequestId,
premiumUser: Boolean? = null, premiumUser: Boolean? = null,
maxCount: Int = keyboardButtonRequestUserLimit.first maxCount: Int = keyboardButtonRequestUserLimit.first,
requestName: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestUsersReplyButton( ) = requestUsersReplyButton(
text, text,
KeyboardButtonRequestUsers.Any(requestId, premiumUser, maxCount) KeyboardButtonRequestUsers.Any(
requestId = requestId,
isPremium = premiumUser,
maxCount = maxCount,
requestName = requestName,
requestUsername = requestUsername,
requestPhoto = requestPhoto
)
) )
/** /**
@ -123,10 +162,18 @@ inline fun requestUsersOrBotsReplyButton(
*/ */
inline fun requestUserOrBotReplyButton( inline fun requestUserOrBotReplyButton(
text: String, text: String,
requestId: RequestId requestId: RequestId,
requestName: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestUsersReplyButton( ) = requestUsersReplyButton(
text, text,
KeyboardButtonRequestUsers.Any(requestId) KeyboardButtonRequestUsers.Any(
requestId = requestId,
requestName = requestName,
requestUsername = requestUsername,
requestPhoto = requestPhoto
)
) )
@ -153,7 +200,10 @@ inline fun requestChatReplyButton(
isOwnedBy: Boolean? = null, isOwnedBy: Boolean? = null,
userRightsInChat: ChatCommonAdministratorRights? = null, userRightsInChat: ChatCommonAdministratorRights? = null,
botRightsInChat: ChatCommonAdministratorRights? = null, botRightsInChat: ChatCommonAdministratorRights? = null,
botIsMember: Boolean = false botIsMember: Boolean = false,
requestTitle: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestChatReplyButton( ) = requestChatReplyButton(
text, text,
KeyboardButtonRequestChat( KeyboardButtonRequestChat(
@ -164,7 +214,10 @@ inline fun requestChatReplyButton(
isOwnedBy = isOwnedBy, isOwnedBy = isOwnedBy,
userRightsInChat = userRightsInChat, userRightsInChat = userRightsInChat,
botRightsInChat = botRightsInChat, botRightsInChat = botRightsInChat,
botIsMember = botIsMember botIsMember = botIsMember,
requestTitle = requestTitle,
requestUsername = requestUsername,
requestPhoto = requestPhoto,
) )
) )
@ -178,7 +231,10 @@ inline fun requestChannelReplyButton(
isOwnedBy: Boolean? = null, isOwnedBy: Boolean? = null,
userRightsInChat: ChatCommonAdministratorRights? = null, userRightsInChat: ChatCommonAdministratorRights? = null,
botRightsInChat: ChatCommonAdministratorRights? = null, botRightsInChat: ChatCommonAdministratorRights? = null,
botIsMember: Boolean = false botIsMember: Boolean = false,
requestTitle: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestChatReplyButton( ) = requestChatReplyButton(
text, text,
KeyboardButtonRequestChat.Channel( KeyboardButtonRequestChat.Channel(
@ -187,7 +243,10 @@ inline fun requestChannelReplyButton(
isOwnedBy = isOwnedBy, isOwnedBy = isOwnedBy,
userRightsInChat = userRightsInChat, userRightsInChat = userRightsInChat,
botRightsInChat = botRightsInChat, botRightsInChat = botRightsInChat,
botIsMember = botIsMember botIsMember = botIsMember,
requestTitle = requestTitle,
requestUsername = requestUsername,
requestPhoto = requestPhoto,
) )
) )
@ -203,7 +262,10 @@ inline fun requestChannelReplyButton(
isOwnedBy: Boolean? = null, isOwnedBy: Boolean? = null,
userRightsInChat: ChatCommonAdministratorRights? = null, userRightsInChat: ChatCommonAdministratorRights? = null,
botRightsInChat: ChatCommonAdministratorRights? = null, botRightsInChat: ChatCommonAdministratorRights? = null,
botIsMember: Boolean? = null botIsMember: Boolean? = null,
requestTitle: Boolean? = null,
requestUsername: Boolean? = null,
requestPhoto: Boolean? = null,
) = requestChatReplyButton( ) = requestChatReplyButton(
text, text,
KeyboardButtonRequestChat.Group( KeyboardButtonRequestChat.Group(
@ -213,6 +275,9 @@ inline fun requestChannelReplyButton(
isOwnedBy = isOwnedBy, isOwnedBy = isOwnedBy,
userRightsInChat = userRightsInChat, userRightsInChat = userRightsInChat,
botRightsInChat = botRightsInChat, botRightsInChat = botRightsInChat,
botIsMember = botIsMember botIsMember = botIsMember,
requestTitle = requestTitle,
requestUsername = requestUsername,
requestPhoto = requestPhoto,
) )
) )

View File

@ -16,6 +16,12 @@ sealed interface PrivateChat : Chat, UsernameChat {
val lastName: String val lastName: String
} }
@Serializable(ChatSerializer::class)
sealed interface BusinessChat : Chat {
override val id: BusinessChatId
val original: PrivateChat
}
@Serializable(ChatSerializer::class) @Serializable(ChatSerializer::class)
sealed interface PublicChat : Chat { sealed interface PublicChat : Chat {
val title: String val title: String

View File

@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.types.chat package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
import kotlinx.serialization.* import kotlinx.serialization.*
@ -62,8 +63,9 @@ object ChatSerializer : KSerializer<Chat> {
return try { return try {
formatter.decodeFromJsonElement(ExtendedChatSerializer, decodedJson) formatter.decodeFromJsonElement(ExtendedChatSerializer, decodedJson)
} catch (e: SerializationException) { } catch (e: SerializationException) {
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson") val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
val original = decodedJson[originField]
when (type) { when (type) {
ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson) ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
@ -80,6 +82,12 @@ object ChatSerializer : KSerializer<Chat> {
decodedJson.toString(), decodedJson.toString(),
decodedJson decodedJson
) )
null -> {
when {
original != null -> formatter.decodeFromJsonElement(BusinessChatImpl.serializer(), decodedJson)
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
}
}
} }
} }
} }
@ -101,8 +109,9 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
override fun deserialize(decoder: Decoder): PreviewChat { override fun deserialize(decoder: Decoder): PreviewChat {
val decodedJson = JsonObject.serializer().deserialize(decoder) val decodedJson = JsonObject.serializer().deserialize(decoder)
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson") val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
val original = decodedJson[originField]
return when (type) { return when (type) {
ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson) ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
@ -119,12 +128,19 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
decodedJson.toString(), decodedJson.toString(),
decodedJson decodedJson
) )
null -> {
when {
original != null -> formatter.decodeFromJsonElement(PreviewBusinessChat.serializer(), decodedJson)
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
}
}
} }
} }
override fun serialize(encoder: Encoder, value: PreviewChat) { override fun serialize(encoder: Encoder, value: PreviewChat) {
when (value) { when (value) {
is PrivateChatImpl -> PrivateChatImpl.serializer().serialize(encoder, value) is PrivateChatImpl -> PrivateChatImpl.serializer().serialize(encoder, value)
is BusinessChatImpl -> BusinessChatImpl.serializer().serialize(encoder, value)
is GroupChatImpl -> GroupChatImpl.serializer().serialize(encoder, value) is GroupChatImpl -> GroupChatImpl.serializer().serialize(encoder, value)
is SupergroupChatImpl -> SupergroupChatImpl.serializer().serialize(encoder, value) is SupergroupChatImpl -> SupergroupChatImpl.serializer().serialize(encoder, value)
is ForumChatImpl -> ForumChatImpl.serializer().serialize(encoder, value) is ForumChatImpl -> ForumChatImpl.serializer().serialize(encoder, value)
@ -144,8 +160,9 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
override fun deserialize(decoder: Decoder): ExtendedChat { override fun deserialize(decoder: Decoder): ExtendedChat {
val decodedJson = JsonObject.serializer().deserialize(decoder) val decodedJson = JsonObject.serializer().deserialize(decoder)
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson") val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
val original = decodedJson[originField]
return when (type) { return when (type) {
ChatType.Sender -> formatter.decodeFromJsonElement(ExtendedPrivateChatImpl.serializer(), decodedJson) ChatType.Sender -> formatter.decodeFromJsonElement(ExtendedPrivateChatImpl.serializer(), decodedJson)
@ -162,11 +179,18 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
decodedJson.toString(), decodedJson.toString(),
decodedJson decodedJson
) )
null -> {
when {
original != null -> formatter.decodeFromJsonElement(ExtendedBusinessChatImpl.serializer(), decodedJson)
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
}
}
} }
} }
override fun serialize(encoder: Encoder, value: ExtendedChat) { override fun serialize(encoder: Encoder, value: ExtendedChat) {
when (value) { when (value) {
is ExtendedBusinessChatImpl -> ExtendedBusinessChatImpl.serializer().serialize(encoder, value)
is ExtendedPrivateChatImpl -> ExtendedPrivateChatImpl.serializer().serialize(encoder, value) is ExtendedPrivateChatImpl -> ExtendedPrivateChatImpl.serializer().serialize(encoder, value)
is ExtendedGroupChatImpl -> ExtendedGroupChatImpl.serializer().serialize(encoder, value) is ExtendedGroupChatImpl -> ExtendedGroupChatImpl.serializer().serialize(encoder, value)
is ExtendedSupergroupChatImpl -> ExtendedSupergroupChatImpl.serializer().serialize(encoder, value) is ExtendedSupergroupChatImpl -> ExtendedSupergroupChatImpl.serializer().serialize(encoder, value)
@ -190,6 +214,20 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
} }
} }
} }
class BasedOnBusinessConnection(private val businessConnectionId: BusinessConnectionId) : ExtendedChatSerializer() {
override fun deserialize(decoder: Decoder): ExtendedChat {
return super.deserialize(decoder).let {
if (it is ExtendedPrivateChatImpl) {
ExtendedBusinessChatImpl(
BusinessChatId(it.id.chatId, businessConnectionId),
it
)
} else {
it
}
}
}
}
companion object : ExtendedChatSerializer() companion object : ExtendedChatSerializer()
} }

View File

@ -1,6 +1,9 @@
package dev.inmo.tgbotapi.types.chat package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
@ -124,6 +127,17 @@ data class ExtendedPrivateChatImpl(
override val backgroundCustomEmojiId: CustomEmojiId? = null, override val backgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(profileBackgroundCustomEmojiIdField) @SerialName(profileBackgroundCustomEmojiIdField)
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(businessIntroField)
override val businessIntro: BusinessIntro? = null,
@SerialName(businessLocationField)
override val businessLocation: BusinessLocation? = null,
@SerialName(businessOpeningHoursField)
override val businessOpeningHours: BusinessOpeningHours? = null,
@SerialName(birthdateField)
override val birthdate: Birthdate? = null,
@SerialName(personalChatField)
@Serializable(PreviewChatSerializer::class)
override val personalChat: PreviewChannelChat? = null
) : ExtendedPrivateChat ) : ExtendedPrivateChat
typealias ExtendedUser = ExtendedPrivateChatImpl typealias ExtendedUser = ExtendedPrivateChatImpl
@ -254,6 +268,7 @@ data class ExtendedForumChatImpl(
@Serializable @Serializable
data class ExtendedBot( data class ExtendedBot(
@SerialName(idField)
override val id: UserId, override val id: UserId,
@SerialName(firstNameField) @SerialName(firstNameField)
override val firstName: String, override val firstName: String,
@ -267,6 +282,8 @@ data class ExtendedBot(
val canReadAllGroupMessages: Boolean = false, val canReadAllGroupMessages: Boolean = false,
@SerialName(supportInlineQueriesField) @SerialName(supportInlineQueriesField)
val supportsInlineQueries: Boolean = false, val supportsInlineQueries: Boolean = false,
@SerialName(canConnectToBusinessField)
val canConnectToBusiness: Boolean = false,
@SerialName(photoField) @SerialName(photoField)
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,
@SerialName(accentColorIdField) @SerialName(accentColorIdField)
@ -282,6 +299,14 @@ data class ExtendedBot(
private val isBot = true private val isBot = true
} }
@Serializable
data class ExtendedBusinessChatImpl(
@SerialName(idField)
override val id: BusinessChatId,
@SerialName(originField)
override val original: ExtendedPrivateChat
) : ExtendedBusinessChat, ExtendedChat by original
data class UnknownExtendedChat( data class UnknownExtendedChat(
override val id: IdChatIdentifier, override val id: IdChatIdentifier,
val raw: String, val raw: String,

View File

@ -1,6 +1,9 @@
package dev.inmo.tgbotapi.types.chat package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
@ -39,6 +42,13 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
val hasPrivateForwards: Boolean val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean val hasRestrictedVoiceAndVideoMessages: Boolean
val businessIntro: BusinessIntro?
val businessLocation: BusinessLocation?
val businessOpeningHours: BusinessOpeningHours?
val birthdate: Birthdate?
val personalChat: PreviewChannelChat?
val allowCreateUserIdLink: Boolean val allowCreateUserIdLink: Boolean
get() = hasPrivateForwards get() = hasPrivateForwards
} }
@ -86,3 +96,8 @@ sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat { sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
val activeUsernames: List<Username> val activeUsernames: List<Username>
} }
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedBusinessChat : BusinessChat, ExtendedChat {
override val original: ExtendedPrivateChat
}

View File

@ -30,6 +30,15 @@ data class PrivateChatImpl(
override val lastName: String = "" override val lastName: String = ""
) : PreviewPrivateChat ) : PreviewPrivateChat
@Serializable
@RiskFeature("This class is a subject of changes. It is better to use PrivateChat due")
data class BusinessChatImpl(
@SerialName(idField)
override val id: BusinessChatId,
@SerialName(originField)
override val original: PreviewPrivateChat
) : PreviewBusinessChat
@Serializable @Serializable
@RiskFeature("This class is a subject of changes. It is better to use SupergroupChat due") @RiskFeature("This class is a subject of changes. It is better to use SupergroupChat due")
data class SupergroupChatImpl( data class SupergroupChatImpl(

View File

@ -11,6 +11,9 @@ sealed interface PreviewUsernameChat : PreviewChat, UsernameChat
@Serializable(PreviewChatSerializer::class) @Serializable(PreviewChatSerializer::class)
sealed interface PreviewPrivateChat : PreviewUsernameChat, PrivateChat sealed interface PreviewPrivateChat : PreviewUsernameChat, PrivateChat
@Serializable(PreviewChatSerializer::class)
sealed interface PreviewBusinessChat : BusinessChat, PreviewChat
@Serializable(PreviewChatSerializer::class) @Serializable(PreviewChatSerializer::class)
sealed interface PreviewPublicChat : PreviewChat, PublicChat sealed interface PreviewPublicChat : PreviewChat, PublicChat

View File

@ -29,7 +29,7 @@ data class StickerSurrogate(
val mask_position: MaskPosition? = null, val mask_position: MaskPosition? = null,
val custom_emoji_id: CustomEmojiId? = null, val custom_emoji_id: CustomEmojiId? = null,
val file_size: Long? = null, val file_size: Long? = null,
val needs_repainting: Boolean = false val needs_repainting: Boolean = false,
) )
// TODO:: Serializer // TODO:: Serializer
@ -40,9 +40,9 @@ sealed interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile,
val stickerFormat: StickerFormat val stickerFormat: StickerFormat
val isAnimated val isAnimated
get() = false get() = stickerFormat is StickerFormat.Animated
val isVideo val isVideo
get() = false get() = stickerFormat is StickerFormat.Video
val type: StickerType val type: StickerType
fun asInputSticker(emojis: List<String> = emoji ?.let { listOf(it) } ?: error("Unable to create input sticker without emojis")): InputSticker fun asInputSticker(emojis: List<String> = emoji ?.let { listOf(it) } ?: error("Unable to create input sticker without emojis")): InputSticker
@ -238,6 +238,7 @@ sealed interface RegularSticker : Sticker {
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular( override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
fileId, fileId,
stickerFormat,
emojis, emojis,
emptyList() emptyList()
) )
@ -339,6 +340,7 @@ sealed interface MaskSticker : Sticker {
override fun asInputSticker(emojis: List<String>) = InputSticker.Mask( override fun asInputSticker(emojis: List<String>) = InputSticker.Mask(
fileId, fileId,
stickerFormat,
emojis, emojis,
maskPosition maskPosition
) )
@ -439,6 +441,7 @@ sealed interface CustomEmojiSticker : Sticker {
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.CustomEmoji( override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.CustomEmoji(
fileId, fileId,
stickerFormat,
emojis, emojis,
emptyList() emptyList()
) )
@ -563,6 +566,7 @@ data class UnknownSticker(
) : Sticker { ) : Sticker {
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular( override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
fileId, fileId,
stickerFormat,
emojis, emojis,
emptyList() emptyList()
) )

View File

@ -0,0 +1,65 @@
package dev.inmo.tgbotapi.types.message
import korlibs.time.DateTime
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.*
import dev.inmo.tgbotapi.types.chat.CommonBot
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage
import dev.inmo.tgbotapi.types.message.content.MessageContent
data class BusinessContentMessageImpl<T: MessageContent>(
override val messageId: MessageId,
override val from: User,
override val chat: PreviewBusinessChat,
override val businessConnectionId: BusinessConnectionId,
override val content: T,
override val date: DateTime,
override val editDate: DateTime?,
override val hasProtectedContent: Boolean,
override val forwardOrigin: MessageOrigin?,
override val replyInfo: ReplyInfo?,
override val replyMarkup: InlineKeyboardMarkup?,
override val senderBot: CommonBot?,
override val mediaGroupId: MediaGroupId?,
override val senderBusinessBot: PreviewBot?,
override val fromOffline: Boolean,
) : BusinessContentMessage<T> {
constructor(
messageId: MessageId,
from: User,
chat: PreviewBusinessChat,
businessConnectionId: BusinessConnectionId,
content: T,
date: DateTime,
editDate: DateTime?,
hasProtectedContent: Boolean,
forwardInfo: ForwardInfo,
replyTo: AccessibleMessage?,
replyMarkup: InlineKeyboardMarkup?,
senderBot: CommonBot?,
mediaGroupId: MediaGroupId?,
senderBusinessBot: PreviewBot?,
fromOffline: Boolean,
) : this(
messageId = messageId,
from = from,
chat = chat,
businessConnectionId = businessConnectionId,
content = content,
date = date,
editDate = editDate,
hasProtectedContent = hasProtectedContent,
forwardOrigin = forwardInfo.messageOrigin(),
replyInfo = replyTo ?.let { ReplyInfo.Internal(it) },
replyMarkup = replyMarkup,
senderBot = senderBot,
mediaGroupId = mediaGroupId,
senderBusinessBot = senderBusinessBot,
fromOffline = fromOffline
)
}

Some files were not shown because too many files have changed in this diff Show More