mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-17 12:30:20 +00:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 24269cc774 | |||
| d960d94c0d | |||
| 663d63b009 | |||
| 7118631213 | |||
| ff34017a03 | |||
| 96a7a2acab | |||
| 71c830fc2e | |||
| 271e7d2157 | |||
| cf5e5a1d1e | |||
| 186d6931ac | |||
| 6ec686040c | |||
| 211cef298c | |||
| 8de41bdd99 | |||
| 7a5c9c7ef8 | |||
| 4dec85ee60 | |||
| 4622509356 | |||
| 30e44d6bf2 | |||
| e403bbca0b | |||
| 93e06a5765 | |||
| 718f6ab366 | |||
| 6f776576ab | |||
| fcdaeb2e8f | |||
| 1e679ce50b | |||
| fe4be69051 | |||
| 06ba14e8be | |||
| ca1b196942 | |||
| dc5d8afe32 | |||
| b843fd9188 | |||
| d56173eceb | |||
| 97621bca67 | |||
| 7e986b2088 | |||
| cfc2fd1b47 | |||
| 905486fff9 | |||
| 6acf4bc927 | |||
| 64a1aeef2c | |||
| 6db88eb8bd | |||
| 4e416aaf44 | |||
| 71b9f15e40 | |||
| 4dc2bfc8bf | |||
| 31c1055f3d | |||
| 3da2229a9c | |||
| 624289cc8e | |||
| 9edc8a0d5a | |||
| 3bf914471a | |||
| 7d3c8a2d27 |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,5 +1,39 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 14.0.1
|
||||||
|
|
||||||
|
* In `core` and `api` modules related to invoices changed their APIs to suite current API
|
||||||
|
|
||||||
|
## 14.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
|
||||||
|
* All the methods/classes related to sending of messages got `effectId` parameter
|
||||||
|
* All the methods/classes related to sending of photos/animations/videos got `showCaptionAboveMedia` parameter
|
||||||
|
|
||||||
|
## 13.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.3](https://core.telegram.org/bots/api-changelog#may-6-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* For polls, `textSources` now means `question` text sources. For `QuizPoll` there are `explanation` and `explanationTextSources`
|
||||||
|
for hinting
|
||||||
|
* `API`:
|
||||||
|
* A lot of API related to `Poll`s has been changed to include opportunity to pass `ParseMode` and `TextSource`s list
|
||||||
|
|
||||||
|
## 12.0.1
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Ktor`: `2.3.9` -> `2.3.10`
|
||||||
|
* `MicroUtils`: `0.20.39` -> `0.20.45`
|
||||||
|
* `UUID`: `0.8.2` -> `0.8.4`
|
||||||
|
|
||||||
## 12.0.0
|
## 12.0.0
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#march-31-2024)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#may-28-2024)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
|
|||||||
@@ -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=12.0.0
|
library_version=14.0.1
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ kotlin-coroutines = "1.8.0"
|
|||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.4.0"
|
korlibs = "5.4.0"
|
||||||
uuid = "0.8.2"
|
uuid = "0.8.4"
|
||||||
ktor = "2.3.9"
|
ktor = "2.3.10"
|
||||||
|
|
||||||
ksp = "1.9.23-1.0.19"
|
ksp = "1.9.23-1.0.20"
|
||||||
kotlin-poet = "1.16.0"
|
kotlin-poet = "1.16.0"
|
||||||
|
|
||||||
microutils = "0.20.39"
|
microutils = "0.20.45"
|
||||||
kslog = "1.3.3"
|
kslog = "1.3.3"
|
||||||
|
|
||||||
versions = "0.51.0"
|
versions = "0.51.0"
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -46,26 +46,35 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
||||||
while (isActive) {
|
null
|
||||||
delay(liveTimeMillis)
|
} else {
|
||||||
// Remove previous location message info to resend live location message
|
CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||||
currentLiveLocationMessage = null
|
while (isActive) {
|
||||||
|
delay(liveTimeMillis)
|
||||||
|
// Remove previous location message info to resend live location message
|
||||||
|
currentLiveLocationMessage = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
locationsFlow.collect {
|
locationsFlow.collect {
|
||||||
val capturedLiveLocationMessage = currentLiveLocationMessage
|
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||||
if (capturedLiveLocationMessage == null) {
|
if (capturedLiveLocationMessage == null) {
|
||||||
updateMessageJob.start()
|
updateMessageJob ?.start()
|
||||||
currentLiveLocationMessage = send(
|
currentLiveLocationMessage = send(
|
||||||
chatId,
|
chatId,
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
|
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
||||||
|
LiveLocation.INDEFINITE_LIVE_PERIOD
|
||||||
|
} else {
|
||||||
|
ceil(liveTimeMillis.toDouble() / 1000).toInt()
|
||||||
|
},
|
||||||
it.horizontalAccuracy,
|
it.horizontalAccuracy,
|
||||||
it.heading,
|
it.heading,
|
||||||
it.proximityAlertRadius,
|
it.proximityAlertRadius,
|
||||||
@@ -73,6 +82,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
@@ -80,13 +90,13 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
edit(
|
edit(
|
||||||
capturedLiveLocationMessage,
|
message = capturedLiveLocationMessage,
|
||||||
it.latitude,
|
latitude = it.latitude,
|
||||||
it.longitude,
|
longitude = it.longitude,
|
||||||
it.horizontalAccuracy,
|
horizontalAccuracy = it.horizontalAccuracy,
|
||||||
it.heading,
|
heading = it.heading,
|
||||||
it.proximityAlertRadius,
|
proximityAlertRadius = it.proximityAlertRadius,
|
||||||
it.replyMarkup
|
replyMarkup = it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
sentMessageFlow ?.emit(it)
|
sentMessageFlow ?.emit(it)
|
||||||
}
|
}
|
||||||
@@ -108,12 +118,13 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map {
|
locationsFlow = locationsFlow.map {
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -123,13 +134,14 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
sentMessageFlow
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,23 +159,25 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map { (lat, long) ->
|
locationsFlow = locationsFlow.map { (lat, long) ->
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
lat,
|
lat,
|
||||||
long
|
long
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
sentMessageFlow
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
||||||
|
const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see startLiveLocation
|
* @see startLiveLocation
|
||||||
@@ -98,6 +99,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
@@ -115,6 +117,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -145,6 +148,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -160,6 +164,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -180,6 +185,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -195,6 +201,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -215,6 +222,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -230,6 +238,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -251,6 +260,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -266,6 +276,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -286,6 +297,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -300,6 +312,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ suspend fun <T> TelegramBot.edit(
|
|||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, text, parseMode, replyMarkup)
|
return editMessageCaption(message, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,9 +42,10 @@ suspend fun <T> TelegramBot.edit(
|
|||||||
suspend fun <T> TelegramBot.edit(
|
suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, entities, replyMarkup)
|
return editMessageCaption(message, entities, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,11 +57,12 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, 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]
|
||||||
@@ -70,11 +73,12 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, 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]
|
||||||
@@ -84,11 +88,12 @@ suspend fun TelegramBot.edit(
|
|||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, 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]
|
||||||
|
|||||||
@@ -68,9 +68,10 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -79,9 +80,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -89,11 +91,12 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -102,7 +105,8 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,8 +39,9 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, text, parseMode, showCaptionAboveMedia, 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]
|
||||||
@@ -49,10 +51,11 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +66,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, entities, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,8 +80,9 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, entities, showCaptionAboveMedia, 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]
|
||||||
@@ -86,10 +91,11 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,7 +106,8 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup)
|
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,14 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageLiveLocation(
|
EditChatMessageLiveLocation(
|
||||||
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
|
chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,11 +38,12 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, 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]
|
||||||
@@ -51,11 +53,12 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, 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]
|
||||||
@@ -68,7 +71,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageLiveLocation(
|
EditChatMessageLiveLocation(
|
||||||
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
|
chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, 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]
|
||||||
@@ -91,4 +94,4 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -30,9 +31,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, entities, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -41,10 +43,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, 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]
|
||||||
@@ -53,7 +56,8 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -31,6 +32,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -49,12 +51,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -66,12 +69,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -83,12 +87,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +105,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -111,6 +117,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -128,12 +135,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -144,12 +152,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -160,12 +169,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -176,12 +186,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -192,12 +203,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -207,12 +219,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -222,12 +235,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, 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
|
||||||
@@ -239,6 +253,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -251,6 +266,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -269,6 +285,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -280,6 +297,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -297,6 +315,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -308,6 +327,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -325,6 +345,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -336,6 +357,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -353,6 +375,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -364,6 +387,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -381,6 +405,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -391,6 +416,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -407,6 +433,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -417,6 +444,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId,
|
fromChatId,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -433,6 +461,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -443,6 +472,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -24,13 +25,14 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
) as ContentMessage<T>
|
) as ContentMessage<T>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will send [content] to the [chatId] as is
|
* This method will send [content] to the [chat] as is
|
||||||
*/
|
*/
|
||||||
suspend inline fun <T : MessageContent> TelegramBot.resend(
|
suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
@@ -38,6 +40,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -46,6 +49,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -61,6 +65,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -69,6 +74,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -84,6 +90,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -92,6 +99,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,11 +40,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -60,10 +62,11 @@ suspend fun TelegramBot.sendContact(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,8 +80,9 @@ suspend fun TelegramBot.sendContact(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ suspend fun TelegramBot.sendDice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,6 +37,7 @@ suspend fun TelegramBot.sendDice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -39,6 +40,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -59,6 +61,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -73,6 +76,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -93,6 +97,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -107,6 +112,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -126,22 +132,24 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chatId = chat.id,
|
||||||
location.latitude,
|
latitude = location.latitude,
|
||||||
location.longitude,
|
longitude = location.longitude,
|
||||||
livePeriod,
|
livePeriod = livePeriod,
|
||||||
horizontalAccuracy,
|
horizontalAccuracy = horizontalAccuracy,
|
||||||
heading,
|
heading = heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius = proximityAlertRadius,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,9 +168,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -179,9 +188,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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,9 +209,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -218,6 +229,7 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -37,6 +38,7 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -55,10 +57,11 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,9 +77,10 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,9 +96,10 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -108,14 +113,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -126,14 +132,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -144,10 +151,11 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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,14 +169,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -179,14 +188,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -197,10 +207,11 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -214,12 +225,13 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -230,14 +242,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -248,10 +261,11 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -266,12 +280,13 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -282,14 +297,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -300,7 +316,8 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -31,6 +32,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -47,6 +49,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -57,6 +60,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -73,6 +77,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -83,6 +88,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -98,6 +104,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -108,6 +115,7 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -124,9 +132,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -139,9 +148,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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,9 +165,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -170,6 +181,7 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -44,6 +45,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -67,6 +69,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -83,6 +86,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -104,6 +108,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -120,6 +125,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -141,6 +147,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -157,6 +164,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -172,6 +180,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -182,6 +191,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -198,6 +208,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -207,6 +218,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
businessConnectionId = businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,6 @@ import dev.inmo.tgbotapi.types.chat.Chat
|
|||||||
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
|
||||||
import dev.inmo.tgbotapi.types.reactions.Reaction
|
import dev.inmo.tgbotapi.types.reactions.Reaction
|
||||||
import kotlin.js.JsName
|
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
suspend fun TelegramBot.setMessageReactions(
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ suspend fun TelegramBot.sendGame(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendGame(
|
SendGame(
|
||||||
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -38,10 +39,11 @@ suspend fun TelegramBot.sendGame(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,10 +57,11 @@ suspend fun TelegramBot.sendGame(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,8 +75,9 @@ suspend fun TelegramBot.sendGame(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -29,25 +30,28 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -60,6 +64,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -68,10 +73,27 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId = chatId,
|
||||||
|
animation = animation.fileId,
|
||||||
|
thumb = animation.thumbnail ?.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,6 +106,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -92,9 +115,28 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
thumb = thumb,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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,6 +147,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -113,9 +156,27 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,6 +188,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: InputFile,
|
animation: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -135,24 +197,27 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -164,6 +229,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -172,10 +238,26 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId = chatId,
|
||||||
|
animation = animation.fileId,
|
||||||
|
thumb = animation.thumbnail ?.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,6 +269,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: InputFile,
|
animation: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -195,9 +278,27 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
thumb = thumb,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -207,6 +308,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -215,6 +317,23 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -44,6 +45,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -66,9 +68,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -84,9 +87,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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,9 +106,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,6 +128,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -138,6 +144,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -159,9 +166,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -176,9 +184,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -193,6 +202,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -39,6 +40,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
@@ -59,10 +61,11 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -77,11 +80,12 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,10 +101,11 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -115,6 +120,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -128,6 +134,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
@@ -147,10 +154,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -164,11 +172,12 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -183,7 +192,8 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendMediaGroup<MediaGroupPartContent>(
|
SendMediaGroup<MediaGroupPartContent>(
|
||||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,9 +43,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,9 +61,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,9 +79,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,10 +95,11 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPlaylist(
|
SendPlaylist(
|
||||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -108,9 +113,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,9 +130,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,9 +147,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,10 +163,11 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDocumentsGroup(
|
SendDocumentsGroup(
|
||||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -172,9 +181,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,9 +198,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,9 +215,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -219,10 +231,11 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVisualMediaGroup(
|
SendVisualMediaGroup(
|
||||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -236,9 +249,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -252,9 +266,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -268,7 +283,8 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,26 +20,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
fileId,
|
photo = fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52,14 +56,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
fileId = fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -70,14 +90,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photo: Photo,
|
photo: Photo,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -88,14 +124,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photo: Photo,
|
photo: Photo,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photo = photo,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -106,14 +158,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photoSize.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -124,14 +192,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photoSize = photoSize,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,25 +226,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
fileId,
|
photo = fileId,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -172,14 +260,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
fileId = fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -189,14 +292,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: Photo,
|
photo: Photo,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -206,14 +324,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
photo: Photo,
|
photo: Photo,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photo = photo,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -223,14 +356,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photoSize.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -240,11 +388,26 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photoSize = photoSize,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,9 +40,10 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, 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
|
||||||
@@ -55,9 +57,10 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, 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
|
||||||
@@ -71,6 +74,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -29,26 +30,29 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
null,
|
height = height,
|
||||||
threadId,
|
supportStreaming = null,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -61,14 +65,34 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chatId,
|
||||||
|
video = video.fileId,
|
||||||
|
thumb = video.thumbnail ?.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = video.duration,
|
||||||
|
width = video.width,
|
||||||
|
height = video.height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -80,6 +104,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -88,9 +113,28 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
thumb = thumb,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,14 +146,30 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -120,6 +180,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
video: InputFile,
|
video: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -128,25 +189,28 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
null,
|
height = height,
|
||||||
threadId,
|
supportStreaming = null,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -158,14 +222,33 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chatId,
|
||||||
|
video = video.fileId,
|
||||||
|
thumb = video.thumbnail ?.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = video.duration,
|
||||||
|
width = video.width,
|
||||||
|
height = video.height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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
|
||||||
@@ -176,6 +259,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
video: InputFile,
|
video: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -184,9 +268,27 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
thumb = thumb,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,11 +299,26 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, entities, spoilered, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -36,6 +37,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -52,10 +54,11 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
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, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,9 +75,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -87,6 +91,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -38,6 +39,7 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -57,9 +59,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -74,10 +77,11 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,9 +97,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,6 +116,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -123,6 +129,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
duration = duration,
|
duration = duration,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -141,9 +148,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -157,10 +165,11 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, 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
|
||||||
@@ -174,6 +183,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
|
|
||||||
suspend fun TelegramBot.createInvoiceLink(
|
suspend fun TelegramBot.createInvoiceLink(
|
||||||
title: String,
|
title: String,
|
||||||
@@ -29,3 +30,25 @@ suspend fun TelegramBot.createInvoiceLink(
|
|||||||
) = execute(
|
) = execute(
|
||||||
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For links witn XTR currency and using of Telegram Stars
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.createInvoiceLink(
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
requireName: Boolean = false,
|
||||||
|
requirePhoneNumber: Boolean = false,
|
||||||
|
requireEmail: Boolean = false,
|
||||||
|
requireShippingAddress: Boolean = false,
|
||||||
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
|
priceDependOnShipAddress: Boolean = false
|
||||||
|
) = execute(
|
||||||
|
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||||
|
)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.payments
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.payments.RefundStarPayment
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.payments.SuccessfulPayment
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
|
||||||
|
|
||||||
|
suspend fun TelegramBot.refundStarPayment(
|
||||||
|
userId: UserId,
|
||||||
|
telegramPaymentChargeId: TelegramPaymentChargeId
|
||||||
|
) = execute(RefundStarPayment(userId, telegramPaymentChargeId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.refundStarPayment(
|
||||||
|
userId: UserId,
|
||||||
|
successfulPayment: SuccessfulPayment
|
||||||
|
) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId)
|
||||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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]
|
||||||
@@ -34,10 +35,11 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,6 +67,63 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendInvoice(
|
||||||
|
chatId: IdChatIdentifier,
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
price: LabeledPrice,
|
||||||
|
startParameter: StartParameter? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendInvoice(chatId, title, description, payload, price, startParameter, providerData, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendInvoice(
|
||||||
|
user: CommonUser,
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
price: LabeledPrice,
|
||||||
|
startParameter: StartParameter? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = sendInvoice(
|
||||||
|
chatId = user.id,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
payload = payload,
|
||||||
|
price = price,
|
||||||
|
startParameter = startParameter,
|
||||||
|
providerData = providerData,
|
||||||
|
threadId = null,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,299 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send.polls
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
|
||||||
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.ParseMode
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
allowMultipleAnswers: Boolean = false,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
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
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
poll: RegularPoll,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
question: String = poll.question,
|
|
||||||
options: List<String> = poll.options.map { it.text },
|
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = 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
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
allowMultipleAnswers: Boolean = false,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendRegularPoll(
|
|
||||||
chat.id, 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
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chat: Chat,
|
|
||||||
poll: RegularPoll,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
question: String = poll.question,
|
|
||||||
options: List<String> = poll.options.map { it.text },
|
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendRegularPoll(
|
|
||||||
chat.id, 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
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
SendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
SendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,325 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
||||||
|
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.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanation,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanation,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||||
|
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.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
questionParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
closeInfo,
|
||||||
|
questionParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
closeInfo,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -454,6 +454,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
|||||||
public static synthetic fun waitChannelChatCreatedEvents$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 waitChannelChatCreatedEvents$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 waitChannelEvents (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 waitChannelEvents (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 waitChannelEvents$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 waitChannelEvents$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 waitChatBackgroundSet (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 waitChatBackgroundSet$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 waitChatBoostAdded (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 waitChatBoostAdded (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 waitChatBoostAdded$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 waitChatBoostAdded$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 waitChatEvents (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 waitChatEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
@@ -539,6 +541,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
|||||||
public static synthetic fun waitChannelChatCreatedEventsMessages$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 waitChannelChatCreatedEventsMessages$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 waitChannelEventsMessages (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 waitChannelEventsMessages (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 waitChannelEventsMessages$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 waitChannelEventsMessages$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 waitChatBackgroundSetEventsMessages (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 waitChatBackgroundSetEventsMessages$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 waitChatBoostAddedEventsMessages (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 waitChatBoostAddedEventsMessages (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 waitChatBoostAddedEventsMessages$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 waitChatBoostAddedEventsMessages$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 waitChatEventsMessages (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 waitChatEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
@@ -1011,6 +1015,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
|||||||
public static synthetic fun onChannelChatCreated$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 onChannelChatCreated$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 onChannelEvent (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 onChannelEvent (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 onChannelEvent$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 onChannelEvent$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 onChatBackgroundSet (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 onChatBackgroundSet$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 onChatBoostAdded (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 onChatBoostAdded (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 onChatBoostAdded$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 onChatBoostAdded$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 onChatEvent (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 onChatEvent (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;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
@@ -219,3 +220,8 @@ suspend fun BehaviourContext.waitChatBoostAdded(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
|
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitChatBackgroundSet(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<ChatBackground>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
@@ -213,3 +214,8 @@ suspend fun BehaviourContext.waitChatBoostAddedEventsMessages(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
|
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitChatBackgroundSetEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<ChatBackground>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
@@ -844,3 +845,23 @@ suspend fun <BC : BehaviourContext> BC.onChatBoostAdded(
|
|||||||
markerFactory: MarkerFactory<in ChatEventMessage<ChatBoostAdded>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in ChatEventMessage<ChatBoostAdded>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBoostAdded>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBoostAdded>>
|
||||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.onChatBackgroundSet(
|
||||||
|
initialFilter: SimpleFilter<ChatEventMessage<ChatBackground>>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<ChatBackground>, Update>? = MessageFilterByChat,
|
||||||
|
markerFactory: MarkerFactory<in ChatEventMessage<ChatBackground>, Any> = ByChatMessageMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChatBackground>>
|
||||||
|
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Priced
|
|||||||
interface CommonSendInvoiceData : Titled, Currencied, Priced {
|
interface CommonSendInvoiceData : Titled, Currencied, Priced {
|
||||||
val description: String
|
val description: String
|
||||||
val payload: String
|
val payload: String
|
||||||
val providerToken: String
|
val providerToken: String?
|
||||||
val maxTipAmount: Int?
|
val maxTipAmount: Int?
|
||||||
val suggestedTipAmounts: List<Int>?
|
val suggestedTipAmounts: List<Int>?
|
||||||
val providerData: String?
|
val providerData: String?
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package dev.inmo.tgbotapi.abstracts
|
||||||
|
|
||||||
|
interface WithCustomizableCaption : Texted {
|
||||||
|
val showCaptionAboveMedia: Boolean
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package dev.inmo.tgbotapi.abstracts.types
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.types.EffectId
|
||||||
|
|
||||||
|
interface OptionallyWithEffectId {
|
||||||
|
val effectId: EffectId?
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.edit.caption
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||||
import dev.inmo.tgbotapi.requests.edit.media.MediaContentMessageResultDeserializer
|
import dev.inmo.tgbotapi.requests.edit.media.MediaContentMessageResultDeserializer
|
||||||
|
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
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
|
||||||
@@ -22,28 +23,32 @@ fun EditChatMessageCaption(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = EditChatMessageCaption(
|
) = EditChatMessageCaption(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
replyMarkup
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
fun EditChatMessageCaption(
|
fun EditChatMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = EditChatMessageCaption(
|
) = EditChatMessageCaption(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -58,9 +63,11 @@ data class EditChatMessageCaption internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) : EditChatMessage<MediaContent>, EditTextChatMessage, EditReplyMessage {
|
) : EditChatMessage<MediaContent>, WithCustomizableCaptionRequest<ContentMessage<MediaContent>>, EditTextChatMessage, EditReplyMessage {
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
rawEntities ?.asTextSources(text)
|
rawEntities ?.asTextSources(text)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.edit.location.live
|
|||||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
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.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
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
@@ -22,6 +23,8 @@ data class EditChatMessageLiveLocation(
|
|||||||
override val latitude: Double,
|
override val latitude: Double,
|
||||||
@SerialName(longitudeField)
|
@SerialName(longitudeField)
|
||||||
override val longitude: Double,
|
override val longitude: Double,
|
||||||
|
@SerialName(livePeriodField)
|
||||||
|
val livePeriod: Seconds? = null,
|
||||||
@SerialName(horizontalAccuracyField)
|
@SerialName(horizontalAccuracyField)
|
||||||
override val horizontalAccuracy: Meters? = null,
|
override val horizontalAccuracy: Meters? = null,
|
||||||
@SerialName(headingField)
|
@SerialName(headingField)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.requests.edit.text
|
package dev.inmo.tgbotapi.requests.edit.text
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
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
|
||||||
@@ -16,29 +17,33 @@ fun EditInlineMessageText(
|
|||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = EditInlineMessageText(
|
) = EditInlineMessageText(
|
||||||
inlineMessageId,
|
inlineMessageId = inlineMessageId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
linkPreviewOptions,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
replyMarkup
|
linkPreviewOptions = linkPreviewOptions,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
fun EditInlineMessageText(
|
fun EditInlineMessageText(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = EditInlineMessageText(
|
) = EditInlineMessageText(
|
||||||
inlineMessageId,
|
inlineMessageId = inlineMessageId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
linkPreviewOptions,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
replyMarkup
|
linkPreviewOptions = linkPreviewOptions,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -51,11 +56,13 @@ data class EditInlineMessageText internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(entitiesField)
|
@SerialName(entitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(linkPreviewOptionsField)
|
@SerialName(linkPreviewOptionsField)
|
||||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
|
) : EditInlineMessage, WithCustomizableCaptionRequest<Boolean>, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
rawEntities ?.asTextSources(text)
|
rawEntities ?.asTextSources(text)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package dev.inmo.tgbotapi.requests.send
|
package dev.inmo.tgbotapi.requests.send
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.TextedOutput
|
import dev.inmo.tgbotapi.abstracts.TextedOutput
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||||
import dev.inmo.tgbotapi.abstracts.types.MessageAction
|
import dev.inmo.tgbotapi.abstracts.types.MessageAction
|
||||||
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.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||||
|
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
@@ -28,23 +30,25 @@ fun CopyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = CopyMessage(
|
) = CopyMessage(
|
||||||
toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
threadId,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CopyMessage(
|
fun CopyMessage(
|
||||||
@@ -52,23 +56,25 @@ fun CopyMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = CopyMessage(
|
) = CopyMessage(
|
||||||
toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
threadId,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CopyMessage(
|
fun CopyMessage(
|
||||||
@@ -77,23 +83,25 @@ fun CopyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = CopyMessage(
|
) = CopyMessage(
|
||||||
toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
threadId,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CopyMessage(
|
fun CopyMessage(
|
||||||
@@ -101,23 +109,25 @@ fun CopyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = CopyMessage(
|
) = CopyMessage(
|
||||||
toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageId,
|
messageId = messageId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
threadId,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -134,6 +144,8 @@ data class CopyMessage internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
@@ -146,6 +158,7 @@ data class CopyMessage internal constructor(
|
|||||||
override val replyMarkup: KeyboardMarkup? = null
|
override val replyMarkup: KeyboardMarkup? = null
|
||||||
): SimpleRequest<MessageId>,
|
): SimpleRequest<MessageId>,
|
||||||
ReplyingMarkupSendMessageRequest<MessageId>,
|
ReplyingMarkupSendMessageRequest<MessageId>,
|
||||||
|
WithCustomizableCaptionRequest<MessageId>,
|
||||||
MessageAction,
|
MessageAction,
|
||||||
TextedOutput,
|
TextedOutput,
|
||||||
ProtectContent,
|
ProtectContent,
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ data class SendContact(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -46,6 +48,7 @@ data class SendContact(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): this(
|
): this(
|
||||||
@@ -57,6 +60,7 @@ data class SendContact(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -74,15 +78,17 @@ fun Contact.toRequest(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): SendContact = SendContact(
|
): SendContact = SendContact(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
this,
|
contact = this,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
|||||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
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.requests.send.abstracts.SendContentMessageRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -30,11 +31,13 @@ data class SendDice(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
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,
|
) : SendContentMessageRequest<ContentMessage<DiceContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification,
|
||||||
OptionallyBusinessConnectionRequest {
|
OptionallyBusinessConnectionRequest {
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ fun SendLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = SendLocation(
|
) = SendLocation(
|
||||||
@@ -37,6 +38,7 @@ fun SendLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -49,9 +51,21 @@ fun SendStaticLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = SendLocation(
|
||||||
|
chatId = chatId,
|
||||||
|
latitude = latitude,
|
||||||
|
longitude = longitude,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
fun SendLiveLocation(
|
fun SendLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -65,22 +79,24 @@ fun SendLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = SendLocation(
|
) = SendLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
latitude,
|
latitude = latitude,
|
||||||
longitude,
|
longitude = longitude,
|
||||||
livePeriod,
|
livePeriod = livePeriod,
|
||||||
horizontalAccuracy,
|
horizontalAccuracy = horizontalAccuracy,
|
||||||
heading,
|
heading = heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius = proximityAlertRadius,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -107,6 +123,8 @@ data class SendLocation internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ fun SendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = SendTextMessage(
|
) = SendTextMessage(
|
||||||
@@ -42,6 +43,7 @@ fun SendTextMessage(
|
|||||||
linkPreviewOptions,
|
linkPreviewOptions,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -54,6 +56,7 @@ fun SendTextMessage(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = SendTextMessage(
|
) = SendTextMessage(
|
||||||
@@ -66,6 +69,7 @@ fun SendTextMessage(
|
|||||||
linkPreviewOptions,
|
linkPreviewOptions,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -90,6 +94,8 @@ data class SendTextMessage internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ data class SendVenue(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -57,6 +59,7 @@ data class SendVenue(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): this(
|
): this(
|
||||||
@@ -70,8 +73,10 @@ data class SendVenue(
|
|||||||
googlePlaceId = venue.googlePlaceId,
|
googlePlaceId = venue.googlePlaceId,
|
||||||
googlePlaceType = venue.googlePlaceType,
|
googlePlaceType = venue.googlePlaceType,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -89,6 +94,7 @@ fun Venue.toRequest(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): SendVenue = SendVenue(
|
): SendVenue = SendVenue(
|
||||||
@@ -98,6 +104,7 @@ fun Venue.toRequest(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
|
||||||
|
interface OptionallyWithEffectRequest<T : Any> : OptionallyWithEffectId, Request<T>
|
||||||
@@ -2,4 +2,4 @@ package dev.inmo.tgbotapi.requests.send.abstracts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
||||||
|
|
||||||
interface SendContentMessageRequest<T: Any> : SendMessageRequest<T>, OptionallyBusinessConnectionRequest
|
interface SendContentMessageRequest<T: Any> : SendMessageRequest<T>, OptionallyBusinessConnectionRequest, OptionallyWithEffectRequest<T>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
|
||||||
|
interface WithCustomizableCaptionRequest<T : Any> : Request<T>, WithCustomizableCaption
|
||||||
@@ -28,6 +28,8 @@ data class SendGame (
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ fun SendAnimation(
|
|||||||
thumbnail: InputFile? = null,
|
thumbnail: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -35,6 +36,7 @@ fun SendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<AnimationContent>> {
|
): Request<ContentMessage<AnimationContent>> {
|
||||||
@@ -42,22 +44,24 @@ fun SendAnimation(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendAnimationData(
|
val data = SendAnimationData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (animationAsFile == null && thumbAsFile == null) {
|
return if (animationAsFile == null && thumbAsFile == null) {
|
||||||
@@ -75,6 +79,7 @@ fun SendAnimation(
|
|||||||
animation: InputFile,
|
animation: InputFile,
|
||||||
thumbnail: InputFile? = null,
|
thumbnail: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -83,6 +88,7 @@ fun SendAnimation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<AnimationContent>> {
|
): Request<ContentMessage<AnimationContent>> {
|
||||||
@@ -90,22 +96,24 @@ fun SendAnimation(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendAnimationData(
|
val data = SendAnimationData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (animationAsFile == null && thumbAsFile == null) {
|
return if (animationAsFile == null && thumbAsFile == null) {
|
||||||
@@ -135,6 +143,8 @@ data class SendAnimationData internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
@SerialName(durationField)
|
@SerialName(durationField)
|
||||||
@@ -151,6 +161,8 @@ data class SendAnimationData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -162,6 +174,7 @@ data class SendAnimationData internal constructor(
|
|||||||
ThumbedSendMessageRequest<ContentMessage<AnimationContent>>,
|
ThumbedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||||
DuratedSendMessageRequest<ContentMessage<AnimationContent>>,
|
DuratedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||||
SizedSendMessageRequest<ContentMessage<AnimationContent>>,
|
SizedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||||
|
WithCustomizableCaptionRequest<ContentMessage<AnimationContent>>,
|
||||||
OptionallyWithSpoilerRequest
|
OptionallyWithSpoilerRequest
|
||||||
{
|
{
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ fun SendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<AudioContent>> {
|
): Request<ContentMessage<AudioContent>> {
|
||||||
@@ -42,21 +43,22 @@ fun SendAudio(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendAudioData(
|
val data = SendAudioData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
audio,
|
audio = audio,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
duration,
|
duration = duration,
|
||||||
performer,
|
performer = performer,
|
||||||
title,
|
title = title,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (audioAsFile == null && thumbAsFile == null) {
|
return if (audioAsFile == null && thumbAsFile == null) {
|
||||||
@@ -81,6 +83,7 @@ fun SendAudio(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<AudioContent>> {
|
): Request<ContentMessage<AudioContent>> {
|
||||||
@@ -88,21 +91,22 @@ fun SendAudio(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendAudioData(
|
val data = SendAudioData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
audio,
|
audio = audio,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
duration,
|
duration = duration,
|
||||||
performer,
|
performer = performer,
|
||||||
title,
|
title = title,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (audioAsFile == null && thumbAsFile == null) {
|
return if (audioAsFile == null && thumbAsFile == null) {
|
||||||
@@ -146,6 +150,8 @@ data class SendAudioData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ fun SendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -48,19 +49,20 @@ fun SendDocument(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendDocumentData(
|
val data = SendDocumentData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
document,
|
document = document,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup,
|
replyParameters = replyParameters,
|
||||||
disableContentTypeDetection
|
replyMarkup = replyMarkup,
|
||||||
|
disableContentTypeDetection = disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (documentAsFile == null && thumbAsFile == null) {
|
return if (documentAsFile == null && thumbAsFile == null) {
|
||||||
@@ -91,6 +93,7 @@ fun SendDocument(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -99,19 +102,20 @@ fun SendDocument(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendDocumentData(
|
val data = SendDocumentData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
document,
|
document = document,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup,
|
replyParameters = replyParameters,
|
||||||
disableContentTypeDetection
|
replyMarkup = replyMarkup,
|
||||||
|
disableContentTypeDetection = disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (documentAsFile == null && thumbAsFile == null) {
|
return if (documentAsFile == null && thumbAsFile == null) {
|
||||||
@@ -158,6 +162,8 @@ data class SendDocumentData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
replyParameters: ReplyParameters? = null
|
||||||
): Request<ContentMessage<MediaGroupContent<T>>> {
|
): Request<ContentMessage<MediaGroupContent<T>>> {
|
||||||
if (media.size !in mediaCountInMediaGroup) {
|
if (media.size !in mediaCountInMediaGroup) {
|
||||||
throwRangeError("Count of members in media group", mediaCountInMediaGroup, media.size)
|
throwRangeError("Count of members in media group", mediaCountInMediaGroup, media.size)
|
||||||
@@ -56,13 +56,14 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val data = SendMediaGroupData(
|
val data = SendMediaGroupData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
media,
|
media = media,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
return (if (files.isEmpty()) {
|
return (if (files.isEmpty()) {
|
||||||
@@ -88,9 +89,18 @@ inline fun SendPlaylist(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = SendMediaGroup<AudioContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
) = SendMediaGroup<AudioContent>(
|
||||||
|
chatId = chatId,
|
||||||
|
media = media,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@@ -105,9 +115,18 @@ inline fun SendDocumentsGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
) = SendMediaGroup<DocumentContent>(
|
||||||
|
chatId = chatId,
|
||||||
|
media = media,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@@ -123,9 +142,18 @@ inline fun SendVisualMediaGroup(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
) = SendMediaGroup<VisualMediaGroupPartContent>(
|
||||||
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
chatId = chatId,
|
||||||
|
media = media,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters
|
||||||
|
)
|
||||||
|
|
||||||
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>>())
|
||||||
@@ -155,6 +183,8 @@ data class SendMediaGroupData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,
|
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,
|
||||||
|
|||||||
@@ -25,27 +25,31 @@ fun SendPhoto(
|
|||||||
photo: InputFile,
|
photo: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<PhotoContent>> {
|
): Request<ContentMessage<PhotoContent>> {
|
||||||
val data = SendPhotoData(
|
val data = SendPhotoData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
photo,
|
photo = photo,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
return if (photo is MultipartFile) {
|
return if (photo is MultipartFile) {
|
||||||
CommonMultipartFileRequest(
|
CommonMultipartFileRequest(
|
||||||
@@ -61,27 +65,31 @@ fun SendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: InputFile,
|
photo: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<PhotoContent>> {
|
): Request<ContentMessage<PhotoContent>> {
|
||||||
val data = SendPhotoData(
|
val data = SendPhotoData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
photo,
|
photo = photo,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (photo is MultipartFile) {
|
return if (photo is MultipartFile) {
|
||||||
@@ -109,6 +117,8 @@ data class SendPhotoData internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@@ -119,6 +129,8 @@ data class SendPhotoData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -127,6 +139,7 @@ data class SendPhotoData internal constructor(
|
|||||||
SendContentMessageRequest<ContentMessage<PhotoContent>>,
|
SendContentMessageRequest<ContentMessage<PhotoContent>>,
|
||||||
ReplyingMarkupSendMessageRequest<ContentMessage<PhotoContent>>,
|
ReplyingMarkupSendMessageRequest<ContentMessage<PhotoContent>>,
|
||||||
TextableSendMessageRequest<ContentMessage<PhotoContent>>,
|
TextableSendMessageRequest<ContentMessage<PhotoContent>>,
|
||||||
|
WithCustomizableCaptionRequest<ContentMessage<PhotoContent>>,
|
||||||
OptionallyWithSpoilerRequest
|
OptionallyWithSpoilerRequest
|
||||||
{
|
{
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
|
|||||||
@@ -21,17 +21,20 @@ fun SendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<StickerContent>> = SendStickerByFileId(
|
): Request<ContentMessage<StickerContent>> = SendStickerByFileId(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
sticker,
|
sticker = sticker,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
emoji = emoji,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
).let {
|
).let {
|
||||||
when (sticker) {
|
when (sticker) {
|
||||||
is MultipartFile -> CommonMultipartFileRequest(
|
is MultipartFile -> CommonMultipartFileRequest(
|
||||||
@@ -55,10 +58,14 @@ data class SendStickerByFileId internal constructor(
|
|||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
@SerialName(emojiField)
|
||||||
|
val emoji: String? = null,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ fun SendVideo(
|
|||||||
thumbnail: InputFile? = null,
|
thumbnail: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -36,6 +37,7 @@ fun SendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<VideoContent>> {
|
): Request<ContentMessage<VideoContent>> {
|
||||||
@@ -43,23 +45,25 @@ fun SendVideo(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendVideoData(
|
val data = SendVideoData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
supportStreaming,
|
height = height,
|
||||||
threadId,
|
supportStreaming = supportStreaming,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (videoAsFile == null && thumbAsFile == null) {
|
return if (videoAsFile == null && thumbAsFile == null) {
|
||||||
@@ -77,6 +81,7 @@ fun SendVideo(
|
|||||||
video: InputFile,
|
video: InputFile,
|
||||||
thumbnail: InputFile? = null,
|
thumbnail: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
@@ -86,6 +91,7 @@ fun SendVideo(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<VideoContent>> {
|
): Request<ContentMessage<VideoContent>> {
|
||||||
@@ -93,23 +99,25 @@ fun SendVideo(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendVideoData(
|
val data = SendVideoData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
supportStreaming,
|
height = height,
|
||||||
threadId,
|
supportStreaming = supportStreaming,
|
||||||
businessConnectionId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (videoAsFile == null && thumbAsFile == null) {
|
return if (videoAsFile == null && thumbAsFile == null) {
|
||||||
@@ -139,6 +147,8 @@ data class SendVideoData internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
@SerialName(durationField)
|
@SerialName(durationField)
|
||||||
@@ -157,6 +167,8 @@ data class SendVideoData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -168,6 +180,7 @@ data class SendVideoData internal constructor(
|
|||||||
ThumbedSendMessageRequest<ContentMessage<VideoContent>>,
|
ThumbedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||||
DuratedSendMessageRequest<ContentMessage<VideoContent>>,
|
DuratedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||||
SizedSendMessageRequest<ContentMessage<VideoContent>>,
|
SizedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||||
|
WithCustomizableCaptionRequest<ContentMessage<VideoContent>>,
|
||||||
OptionallyWithSpoilerRequest
|
OptionallyWithSpoilerRequest
|
||||||
{
|
{
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ fun SendVideoNote(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<VideoNoteContent>> {
|
): Request<ContentMessage<VideoNoteContent>> {
|
||||||
@@ -30,17 +31,18 @@ fun SendVideoNote(
|
|||||||
val thumbAsFile = thumbnail as? MultipartFile
|
val thumbAsFile = thumbnail as? MultipartFile
|
||||||
|
|
||||||
val data = SendVideoNoteData(
|
val data = SendVideoNoteData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
videoNote,
|
videoNote = videoNote,
|
||||||
thumbnail ?.fileId,
|
thumbnail = thumbnail ?.fileId,
|
||||||
duration,
|
duration = duration,
|
||||||
size,
|
width = size,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (videoNoteAsFile == null && thumbAsFile == null) {
|
return if (videoNoteAsFile == null && thumbAsFile == null) {
|
||||||
@@ -76,6 +78,8 @@ data class SendVideoNoteData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -31,24 +31,26 @@ fun SendVoice(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<VoiceContent>> {
|
): Request<ContentMessage<VoiceContent>> {
|
||||||
val voiceAsFile = voice as? MultipartFile
|
val voiceAsFile = voice as? MultipartFile
|
||||||
|
|
||||||
val data = SendVoiceData(
|
val data = SendVoiceData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
voice,
|
voice = voice,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
null,
|
rawEntities = null,
|
||||||
duration,
|
duration = duration,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (voiceAsFile == null) {
|
return if (voiceAsFile == null) {
|
||||||
@@ -70,24 +72,26 @@ fun SendVoice(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): Request<ContentMessage<VoiceContent>> {
|
): Request<ContentMessage<VoiceContent>> {
|
||||||
val voiceAsFile = voice as? MultipartFile
|
val voiceAsFile = voice as? MultipartFile
|
||||||
|
|
||||||
val data = SendVoiceData(
|
val data = SendVoiceData(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
voice,
|
voice = voice,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
duration,
|
duration = duration,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (voiceAsFile == null) {
|
return if (voiceAsFile == null) {
|
||||||
@@ -125,6 +129,8 @@ data class SendVoiceData internal constructor(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ data class CreateInvoiceLink(
|
|||||||
@SerialName(payloadField)
|
@SerialName(payloadField)
|
||||||
override val payload: String,
|
override val payload: String,
|
||||||
@SerialName(providerTokenField)
|
@SerialName(providerTokenField)
|
||||||
override val providerToken: String,
|
override val providerToken: String?,
|
||||||
@SerialName(currencyField)
|
@SerialName(currencyField)
|
||||||
override val currency: Currency,
|
override val currency: Currency,
|
||||||
@Serializable(LabeledPricesSerializer::class)
|
@Serializable(LabeledPricesSerializer::class)
|
||||||
@@ -73,6 +74,40 @@ data class CreateInvoiceLink(
|
|||||||
override var photoHeight: Int? = null
|
override var photoHeight: Int? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
requireName: Boolean = false,
|
||||||
|
requirePhoneNumber: Boolean = false,
|
||||||
|
requireEmail: Boolean = false,
|
||||||
|
requireShippingAddress: Boolean = false,
|
||||||
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
|
priceDependOnShipAddress: Boolean = false
|
||||||
|
) : this(
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
payload = payload,
|
||||||
|
providerToken = null,
|
||||||
|
currency = Currency.XTR,
|
||||||
|
prices = prices,
|
||||||
|
maxTipAmount = maxTipAmount,
|
||||||
|
suggestedTipAmounts = suggestedTipAmounts,
|
||||||
|
providerData = providerData,
|
||||||
|
requireName = requireName,
|
||||||
|
requirePhoneNumber = requirePhoneNumber,
|
||||||
|
requireEmail = requireEmail,
|
||||||
|
requireShippingAddress = requireShippingAddress,
|
||||||
|
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||||
|
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||||
|
priceDependOnShipAddress = priceDependOnShipAddress
|
||||||
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
suggestedTipAmounts ?.let { _ ->
|
suggestedTipAmounts ?.let { _ ->
|
||||||
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package dev.inmo.tgbotapi.requests.send.payments
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class RefundStarPayment(
|
||||||
|
@SerialName(userIdField)
|
||||||
|
val userId: UserId,
|
||||||
|
@SerialName(telegramPaymentChargeIdField)
|
||||||
|
val telegramPaymentChargeId: TelegramPaymentChargeId
|
||||||
|
) : SimpleRequest<Boolean> {
|
||||||
|
override fun method(): String = "refundStarPayment"
|
||||||
|
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||||
|
get() = Boolean.serializer()
|
||||||
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
|
get() = serializer()
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send.payments
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
|
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.OptionallyWithEffectRequest
|
||||||
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.business_connection.BusinessConnectionId
|
||||||
@@ -12,6 +13,7 @@ import dev.inmo.tgbotapi.types.message.content.InvoiceContent
|
|||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
||||||
@@ -31,7 +33,7 @@ data class SendInvoice(
|
|||||||
@SerialName(payloadField)
|
@SerialName(payloadField)
|
||||||
override val payload: String,
|
override val payload: String,
|
||||||
@SerialName(providerTokenField)
|
@SerialName(providerTokenField)
|
||||||
override val providerToken: String,
|
override val providerToken: String?,
|
||||||
@SerialName(currencyField)
|
@SerialName(currencyField)
|
||||||
override val currency: Currency,
|
override val currency: Currency,
|
||||||
@Serializable(LabeledPricesSerializer::class)
|
@Serializable(LabeledPricesSerializer::class)
|
||||||
@@ -65,6 +67,8 @@ data class SendInvoice(
|
|||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(protectContentField)
|
@SerialName(protectContentField)
|
||||||
override val protectContent: Boolean = false,
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
@SerialName(replyParametersField)
|
@SerialName(replyParametersField)
|
||||||
override val replyParameters: ReplyParameters? = null,
|
override val replyParameters: ReplyParameters? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
@@ -74,7 +78,8 @@ data class SendInvoice(
|
|||||||
DisableNotification,
|
DisableNotification,
|
||||||
WithReplyParameters,
|
WithReplyParameters,
|
||||||
WithReplyMarkup,
|
WithReplyMarkup,
|
||||||
SendMessageRequest<ContentMessage<InvoiceContent>> {
|
SendMessageRequest<ContentMessage<InvoiceContent>>,
|
||||||
|
OptionallyWithEffectRequest<ContentMessage<InvoiceContent>> {
|
||||||
override fun method(): String = "sendInvoice"
|
override fun method(): String = "sendInvoice"
|
||||||
override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
||||||
get() = invoiceMessageSerializer
|
get() = invoiceMessageSerializer
|
||||||
@@ -95,6 +100,38 @@ data class SendInvoice(
|
|||||||
override var photoHeight: Int? = null
|
override var photoHeight: Int? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: IdChatIdentifier,
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
price: LabeledPrice,
|
||||||
|
startParameter: StartParameter? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
payload = payload,
|
||||||
|
providerToken = null,
|
||||||
|
currency = Currency.XTR,
|
||||||
|
prices = listOf(price),
|
||||||
|
startParameter = startParameter,
|
||||||
|
providerData = providerData,
|
||||||
|
threadId = threadId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
suggestedTipAmounts ?.let { _ ->
|
suggestedTipAmounts ?.let { _ ->
|
||||||
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
||||||
|
|||||||
@@ -1,44 +1,39 @@
|
|||||||
package dev.inmo.tgbotapi.requests.send.polls
|
package dev.inmo.tgbotapi.requests.send.polls
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||||
import korlibs.time.DateTime
|
import korlibs.time.DateTime
|
||||||
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.SendContentMessageRequest
|
||||||
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.business_connection.BusinessConnectionId
|
||||||
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
|
||||||
import dev.inmo.tgbotapi.types.message.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
|
||||||
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
|
||||||
import dev.inmo.tgbotapi.types.message.content.PollContent
|
import dev.inmo.tgbotapi.types.message.content.PollContent
|
||||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
|
||||||
import korlibs.time.millisecondsLong
|
import korlibs.time.millisecondsLong
|
||||||
import korlibs.time.seconds
|
import korlibs.time.seconds
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<PollContent>> = TelegramBotAPIMessageDeserializationStrategyClass()
|
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<PollContent>> = TelegramBotAPIMessageDeserializationStrategyClass()
|
||||||
|
|
||||||
private inline val ApproximateScheduledCloseInfo.openPeriod
|
internal inline val ApproximateScheduledCloseInfo.openPeriod
|
||||||
get() = openDuration.millisecondsLong.div(1000)
|
get() = openDuration.millisecondsLong.div(1000)
|
||||||
private inline val ExactScheduledCloseInfo.closeDate
|
internal inline val ExactScheduledCloseInfo.closeDate
|
||||||
get() = closeDateTime.unixMillisLong.div(1000)
|
get() = closeDateTime.unixMillisLong.div(1000)
|
||||||
|
|
||||||
private fun checkPollInfo(
|
internal fun checkPollInfo(
|
||||||
question: String,
|
question: String,
|
||||||
options: List<String>
|
options: List<InputPollOption>
|
||||||
) {
|
) {
|
||||||
if (question.length !in pollQuestionTextLength) {
|
if (question.length !in pollQuestionTextLength) {
|
||||||
throw IllegalArgumentException("The length of questions for polls must be in $pollQuestionTextLength range, but was ${question.length}")
|
throw IllegalArgumentException("The length of questions for polls must be in $pollQuestionTextLength range, but was ${question.length}")
|
||||||
}
|
}
|
||||||
options.forEach {
|
options.forEach {
|
||||||
if (it.length !in pollOptionTextLength) {
|
if (it.text.length !in pollOptionTextLength) {
|
||||||
throw IllegalArgumentException("The length of question option text for polls must be in $pollOptionTextLength range, but was ${it.length}")
|
throw IllegalArgumentException("The length of question option text for polls must be in $pollOptionTextLength range, but was ${it.text.length}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.size !in pollOptionsLimit) {
|
if (options.size !in pollOptionsLimit) {
|
||||||
@@ -49,7 +44,8 @@ private fun checkPollInfo(
|
|||||||
fun SendPoll(
|
fun SendPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
question: String,
|
question: String,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
@@ -62,6 +58,33 @@ fun SendPoll(
|
|||||||
chatId,
|
chatId,
|
||||||
question,
|
question,
|
||||||
options,
|
options,
|
||||||
|
questionParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
protectContent = protectContent,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
textSources: TextSourcesList,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
textSources,
|
||||||
|
options,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
@@ -82,74 +105,79 @@ fun Poll.createRequest(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = when (this) {
|
) = when (this) {
|
||||||
is RegularPoll -> SendRegularPoll(
|
is RegularPoll -> SendRegularPoll(
|
||||||
chatId,
|
chatId,
|
||||||
question,
|
textSources,
|
||||||
options.map { it.text },
|
options.map { it.asInput() },
|
||||||
|
scheduledCloseInfo,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
allowMultipleAnswers,
|
allowMultipleAnswers,
|
||||||
scheduledCloseInfo,
|
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
is QuizPoll -> correctOptionId ?.let { correctOptionId ->
|
is QuizPoll -> correctOptionId ?.let { correctOptionId ->
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId,
|
chatId,
|
||||||
question,
|
textSources,
|
||||||
options.map { it.text },
|
options.map { it.asInput() },
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
|
scheduledCloseInfo,
|
||||||
|
explanationTextSources,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
textSources,
|
|
||||||
scheduledCloseInfo,
|
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
} ?: SendRegularPoll(
|
} ?: SendRegularPoll(
|
||||||
chatId,
|
chatId,
|
||||||
question,
|
textSources,
|
||||||
options.map { it.text },
|
options.map { it.asInput() },
|
||||||
|
scheduledCloseInfo,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
false,
|
false,
|
||||||
scheduledCloseInfo,
|
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
is UnknownPollType -> SendRegularPoll(
|
is UnknownPollType -> SendRegularPoll(
|
||||||
chatId,
|
chatId,
|
||||||
question,
|
textSources,
|
||||||
options.map { it.text },
|
options.map { it.asInput() },
|
||||||
|
scheduledCloseInfo,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
false,
|
false,
|
||||||
scheduledCloseInfo,
|
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ScheduledCloseInfo.checkSendData() {
|
internal fun ScheduledCloseInfo.checkSendData() {
|
||||||
val span = when (this) {
|
val span = when (this) {
|
||||||
is ExactScheduledCloseInfo -> (closeDateTime - DateTime.now()).seconds
|
is ExactScheduledCloseInfo -> (closeDateTime - DateTime.now()).seconds
|
||||||
is ApproximateScheduledCloseInfo -> openDuration.seconds
|
is ApproximateScheduledCloseInfo -> openDuration.seconds
|
||||||
@@ -160,9 +188,12 @@ private fun ScheduledCloseInfo.checkSendData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sealed class SendPoll : SendContentMessageRequest<ContentMessage<PollContent>>,
|
sealed class SendPoll : SendContentMessageRequest<ContentMessage<PollContent>>,
|
||||||
ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>> {
|
ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>>, TextedInput {
|
||||||
abstract val question: String
|
abstract val question: String
|
||||||
abstract val options: List<String>
|
override val text: String
|
||||||
|
get() = question
|
||||||
|
abstract val questionParseMode: ParseMode?
|
||||||
|
abstract val options: List<InputPollOption>
|
||||||
abstract val isAnonymous: Boolean
|
abstract val isAnonymous: Boolean
|
||||||
abstract val isClosed: Boolean
|
abstract val isClosed: Boolean
|
||||||
abstract val type: String
|
abstract val type: String
|
||||||
@@ -187,239 +218,3 @@ sealed class SendPoll : SendContentMessageRequest<ContentMessage<PollContent>>,
|
|||||||
get() = commonResultDeserializer
|
get() = commonResultDeserializer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class SendRegularPoll(
|
|
||||||
@SerialName(chatIdField)
|
|
||||||
override val chatId: ChatIdentifier,
|
|
||||||
@SerialName(questionField)
|
|
||||||
override val question: String,
|
|
||||||
@SerialName(optionsField)
|
|
||||||
override val options: List<String>,
|
|
||||||
@SerialName(isAnonymousField)
|
|
||||||
override val isAnonymous: Boolean = true,
|
|
||||||
@SerialName(isClosedField)
|
|
||||||
override val isClosed: Boolean = false,
|
|
||||||
@SerialName(allowsMultipleAnswersField)
|
|
||||||
val allowMultipleAnswers: Boolean = false,
|
|
||||||
@SerialName(openPeriodField)
|
|
||||||
override val openPeriod: LongSeconds?= null,
|
|
||||||
@SerialName(closeDateField)
|
|
||||||
override val closeDate: LongSeconds?,
|
|
||||||
@SerialName(messageThreadIdField)
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
@SerialName(businessConnectionIdField)
|
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
@SerialName(disableNotificationField)
|
|
||||||
override val disableNotification: Boolean = false,
|
|
||||||
@SerialName(protectContentField)
|
|
||||||
override val protectContent: Boolean = false,
|
|
||||||
@SerialName(replyParametersField)
|
|
||||||
override val replyParameters: ReplyParameters? = null,
|
|
||||||
@SerialName(replyMarkupField)
|
|
||||||
override val replyMarkup: KeyboardMarkup? = null
|
|
||||||
) : SendPoll() {
|
|
||||||
override val type: String = regularPollType
|
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
|
||||||
get() = serializer()
|
|
||||||
|
|
||||||
init {
|
|
||||||
checkPollInfo(question, options)
|
|
||||||
closeInfo ?.checkSendData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun SendRegularPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
allowMultipleAnswers: Boolean = false,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = SendRegularPoll(
|
|
||||||
chatId,
|
|
||||||
question,
|
|
||||||
options,
|
|
||||||
isAnonymous,
|
|
||||||
isClosed,
|
|
||||||
allowMultipleAnswers,
|
|
||||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
|
||||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
|
||||||
threadId,
|
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyParameters,
|
|
||||||
replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
fun SendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = SendQuizPoll(
|
|
||||||
chatId,
|
|
||||||
question,
|
|
||||||
options,
|
|
||||||
correctOptionId,
|
|
||||||
isAnonymous,
|
|
||||||
isClosed,
|
|
||||||
explanation,
|
|
||||||
parseMode,
|
|
||||||
null,
|
|
||||||
closeInfo,
|
|
||||||
threadId,
|
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyParameters,
|
|
||||||
replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
fun SendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
entities: List<TextSource>,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = SendQuizPoll(
|
|
||||||
chatId,
|
|
||||||
question,
|
|
||||||
options,
|
|
||||||
correctOptionId,
|
|
||||||
isAnonymous,
|
|
||||||
isClosed,
|
|
||||||
entities.makeString(),
|
|
||||||
null,
|
|
||||||
entities.toRawMessageEntities(),
|
|
||||||
closeInfo,
|
|
||||||
threadId,
|
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyParameters,
|
|
||||||
replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
internal fun SendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
rawEntities: List<RawMessageEntity>? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = SendQuizPoll(
|
|
||||||
chatId,
|
|
||||||
question,
|
|
||||||
options,
|
|
||||||
correctOptionId,
|
|
||||||
isAnonymous,
|
|
||||||
isClosed,
|
|
||||||
explanation,
|
|
||||||
parseMode,
|
|
||||||
rawEntities,
|
|
||||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
|
||||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
|
||||||
threadId,
|
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
|
||||||
protectContent,
|
|
||||||
replyParameters,
|
|
||||||
replyMarkup
|
|
||||||
)
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class SendQuizPoll internal constructor(
|
|
||||||
@SerialName(chatIdField)
|
|
||||||
override val chatId: ChatIdentifier,
|
|
||||||
@SerialName(questionField)
|
|
||||||
override val question: String,
|
|
||||||
@SerialName(optionsField)
|
|
||||||
override val options: List<String>,
|
|
||||||
@SerialName(correctOptionIdField)
|
|
||||||
val correctOptionId: Int,
|
|
||||||
@SerialName(isAnonymousField)
|
|
||||||
override val isAnonymous: Boolean = true,
|
|
||||||
@SerialName(isClosedField)
|
|
||||||
override val isClosed: Boolean = false,
|
|
||||||
@SerialName(explanationField)
|
|
||||||
override val text: String? = null,
|
|
||||||
@SerialName(explanationParseModeField)
|
|
||||||
override val parseMode: ParseMode? = null,
|
|
||||||
@SerialName(explanationEntitiesField)
|
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
|
||||||
@SerialName(openPeriodField)
|
|
||||||
override val openPeriod: LongSeconds? = null,
|
|
||||||
@SerialName(closeDateField)
|
|
||||||
override val closeDate: LongSeconds? = null,
|
|
||||||
@SerialName(messageThreadIdField)
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
@SerialName(businessConnectionIdField)
|
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
@SerialName(disableNotificationField)
|
|
||||||
override val disableNotification: Boolean = false,
|
|
||||||
@SerialName(protectContentField)
|
|
||||||
override val protectContent: Boolean = false,
|
|
||||||
@SerialName(replyParametersField)
|
|
||||||
override val replyParameters: ReplyParameters? = null,
|
|
||||||
@SerialName(replyMarkupField)
|
|
||||||
override val replyMarkup: KeyboardMarkup? = null
|
|
||||||
) : SendPoll(), TextedOutput {
|
|
||||||
override val type: String = quizPollType
|
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
|
||||||
get() = serializer()
|
|
||||||
override val textSources: List<TextSource>? by lazy {
|
|
||||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
|
||||||
checkPollInfo(question, options)
|
|
||||||
closeInfo ?.checkSendData()
|
|
||||||
val correctOptionIdRange = 0 .. options.size
|
|
||||||
if (correctOptionId !in correctOptionIdRange) {
|
|
||||||
throw IllegalArgumentException("Correct option id must be in range of $correctOptionIdRange, but actual " +
|
|
||||||
"value is $correctOptionId")
|
|
||||||
}
|
|
||||||
if (text != null && text.length !in explanationLimit) {
|
|
||||||
error("Quiz poll explanation size must be in range $explanationLimit," +
|
|
||||||
"but actual explanation contains ${text.length} symbols")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,398 @@
|
|||||||
|
package dev.inmo.tgbotapi.requests.send.polls
|
||||||
|
|
||||||
|
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.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||||
|
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.SerializationStrategy
|
||||||
|
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
class SendQuizPoll internal constructor(
|
||||||
|
@SerialName(chatIdField)
|
||||||
|
override val chatId: ChatIdentifier,
|
||||||
|
@SerialName(questionField)
|
||||||
|
override val question: String,
|
||||||
|
@SerialName(optionsField)
|
||||||
|
override val options: List<InputPollOption>,
|
||||||
|
@SerialName(correctOptionIdField)
|
||||||
|
val correctOptionId: Int,
|
||||||
|
@SerialName(questionParseModeField)
|
||||||
|
override val questionParseMode: ParseMode? = null,
|
||||||
|
@SerialName(questionEntitiesField)
|
||||||
|
private val rawQuestionEntities: List<RawMessageEntity> = emptyList(),
|
||||||
|
@SerialName(isAnonymousField)
|
||||||
|
override val isAnonymous: Boolean = true,
|
||||||
|
@SerialName(isClosedField)
|
||||||
|
override val isClosed: Boolean = false,
|
||||||
|
@SerialName(explanationField)
|
||||||
|
val explanation: String? = null,
|
||||||
|
@SerialName(explanationParseModeField)
|
||||||
|
val explanationParseMode: ParseMode? = null,
|
||||||
|
@SerialName(explanationEntitiesField)
|
||||||
|
private val rawExplanationEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(openPeriodField)
|
||||||
|
override val openPeriod: LongSeconds? = null,
|
||||||
|
@SerialName(closeDateField)
|
||||||
|
override val closeDate: LongSeconds? = null,
|
||||||
|
@SerialName(messageThreadIdField)
|
||||||
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
@SerialName(businessConnectionIdField)
|
||||||
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
@SerialName(disableNotificationField)
|
||||||
|
override val disableNotification: Boolean = false,
|
||||||
|
@SerialName(protectContentField)
|
||||||
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
|
@SerialName(replyParametersField)
|
||||||
|
override val replyParameters: ReplyParameters? = null,
|
||||||
|
@SerialName(replyMarkupField)
|
||||||
|
override val replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : SendPoll() {
|
||||||
|
override val type: String = quizPollType
|
||||||
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
|
get() = serializer()
|
||||||
|
override val textSources: List<TextSource>
|
||||||
|
get() = rawQuestionEntities.asTextSources(question)
|
||||||
|
val explanationTextEntities: List<TextSource>? by lazy {
|
||||||
|
rawExplanationEntities ?.asTextSources(text ?: return@lazy null)
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
rawQuestionEntities = emptyList(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
explanation = explanation,
|
||||||
|
explanationParseMode = explanationParseMode,
|
||||||
|
rawExplanationEntities = emptyList(),
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = questionEntities.makeSourceString(),
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
questionParseMode = null,
|
||||||
|
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
explanation = explanation,
|
||||||
|
explanationParseMode = explanationParseMode,
|
||||||
|
rawExplanationEntities = emptyList(),
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
rawQuestionEntities = emptyList(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
explanation = explanationTextSources ?.makeSourceString(),
|
||||||
|
explanationParseMode = null,
|
||||||
|
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = questionEntities.makeSourceString(),
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
questionParseMode = null,
|
||||||
|
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
explanation = explanationTextSources ?.makeSourceString(),
|
||||||
|
explanationParseMode = null,
|
||||||
|
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
init {
|
||||||
|
checkPollInfo(question, options)
|
||||||
|
closeInfo ?.checkSendData()
|
||||||
|
val correctOptionIdRange = 0 .. options.size
|
||||||
|
if (correctOptionId !in correctOptionIdRange) {
|
||||||
|
throw IllegalArgumentException("Correct option id must be in range of $correctOptionIdRange, but actual " +
|
||||||
|
"value is $correctOptionId")
|
||||||
|
}
|
||||||
|
if (explanation != null && explanation.length !in explanationLimit) {
|
||||||
|
error("Quiz poll explanation size must be in range $explanationLimit," +
|
||||||
|
"but actual explanation contains ${text.length} symbols")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun SendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanation: String?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendQuizPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
explanation = explanation,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
explanationParseMode = explanationParseMode,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendQuizPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
questionEntities = questionEntities,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
explanation = explanation,
|
||||||
|
explanationParseMode = explanationParseMode,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendQuizPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
explanationTextSources = explanationTextSources,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendQuizPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
questionEntities = questionEntities,
|
||||||
|
options = options,
|
||||||
|
correctOptionId = correctOptionId,
|
||||||
|
explanationTextSources = explanationTextSources,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo)?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
@@ -0,0 +1,243 @@
|
|||||||
|
package dev.inmo.tgbotapi.requests.send.polls
|
||||||
|
|
||||||
|
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.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||||
|
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
import dev.inmo.tgbotapi.utils.EntitiesBuilder
|
||||||
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.SerializationStrategy
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
class SendRegularPoll private constructor(
|
||||||
|
@SerialName(chatIdField)
|
||||||
|
override val chatId: ChatIdentifier,
|
||||||
|
@SerialName(questionField)
|
||||||
|
override val question: String,
|
||||||
|
@SerialName(optionsField)
|
||||||
|
override val options: List<InputPollOption>,
|
||||||
|
@SerialName(questionParseModeField)
|
||||||
|
override val questionParseMode: ParseMode? = null,
|
||||||
|
@SerialName(questionEntitiesField)
|
||||||
|
private val rawQuestionEntities: List<RawMessageEntity> = emptyList(),
|
||||||
|
@SerialName(isAnonymousField)
|
||||||
|
override val isAnonymous: Boolean = true,
|
||||||
|
@SerialName(isClosedField)
|
||||||
|
override val isClosed: Boolean = false,
|
||||||
|
@SerialName(allowsMultipleAnswersField)
|
||||||
|
val allowMultipleAnswers: Boolean = false,
|
||||||
|
@SerialName(openPeriodField)
|
||||||
|
override val openPeriod: LongSeconds?= null,
|
||||||
|
@SerialName(closeDateField)
|
||||||
|
override val closeDate: LongSeconds? = null,
|
||||||
|
@SerialName(messageThreadIdField)
|
||||||
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
@SerialName(businessConnectionIdField)
|
||||||
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
@SerialName(disableNotificationField)
|
||||||
|
override val disableNotification: Boolean = false,
|
||||||
|
@SerialName(protectContentField)
|
||||||
|
override val protectContent: Boolean = false,
|
||||||
|
@SerialName(messageEffectIdField)
|
||||||
|
override val effectId: EffectId? = null,
|
||||||
|
@SerialName(replyParametersField)
|
||||||
|
override val replyParameters: ReplyParameters? = null,
|
||||||
|
@SerialName(replyMarkupField)
|
||||||
|
override val replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : SendPoll() {
|
||||||
|
override val textSources: List<TextSource>
|
||||||
|
get() = rawQuestionEntities.asTextSources(text)
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds?= null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = questionEntities.makeSourceString(),
|
||||||
|
options = options,
|
||||||
|
questionParseMode = null,
|
||||||
|
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
allowMultipleAnswers = allowMultipleAnswers,
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds?= null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
rawQuestionEntities = emptyList(),
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
allowMultipleAnswers = allowMultipleAnswers,
|
||||||
|
openPeriod = openPeriod,
|
||||||
|
closeDate = closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
override val type: String = regularPollType
|
||||||
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
|
get() = serializer()
|
||||||
|
|
||||||
|
init {
|
||||||
|
checkPollInfo(question, options)
|
||||||
|
closeInfo ?.checkSendData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun SendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendRegularPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
allowMultipleAnswers = allowMultipleAnswers,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionTextSources: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = SendRegularPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
questionEntities = questionTextSources,
|
||||||
|
options = options,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
allowMultipleAnswers = allowMultipleAnswers,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
fun SendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
|
builder: EntitiesBuilderBody
|
||||||
|
) = SendRegularPoll(
|
||||||
|
chatId = chatId,
|
||||||
|
questionTextSources = EntitiesBuilder().apply(builder).build(),
|
||||||
|
options = options,
|
||||||
|
closeInfo = closeInfo,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
isClosed = isClosed,
|
||||||
|
allowMultipleAnswers = allowMultipleAnswers,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.colors.common.HEXAColor
|
||||||
|
import dev.inmo.tgbotapi.utils.IntRGB24HEXAColorSerializer
|
||||||
|
import dev.inmo.tgbotapi.utils.decodeDataAndJson
|
||||||
|
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
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
|
@ClassCastsIncluded
|
||||||
|
@Serializable(BackgroundFill.Companion::class)
|
||||||
|
sealed interface BackgroundFill {
|
||||||
|
val type: String
|
||||||
|
val colors: List<HEXAColor>
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Solid(
|
||||||
|
@SerialName(colorField)
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val color: HEXAColor
|
||||||
|
) : BackgroundFill {
|
||||||
|
@Transient
|
||||||
|
override val colors: List<HEXAColor> = listOf(color)
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val type = "solid"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Serializable
|
||||||
|
data class Gradient(
|
||||||
|
@SerialName(topColorField)
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val topColor: HEXAColor,
|
||||||
|
@SerialName(bottomColorField)
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val bottomColor: HEXAColor,
|
||||||
|
@SerialName(rotationAngleField)
|
||||||
|
val rotationAngle: Short,
|
||||||
|
) : BackgroundFill {
|
||||||
|
@Transient
|
||||||
|
override val colors: List<HEXAColor> = listOf(topColor, bottomColor)
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
companion object {
|
||||||
|
const val type = "gradient"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Serializable
|
||||||
|
data class FreeformGradient(
|
||||||
|
@SerialName(colorsField)
|
||||||
|
override val colors: List<@Serializable(IntRGB24HEXAColorSerializer::class) HEXAColor>
|
||||||
|
) : BackgroundFill {
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val type = "freeform_gradient"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Serializable
|
||||||
|
data class Unknown(
|
||||||
|
override val type: String,
|
||||||
|
val raw: JsonElement?
|
||||||
|
) : BackgroundFill {
|
||||||
|
@SerialName(colorsField)
|
||||||
|
override val colors: List<HEXAColor> = emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object : KSerializer<BackgroundFill> {
|
||||||
|
@Serializable
|
||||||
|
class RawBackgroundFill private constructor(
|
||||||
|
@SerialName(typeField)
|
||||||
|
val type: String,
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val color: HEXAColor? = null,
|
||||||
|
@SerialName(topColorField)
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val topColor: HEXAColor? = null,
|
||||||
|
@SerialName(bottomColorField)
|
||||||
|
@Serializable(IntRGB24HEXAColorSerializer::class)
|
||||||
|
val bottomColor: HEXAColor? = null,
|
||||||
|
@SerialName(rotationAngleField)
|
||||||
|
val rotationAngle: Short? = null,
|
||||||
|
@SerialName(colorsField)
|
||||||
|
val colors: List<@Serializable(IntRGB24HEXAColorSerializer::class) HEXAColor>? = null
|
||||||
|
)
|
||||||
|
|
||||||
|
private val serializer = RawBackgroundFill.serializer()
|
||||||
|
override val descriptor: SerialDescriptor
|
||||||
|
get() = serializer.descriptor
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): BackgroundFill {
|
||||||
|
val (raw, json) = decoder.decodeDataAndJson(serializer)
|
||||||
|
return when (raw.type) {
|
||||||
|
Solid.type -> Solid(color = raw.color ?: return Unknown(raw.type, json))
|
||||||
|
Gradient.type -> Gradient(
|
||||||
|
topColor = raw.topColor ?: return Unknown(raw.type, json),
|
||||||
|
bottomColor = raw.bottomColor ?: return Unknown(raw.type, json),
|
||||||
|
rotationAngle = raw.rotationAngle ?: return Unknown(raw.type, json)
|
||||||
|
)
|
||||||
|
FreeformGradient.type -> FreeformGradient(raw.colors ?: return Unknown(raw.type, json))
|
||||||
|
else -> Unknown(raw.type, json)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: BackgroundFill) {
|
||||||
|
when (value) {
|
||||||
|
is FreeformGradient -> FreeformGradient.serializer().serialize(encoder, value)
|
||||||
|
is Gradient -> Gradient.serializer().serialize(encoder, value)
|
||||||
|
is Solid -> Solid.serializer().serialize(encoder, value)
|
||||||
|
is Unknown -> value.raw ?.also {
|
||||||
|
JsonElement.serializer().serialize(encoder, it)
|
||||||
|
} ?: Unknown.serializer().serialize(encoder, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.common.Progress
|
||||||
|
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||||
|
import dev.inmo.tgbotapi.utils.IntProgress100Serializer
|
||||||
|
import dev.inmo.tgbotapi.utils.decodeDataAndJson
|
||||||
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
|
import kotlinx.serialization.EncodeDefault
|
||||||
|
import kotlinx.serialization.KSerializer
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
|
import kotlinx.serialization.encoding.Decoder
|
||||||
|
import kotlinx.serialization.encoding.Encoder
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
|
@ClassCastsIncluded
|
||||||
|
@Serializable(BackgroundType.Companion::class)
|
||||||
|
sealed interface BackgroundType {
|
||||||
|
val type: String
|
||||||
|
|
||||||
|
sealed interface Movable : BackgroundType {
|
||||||
|
val isMoving: Boolean
|
||||||
|
}
|
||||||
|
sealed interface Dimmable : BackgroundType {
|
||||||
|
val darkThemeDimming: Progress
|
||||||
|
}
|
||||||
|
sealed interface Fillable : BackgroundType {
|
||||||
|
val fill: BackgroundFill
|
||||||
|
}
|
||||||
|
sealed interface WithDocument : BackgroundType {
|
||||||
|
val document: DocumentFile
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Fill(
|
||||||
|
@SerialName(fillField)
|
||||||
|
override val fill: BackgroundFill,
|
||||||
|
@SerialName(darkThemeDimmingField)
|
||||||
|
@Serializable(IntProgress100Serializer::class)
|
||||||
|
override val darkThemeDimming: Progress
|
||||||
|
) : Fillable, Dimmable {
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
companion object {
|
||||||
|
const val type: String = "fill"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Wallpaper(
|
||||||
|
@SerialName(documentField)
|
||||||
|
override val document: DocumentFile,
|
||||||
|
@SerialName(darkThemeDimmingField)
|
||||||
|
@Serializable(IntProgress100Serializer::class)
|
||||||
|
override val darkThemeDimming: Progress,
|
||||||
|
@SerialName(isBlurredField)
|
||||||
|
val isBlurred: Boolean = false,
|
||||||
|
@SerialName(isMovingField)
|
||||||
|
override val isMoving: Boolean = false
|
||||||
|
) : WithDocument, Dimmable, Movable {
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
companion object {
|
||||||
|
const val type: String = "wallpaper"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Pattern(
|
||||||
|
@SerialName(documentField)
|
||||||
|
override val document: DocumentFile,
|
||||||
|
@SerialName(fillField)
|
||||||
|
override val fill: BackgroundFill,
|
||||||
|
@SerialName(intensityField)
|
||||||
|
@Serializable(IntProgress100Serializer::class)
|
||||||
|
val intensity: Progress,
|
||||||
|
@SerialName(isInvertedField)
|
||||||
|
val isInverted: Boolean = false,
|
||||||
|
@SerialName(isMovingField)
|
||||||
|
override val isMoving: Boolean = false
|
||||||
|
) : WithDocument, Fillable, Movable {
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
companion object {
|
||||||
|
const val type: String = "pattern"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class ChatTheme(
|
||||||
|
@SerialName(themeNameField)
|
||||||
|
val themeName: String
|
||||||
|
): BackgroundType {
|
||||||
|
@EncodeDefault
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String = Companion.type
|
||||||
|
companion object {
|
||||||
|
const val type: String = "chat_theme"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Unknown(
|
||||||
|
@SerialName(typeField)
|
||||||
|
override val type: String,
|
||||||
|
val raw: JsonElement?
|
||||||
|
): BackgroundType
|
||||||
|
|
||||||
|
companion object : KSerializer<BackgroundType> {
|
||||||
|
@Serializable
|
||||||
|
data class RawBackgroundType(
|
||||||
|
val type: String,
|
||||||
|
@SerialName(fillField)
|
||||||
|
val fill: BackgroundFill? = null,
|
||||||
|
@SerialName(darkThemeDimmingField)
|
||||||
|
@Serializable(IntProgress100Serializer::class)
|
||||||
|
val darkThemeDimming: Progress? = null,
|
||||||
|
@SerialName(documentField)
|
||||||
|
val document: DocumentFile? = null,
|
||||||
|
@SerialName(isBlurredField)
|
||||||
|
val isBlurred: Boolean = false,
|
||||||
|
@SerialName(isMovingField)
|
||||||
|
val isMoving: Boolean = false,
|
||||||
|
@SerialName(intensityField)
|
||||||
|
@Serializable(IntProgress100Serializer::class)
|
||||||
|
val intensity: Progress? = null,
|
||||||
|
@SerialName(isInvertedField)
|
||||||
|
val isInverted: Boolean = false,
|
||||||
|
@SerialName(themeNameField)
|
||||||
|
val themeName: String? = null
|
||||||
|
)
|
||||||
|
|
||||||
|
override val descriptor: SerialDescriptor
|
||||||
|
get() = RawBackgroundType.serializer().descriptor
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): BackgroundType {
|
||||||
|
val (raw, json) = decoder.decodeDataAndJson(RawBackgroundType.serializer())
|
||||||
|
val unknown by lazy { Unknown(raw.type, json) }
|
||||||
|
return when (raw.type) {
|
||||||
|
Fill.type -> Fill(
|
||||||
|
raw.fill ?: return unknown,
|
||||||
|
raw.darkThemeDimming ?: return unknown
|
||||||
|
)
|
||||||
|
Wallpaper.type -> Wallpaper(
|
||||||
|
document = raw.document ?: return unknown,
|
||||||
|
darkThemeDimming = raw.darkThemeDimming ?: return unknown,
|
||||||
|
isBlurred = raw.isBlurred,
|
||||||
|
isMoving = raw.isMoving
|
||||||
|
)
|
||||||
|
Pattern.type -> Pattern(
|
||||||
|
document = raw.document ?: return unknown,
|
||||||
|
fill = raw.fill ?: return unknown,
|
||||||
|
intensity = raw.intensity ?: return unknown,
|
||||||
|
isInverted = raw.isInverted,
|
||||||
|
isMoving = raw.isMoving
|
||||||
|
)
|
||||||
|
ChatTheme.type -> ChatTheme(
|
||||||
|
raw.themeName ?: return unknown
|
||||||
|
)
|
||||||
|
else -> unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: BackgroundType) {
|
||||||
|
when (value) {
|
||||||
|
is ChatTheme -> ChatTheme.serializer().serialize(encoder, value)
|
||||||
|
is Fill -> Fill.serializer().serialize(encoder, value)
|
||||||
|
is Wallpaper -> Wallpaper.serializer().serialize(encoder, value)
|
||||||
|
is Pattern -> Pattern.serializer().serialize(encoder, value)
|
||||||
|
is Unknown -> value.raw ?.also {
|
||||||
|
JsonElement.serializer().serialize(encoder, it)
|
||||||
|
} ?: Unknown.serializer().serialize(encoder, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.utils.BuiltinMimeTypes
|
import dev.inmo.tgbotapi.utils.BuiltinMimeTypes
|
||||||
|
|
||||||
typealias ForwardSignature = String
|
typealias ForwardSignature = String
|
||||||
@@ -47,7 +48,7 @@ val pollOptionTextLength = 1 .. 100
|
|||||||
val pollQuestionTextLength = 1 .. 300
|
val pollQuestionTextLength = 1 .. 300
|
||||||
val pollOptionsLimit = 2 .. 10
|
val pollOptionsLimit = 2 .. 10
|
||||||
|
|
||||||
val livePeriodLimit = 60 .. 86400
|
val livePeriodLimit = 60 .. LiveLocation.INDEFINITE_LIVE_PERIOD
|
||||||
|
|
||||||
val inlineQueryAnswerResultsLimit = 0 .. 50
|
val inlineQueryAnswerResultsLimit = 0 .. 50
|
||||||
|
|
||||||
@@ -122,6 +123,7 @@ const val disableWebPagePreviewField = "disable_web_page_preview"
|
|||||||
const val linkPreviewOptionsField = "link_preview_options"
|
const val linkPreviewOptionsField = "link_preview_options"
|
||||||
const val disableNotificationField = "disable_notification"
|
const val disableNotificationField = "disable_notification"
|
||||||
const val protectContentField = "protect_content"
|
const val protectContentField = "protect_content"
|
||||||
|
const val messageEffectIdField = "message_effect_id"
|
||||||
const val removeCaptionField = "remove_caption"
|
const val removeCaptionField = "remove_caption"
|
||||||
const val replyToMessageIdField = "reply_to_message_id"
|
const val replyToMessageIdField = "reply_to_message_id"
|
||||||
const val replyParametersField = "reply_parameters"
|
const val replyParametersField = "reply_parameters"
|
||||||
@@ -150,6 +152,7 @@ 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 maxReactionCountField = "max_reaction_count"
|
||||||
const val personalChatField = "personal_chat"
|
const val personalChatField = "personal_chat"
|
||||||
const val birthdateField = "birthdate"
|
const val birthdateField = "birthdate"
|
||||||
const val hasVisibleHistoryField = "has_visible_history"
|
const val hasVisibleHistoryField = "has_visible_history"
|
||||||
@@ -162,6 +165,7 @@ 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 canConnectToBusinessField = "can_connect_to_business"
|
||||||
const val textEntitiesField = "text_entities"
|
const val textEntitiesField = "text_entities"
|
||||||
|
const val textParseModeField = "text_parse_mode"
|
||||||
const val entitiesField = "entities"
|
const val entitiesField = "entities"
|
||||||
const val stickerSetNameField = "set_name"
|
const val stickerSetNameField = "set_name"
|
||||||
const val customEmojiIdField = "custom_emoji_id"
|
const val customEmojiIdField = "custom_emoji_id"
|
||||||
@@ -224,6 +228,7 @@ const val canEditStoriesField = "can_edit_stories"
|
|||||||
const val canDeleteStoriesField = "can_delete_stories"
|
const val canDeleteStoriesField = "can_delete_stories"
|
||||||
const val captionEntitiesField = "caption_entities"
|
const val captionEntitiesField = "caption_entities"
|
||||||
const val hasSpoilerField = "has_spoiler"
|
const val hasSpoilerField = "has_spoiler"
|
||||||
|
const val showCaptionAboveMediaField = "show_caption_above_media"
|
||||||
const val loginUrlField = "login_url"
|
const val loginUrlField = "login_url"
|
||||||
const val forwardTextField = "forward_text"
|
const val forwardTextField = "forward_text"
|
||||||
const val botUsernameField = "bot_username"
|
const val botUsernameField = "bot_username"
|
||||||
@@ -234,6 +239,7 @@ const val isAnimatedField = "is_animated"
|
|||||||
const val isVideoField = "is_video"
|
const val isVideoField = "is_video"
|
||||||
const val inviteLinkField = "invite_link"
|
const val inviteLinkField = "invite_link"
|
||||||
const val viaChatFolderInviteLinkField = "via_chat_folder_invite_link"
|
const val viaChatFolderInviteLinkField = "via_chat_folder_invite_link"
|
||||||
|
const val viaJoinRequestField = "via_join_request"
|
||||||
const val pinnedMessageField = "pinned_message"
|
const val pinnedMessageField = "pinned_message"
|
||||||
const val activeUsernamesField = "active_usernames"
|
const val activeUsernamesField = "active_usernames"
|
||||||
const val customTitleField = "custom_title"
|
const val customTitleField = "custom_title"
|
||||||
@@ -440,6 +446,8 @@ const val resultsField = "results"
|
|||||||
const val resultField = "result"
|
const val resultField = "result"
|
||||||
const val certificateField = "certificate"
|
const val certificateField = "certificate"
|
||||||
const val questionField = "question"
|
const val questionField = "question"
|
||||||
|
const val questionEntitiesField = "question_entities"
|
||||||
|
const val questionParseModeField = "question_parse_mode"
|
||||||
const val optionsField = "options"
|
const val optionsField = "options"
|
||||||
const val payField = "pay"
|
const val payField = "pay"
|
||||||
const val permissionsField = "permissions"
|
const val permissionsField = "permissions"
|
||||||
@@ -600,6 +608,20 @@ const val businessIntroField = "business_intro"
|
|||||||
const val businessLocationField = "business_location"
|
const val businessLocationField = "business_location"
|
||||||
const val businessOpeningHoursField = "business_opening_hours"
|
const val businessOpeningHoursField = "business_opening_hours"
|
||||||
|
|
||||||
|
const val colorField = "color"
|
||||||
|
const val colorsField = "colors"
|
||||||
|
const val topColorField = "top_color"
|
||||||
|
const val bottomColorField = "bottom_color"
|
||||||
|
const val rotationAngleField = "rotation_angle"
|
||||||
|
|
||||||
|
const val fillField = "fill"
|
||||||
|
const val darkThemeDimmingField = "dark_theme_dimming"
|
||||||
|
const val isBlurredField = "is_blurred"
|
||||||
|
const val isInvertedField = "is_inverted"
|
||||||
|
const val isMovingField = "is_moving"
|
||||||
|
const val intensityField = "intensity"
|
||||||
|
const val themeNameField = "theme_name"
|
||||||
|
|
||||||
const val dayField = "day"
|
const val dayField = "day"
|
||||||
const val monthField = "month"
|
const val monthField = "month"
|
||||||
const val yearField = "year"
|
const val yearField = "year"
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlin.jvm.JvmInline
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
@JvmInline
|
||||||
|
value class EffectId(val string: String)
|
||||||
@@ -22,26 +22,39 @@ fun InlineQueryResultGifCachedImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifCachedImpl(id, fileId, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultGifCachedImpl(
|
||||||
|
id = id,
|
||||||
|
fileId = fileId,
|
||||||
|
title = title,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultGifCachedImpl(
|
fun InlineQueryResultGifCachedImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
fileId: FileId,
|
fileId: FileId,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifCachedImpl(
|
) = InlineQueryResultGifCachedImpl(
|
||||||
id,
|
id = id,
|
||||||
fileId,
|
fileId = fileId,
|
||||||
title,
|
title = title,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -58,6 +71,8 @@ data class InlineQueryResultGifCachedImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -28,9 +28,25 @@ fun InlineQueryResultGifImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultGifImpl(
|
||||||
|
id = id,
|
||||||
|
url = url,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
title = title,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultGifImpl(
|
fun InlineQueryResultGifImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -42,22 +58,24 @@ fun InlineQueryResultGifImpl(
|
|||||||
duration: Int? = null,
|
duration: Int? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifImpl(
|
) = InlineQueryResultGifImpl(
|
||||||
id,
|
id = id,
|
||||||
url,
|
url = url,
|
||||||
thumbnailUrl,
|
thumbnailUrl = thumbnailUrl,
|
||||||
thumbnailMimeType,
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
width,
|
width = width,
|
||||||
height,
|
height = height,
|
||||||
duration,
|
duration = duration,
|
||||||
title,
|
title = title,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
fun InlineQueryResultGifImpl(
|
fun InlineQueryResultGifImpl(
|
||||||
@@ -71,9 +89,24 @@ fun InlineQueryResultGifImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifImpl(id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, replyMarkup, inputMessageContent)
|
) = InlineQueryResultGifImpl(
|
||||||
|
id = id,
|
||||||
|
url = gifFile.fileId,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
title = title,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultGifImpl(
|
fun InlineQueryResultGifImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -85,10 +118,22 @@ fun InlineQueryResultGifImpl(
|
|||||||
duration: Int? = null,
|
duration: Int? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultGifImpl(
|
) = InlineQueryResultGifImpl(
|
||||||
id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, entities, replyMarkup, inputMessageContent
|
id = id,
|
||||||
|
url = gifFile.fileId,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
title = title,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -115,6 +160,8 @@ data class InlineQueryResultGifImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -22,26 +22,39 @@ fun InlineQueryResultMpeg4GifCachedImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultMpeg4GifCachedImpl(id, fileId, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultMpeg4GifCachedImpl(
|
||||||
|
id = id,
|
||||||
|
fileId = fileId,
|
||||||
|
title = title,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultMpeg4GifCachedImpl(
|
fun InlineQueryResultMpeg4GifCachedImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
fileId: FileId,
|
fileId: FileId,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultMpeg4GifCachedImpl(
|
) = InlineQueryResultMpeg4GifCachedImpl(
|
||||||
id,
|
id = id,
|
||||||
fileId,
|
fileId = fileId,
|
||||||
title,
|
title = title,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -58,6 +71,8 @@ data class InlineQueryResultMpeg4GifCachedImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -27,9 +27,25 @@ fun InlineQueryResultMpeg4GifImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultMpeg4GifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultMpeg4GifImpl(
|
||||||
|
id = id,
|
||||||
|
url = url,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
title = title,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultMpeg4GifImpl(
|
fun InlineQueryResultMpeg4GifImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -41,22 +57,24 @@ fun InlineQueryResultMpeg4GifImpl(
|
|||||||
duration: Int? = null,
|
duration: Int? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultMpeg4GifImpl(
|
) = InlineQueryResultMpeg4GifImpl(
|
||||||
id,
|
id = id,
|
||||||
url,
|
url = url,
|
||||||
thumbnailUrl,
|
thumbnailUrl = thumbnailUrl,
|
||||||
thumbnailMimeType,
|
thumbnailMimeType = thumbnailMimeType,
|
||||||
width,
|
width = width,
|
||||||
height,
|
height = height,
|
||||||
duration,
|
duration = duration,
|
||||||
title,
|
title = title,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -83,6 +101,8 @@ data class InlineQueryResultMpeg4GifImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -23,9 +23,21 @@ fun InlineQueryResultPhotoCachedImpl(
|
|||||||
description: String? = null,
|
description: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultPhotoCachedImpl(id, fileId, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultPhotoCachedImpl(
|
||||||
|
id = id,
|
||||||
|
fileId = fileId,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultPhotoCachedImpl(
|
fun InlineQueryResultPhotoCachedImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -33,18 +45,20 @@ fun InlineQueryResultPhotoCachedImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultPhotoCachedImpl(
|
) = InlineQueryResultPhotoCachedImpl(
|
||||||
id,
|
id = id,
|
||||||
fileId,
|
fileId = fileId,
|
||||||
title,
|
title = title,
|
||||||
description,
|
description = description,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -63,6 +77,8 @@ data class InlineQueryResultPhotoCachedImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -25,9 +25,24 @@ fun InlineQueryResultPhotoImpl(
|
|||||||
description: String? = null,
|
description: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultPhotoImpl(id, url, thumbnailUrl, width, height, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultPhotoImpl(
|
||||||
|
id = id,
|
||||||
|
url = url,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultPhotoImpl(
|
fun InlineQueryResultPhotoImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -38,21 +53,23 @@ fun InlineQueryResultPhotoImpl(
|
|||||||
title: String? = null,
|
title: String? = null,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultPhotoImpl(
|
) = InlineQueryResultPhotoImpl(
|
||||||
id,
|
id = id,
|
||||||
url,
|
url = url,
|
||||||
thumbnailUrl,
|
thumbnailUrl = thumbnailUrl,
|
||||||
width,
|
width = width,
|
||||||
height,
|
height = height,
|
||||||
title,
|
title = title,
|
||||||
description,
|
description = description,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -77,6 +94,8 @@ data class InlineQueryResultPhotoImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -23,9 +23,21 @@ fun InlineQueryResultVideoCachedImpl(
|
|||||||
description: String? = null,
|
description: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultVideoCachedImpl(id, fileId, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultVideoCachedImpl(
|
||||||
|
id = id,
|
||||||
|
fileId = fileId,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultVideoCachedImpl(
|
fun InlineQueryResultVideoCachedImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -33,18 +45,20 @@ fun InlineQueryResultVideoCachedImpl(
|
|||||||
title: String,
|
title: String,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultVideoCachedImpl(
|
) = InlineQueryResultVideoCachedImpl(
|
||||||
id,
|
id = id,
|
||||||
fileId,
|
fileId = fileId,
|
||||||
title,
|
title = title,
|
||||||
description,
|
description = description,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -63,6 +77,8 @@ data class InlineQueryResultVideoCachedImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -28,9 +28,26 @@ fun InlineQueryResultVideoImpl(
|
|||||||
description: String? = null,
|
description: String? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultVideoImpl(id, url, thumbnailUrl, mimeType, title, width, height, duration, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
) = InlineQueryResultVideoImpl(
|
||||||
|
id = id,
|
||||||
|
url = url,
|
||||||
|
thumbnailUrl = thumbnailUrl,
|
||||||
|
mimeType = mimeType,
|
||||||
|
title = title,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
description = description,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
|
)
|
||||||
|
|
||||||
fun InlineQueryResultVideoImpl(
|
fun InlineQueryResultVideoImpl(
|
||||||
id: InlineQueryId,
|
id: InlineQueryId,
|
||||||
@@ -43,23 +60,25 @@ fun InlineQueryResultVideoImpl(
|
|||||||
duration: Int? = null,
|
duration: Int? = null,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
inputMessageContent: InputMessageContent? = null
|
inputMessageContent: InputMessageContent? = null
|
||||||
) = InlineQueryResultVideoImpl(
|
) = InlineQueryResultVideoImpl(
|
||||||
id,
|
id = id,
|
||||||
url,
|
url = url,
|
||||||
thumbnailUrl,
|
thumbnailUrl = thumbnailUrl,
|
||||||
mimeType,
|
mimeType = mimeType,
|
||||||
title,
|
title = title,
|
||||||
width,
|
width = width,
|
||||||
height,
|
height = height,
|
||||||
duration,
|
duration = duration,
|
||||||
description,
|
description = description,
|
||||||
entities.makeString(),
|
text = entities.makeString(),
|
||||||
null,
|
parseMode = null,
|
||||||
entities.toRawMessageEntities(),
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
replyMarkup,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
inputMessageContent
|
replyMarkup = replyMarkup,
|
||||||
|
inputMessageContent = inputMessageContent
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -88,6 +107,8 @@ data class InlineQueryResultVideoImpl internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
@SerialName(inputMessageContentField)
|
@SerialName(inputMessageContentField)
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||||
|
|
||||||
|
interface WithCustomizableCaptionInlineQueryResult : InlineQueryResult, WithCustomizableCaption
|
||||||
@@ -8,4 +8,5 @@ const val inlineQueryResultGifType = "gif"
|
|||||||
interface InlineQueryResultGifCommon : InlineQueryResult,
|
interface InlineQueryResultGifCommon : InlineQueryResult,
|
||||||
OptionallyTitledInlineQueryResult,
|
OptionallyTitledInlineQueryResult,
|
||||||
TextedOutput,
|
TextedOutput,
|
||||||
WithInputMessageContentInlineQueryResult
|
WithInputMessageContentInlineQueryResult,
|
||||||
|
WithCustomizableCaptionInlineQueryResult
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ const val inlineQueryResultMpeg4GifType = "mpeg4_gif"
|
|||||||
interface InlineQueryResultMpeg4GifCommon : InlineQueryResult,
|
interface InlineQueryResultMpeg4GifCommon : InlineQueryResult,
|
||||||
OptionallyTitledInlineQueryResult,
|
OptionallyTitledInlineQueryResult,
|
||||||
TextedOutput,
|
TextedOutput,
|
||||||
WithInputMessageContentInlineQueryResult
|
WithInputMessageContentInlineQueryResult,
|
||||||
|
WithCustomizableCaptionInlineQueryResult
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ interface InlineQueryResultPhotoCommon : InlineQueryResult,
|
|||||||
OptionallyTitledInlineQueryResult,
|
OptionallyTitledInlineQueryResult,
|
||||||
DescribedInlineQueryResult,
|
DescribedInlineQueryResult,
|
||||||
TextedOutput,
|
TextedOutput,
|
||||||
WithInputMessageContentInlineQueryResult
|
WithInputMessageContentInlineQueryResult,
|
||||||
|
WithCustomizableCaptionInlineQueryResult
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ interface InlineQueryResultVideoCommon : InlineQueryResult,
|
|||||||
TitledInlineQueryResult,
|
TitledInlineQueryResult,
|
||||||
DescribedInlineQueryResult,
|
DescribedInlineQueryResult,
|
||||||
TextedOutput,
|
TextedOutput,
|
||||||
WithInputMessageContentInlineQueryResult
|
WithInputMessageContentInlineQueryResult,
|
||||||
|
WithCustomizableCaptionInlineQueryResult
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.*
|
|||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ class InputInvoiceMessageContent(
|
|||||||
@SerialName(payloadField)
|
@SerialName(payloadField)
|
||||||
override val payload: String,
|
override val payload: String,
|
||||||
@SerialName(providerTokenField)
|
@SerialName(providerTokenField)
|
||||||
override val providerToken: String,
|
override val providerToken: String?,
|
||||||
@SerialName(currencyField)
|
@SerialName(currencyField)
|
||||||
override val currency: Currency,
|
override val currency: Currency,
|
||||||
@Serializable(LabeledPricesSerializer::class)
|
@Serializable(LabeledPricesSerializer::class)
|
||||||
@@ -58,6 +59,40 @@ class InputInvoiceMessageContent(
|
|||||||
override var photoHeight: Int? = null
|
override var photoHeight: Int? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
requireName: Boolean = false,
|
||||||
|
requirePhoneNumber: Boolean = false,
|
||||||
|
requireEmail: Boolean = false,
|
||||||
|
requireShippingAddress: Boolean = false,
|
||||||
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
|
priceDependOnShipAddress: Boolean = false
|
||||||
|
) : this(
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
payload = payload,
|
||||||
|
providerToken = null,
|
||||||
|
currency = Currency.XTR,
|
||||||
|
prices = prices,
|
||||||
|
maxTipAmount = maxTipAmount,
|
||||||
|
suggestedTipAmounts = suggestedTipAmounts,
|
||||||
|
providerData = providerData,
|
||||||
|
requireName = requireName,
|
||||||
|
requirePhoneNumber = requirePhoneNumber,
|
||||||
|
requireEmail = requireEmail,
|
||||||
|
requireShippingAddress = requireShippingAddress,
|
||||||
|
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||||
|
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||||
|
priceDependOnShipAddress = priceDependOnShipAddress
|
||||||
|
)
|
||||||
|
|
||||||
override fun setPhoto(
|
override fun setPhoto(
|
||||||
photoUrl: String,
|
photoUrl: String,
|
||||||
photoSize: Long?,
|
photoSize: Long?,
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package dev.inmo.tgbotapi.types.chat
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.types.BackgroundType
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||||
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent
|
||||||
|
import dev.inmo.tgbotapi.types.typeField
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class ChatBackground(
|
||||||
|
@SerialName(typeField)
|
||||||
|
val type: BackgroundType
|
||||||
|
) : PublicChatEvent
|
||||||
@@ -53,7 +53,9 @@ data class ExtendedChannelChatImpl(
|
|||||||
@SerialName(profileBackgroundCustomEmojiIdField)
|
@SerialName(profileBackgroundCustomEmojiIdField)
|
||||||
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
|
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
|
||||||
@SerialName(hasVisibleHistoryField)
|
@SerialName(hasVisibleHistoryField)
|
||||||
override val newMembersSeeHistory: Boolean = false
|
override val newMembersSeeHistory: Boolean = false,
|
||||||
|
@SerialName(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : ExtendedChannelChat
|
) : ExtendedChannelChat
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -92,6 +94,8 @@ data class ExtendedGroupChatImpl(
|
|||||||
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
|
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
|
||||||
@SerialName(hasVisibleHistoryField)
|
@SerialName(hasVisibleHistoryField)
|
||||||
override val newMembersSeeHistory: Boolean = false,
|
override val newMembersSeeHistory: Boolean = false,
|
||||||
|
@SerialName(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : ExtendedGroupChat
|
) : ExtendedGroupChat
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -137,7 +141,9 @@ data class ExtendedPrivateChatImpl(
|
|||||||
override val birthdate: Birthdate? = null,
|
override val birthdate: Birthdate? = null,
|
||||||
@SerialName(personalChatField)
|
@SerialName(personalChatField)
|
||||||
@Serializable(PreviewChatSerializer::class)
|
@Serializable(PreviewChatSerializer::class)
|
||||||
override val personalChat: PreviewChannelChat? = null
|
override val personalChat: PreviewChannelChat? = null,
|
||||||
|
@SerialName(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : ExtendedPrivateChat
|
) : ExtendedPrivateChat
|
||||||
|
|
||||||
typealias ExtendedUser = ExtendedPrivateChatImpl
|
typealias ExtendedUser = ExtendedPrivateChatImpl
|
||||||
@@ -202,6 +208,8 @@ data class ExtendedSupergroupChatImpl(
|
|||||||
override val unrestrictBoostsCount: Int? = null,
|
override val unrestrictBoostsCount: Int? = null,
|
||||||
@SerialName(customEmojiStickerSetNameField)
|
@SerialName(customEmojiStickerSetNameField)
|
||||||
override val customEmojiStickerSetName: StickerSetName? = null,
|
override val customEmojiStickerSetName: StickerSetName? = null,
|
||||||
|
@SerialName(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : ExtendedSupergroupChat
|
) : ExtendedSupergroupChat
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -264,6 +272,8 @@ data class ExtendedForumChatImpl(
|
|||||||
override val unrestrictBoostsCount: Int? = null,
|
override val unrestrictBoostsCount: Int? = null,
|
||||||
@SerialName(customEmojiStickerSetNameField)
|
@SerialName(customEmojiStickerSetNameField)
|
||||||
override val customEmojiStickerSetName: StickerSetName? = null,
|
override val customEmojiStickerSetName: StickerSetName? = null,
|
||||||
|
@SerialName(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : ExtendedForumChat
|
) : ExtendedForumChat
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -294,6 +304,8 @@ data class ExtendedBot(
|
|||||||
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(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3,
|
||||||
) : Bot(), ExtendedChat {
|
) : Bot(), ExtendedChat {
|
||||||
@SerialName(isBotField)
|
@SerialName(isBotField)
|
||||||
private val isBot = true
|
private val isBot = true
|
||||||
@@ -321,4 +333,6 @@ data class UnknownExtendedChat(
|
|||||||
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(maxReactionCountField)
|
||||||
|
override val maxReactionsCount: Int = 3
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ sealed interface ExtendedChat : Chat {
|
|||||||
val profileAccentColorId: ColorId?
|
val profileAccentColorId: ColorId?
|
||||||
val backgroundCustomEmojiId: CustomEmojiId?
|
val backgroundCustomEmojiId: CustomEmojiId?
|
||||||
val profileBackgroundCustomEmojiId: CustomEmojiId?
|
val profileBackgroundCustomEmojiId: CustomEmojiId?
|
||||||
|
val maxReactionsCount: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable(ExtendedChatSerializer.Companion::class)
|
@Serializable(ExtendedChatSerializer.Companion::class)
|
||||||
|
|||||||
@@ -24,5 +24,7 @@ data class ChatMemberUpdated(
|
|||||||
@SerialName(inviteLinkField)
|
@SerialName(inviteLinkField)
|
||||||
val inviteLink: ChatInviteLink? = null,
|
val inviteLink: ChatInviteLink? = null,
|
||||||
@SerialName(viaChatFolderInviteLinkField)
|
@SerialName(viaChatFolderInviteLinkField)
|
||||||
val viaChatFolderInviteLink: Boolean? = false
|
val viaChatFolderInviteLink: Boolean? = false,
|
||||||
|
@SerialName(viaJoinRequestField)
|
||||||
|
val viaJoinRequest: Boolean? = false
|
||||||
) : WithPreviewChat, WithUser
|
) : WithPreviewChat, WithUser
|
||||||
|
|||||||
@@ -36,28 +36,32 @@ data class VideoFile(
|
|||||||
inline fun VideoFile.toTelegramMediaVideo(
|
inline fun VideoFile.toTelegramMediaVideo(
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false
|
||||||
) = TelegramMediaVideo(
|
) = TelegramMediaVideo(
|
||||||
fileId,
|
file = fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
spoilered = spoilered,
|
||||||
width,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
height,
|
width = width,
|
||||||
duration,
|
height = height,
|
||||||
thumbnail ?.fileId
|
duration = duration,
|
||||||
|
thumb = thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun VideoFile.toTelegramMediaVideo(
|
inline fun VideoFile.toTelegramMediaVideo(
|
||||||
textSources: TextSourcesList,
|
textSources: TextSourcesList,
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false
|
||||||
) = TelegramMediaVideo(
|
) = TelegramMediaVideo(
|
||||||
fileId,
|
file = fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered,
|
spoilered = spoilered,
|
||||||
width,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
height,
|
width = width,
|
||||||
duration,
|
height = height,
|
||||||
thumbnail ?.fileId
|
duration = duration,
|
||||||
|
thumb = thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user