mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-30 09:59:18 +00:00
Compare commits
10 Commits
b843fd9188
...
13.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| e403bbca0b | |||
| 93e06a5765 | |||
| 718f6ab366 | |||
| 6f776576ab | |||
| fcdaeb2e8f | |||
| 1e679ce50b | |||
| fe4be69051 | |||
| 06ba14e8be | |||
| ca1b196942 | |||
| dc5d8afe32 |
@@ -1,7 +1,11 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 13.1.0
|
||||||
|
|
||||||
## 13.0.0
|
## 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**
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
* `Core`:
|
* `Core`:
|
||||||
|
|||||||
@@ -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-6-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=13.0.0
|
library_version=13.1.0
|
||||||
|
|||||||
@@ -171,7 +171,8 @@ public final class dev/inmo/tgbotapi/extensions/api/LiveLocationProvider : java/
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/api/LiveLocationProviderKt {
|
public final class dev/inmo/tgbotapi/extensions/api/LiveLocationProviderKt {
|
||||||
public static final fun getDefaultLivePeriodDelayMillis ()J
|
public static final field defaultLivePeriodDelayMillis J
|
||||||
|
public static final field indefiniteLivePeriodDelayMillis J
|
||||||
public static final fun replyWithLiveLocation-036Eddc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;DDJLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun replyWithLiveLocation-036Eddc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;DDJLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun replyWithLiveLocation-036Eddc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;DDJLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun replyWithLiveLocation-036Eddc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;DDJLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static final fun replyWithLiveLocation-bUFzSfA (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/types/location/StaticLocation;JLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun replyWithLiveLocation-bUFzSfA (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/types/location/StaticLocation;JLjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
|
|||||||
@@ -50,22 +50,30 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
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,
|
||||||
@@ -83,7 +91,6 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
message = capturedLiveLocationMessage,
|
message = capturedLiveLocationMessage,
|
||||||
latitude = it.latitude,
|
latitude = it.latitude,
|
||||||
longitude = it.longitude,
|
longitude = it.longitude,
|
||||||
livePeriod = null,
|
|
||||||
horizontalAccuracy = it.horizontalAccuracy,
|
horizontalAccuracy = it.horizontalAccuracy,
|
||||||
heading = it.heading,
|
heading = it.heading,
|
||||||
proximityAlertRadius = it.proximityAlertRadius,
|
proximityAlertRadius = it.proximityAlertRadius,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -33,21 +34,22 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -60,6 +62,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,
|
||||||
@@ -71,7 +74,22 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,6 +102,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,
|
||||||
@@ -94,7 +113,24 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, 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,
|
||||||
|
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 +141,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,
|
||||||
@@ -115,7 +152,23 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,6 +180,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,
|
||||||
@@ -139,20 +193,21 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -164,6 +219,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,
|
||||||
@@ -175,7 +231,21 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,6 +257,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,
|
||||||
@@ -197,7 +268,23 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, 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,
|
||||||
|
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 +294,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,
|
||||||
@@ -217,4 +305,19 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ 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,
|
||||||
@@ -29,17 +30,18 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52,6 +54,7 @@ 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,
|
||||||
@@ -59,7 +62,20 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, 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,
|
||||||
|
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,6 +86,7 @@ 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,
|
||||||
@@ -77,7 +94,20 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, 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,
|
||||||
|
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,6 +118,7 @@ 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,
|
||||||
@@ -95,7 +126,20 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, 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,
|
||||||
|
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,6 +150,7 @@ 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,
|
||||||
@@ -113,7 +158,20 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, 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,
|
||||||
|
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,6 +182,7 @@ 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,
|
||||||
@@ -131,7 +190,20 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,6 +214,7 @@ 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,
|
||||||
@@ -151,16 +224,17 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -172,6 +246,7 @@ 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,
|
||||||
@@ -179,7 +254,19 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, 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,
|
||||||
|
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,6 +276,7 @@ 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,
|
||||||
@@ -196,7 +284,19 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, 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,
|
||||||
|
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,6 +306,7 @@ 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,
|
||||||
@@ -213,7 +314,19 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, 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,
|
||||||
|
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,6 +336,7 @@ 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,
|
||||||
@@ -230,7 +344,19 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, 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,
|
||||||
|
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,6 +366,7 @@ 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,
|
||||||
@@ -247,4 +374,16 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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,
|
||||||
@@ -33,22 +34,23 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -61,6 +63,7 @@ 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,
|
||||||
@@ -68,7 +71,24 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, 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,
|
||||||
|
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 +100,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,
|
||||||
@@ -90,7 +111,24 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,6 +140,7 @@ 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,
|
||||||
@@ -109,7 +148,20 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, 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,
|
||||||
|
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 +172,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,
|
||||||
@@ -132,21 +185,22 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -158,6 +212,7 @@ 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,
|
||||||
@@ -165,7 +220,23 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, 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,
|
||||||
|
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 +247,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,
|
||||||
@@ -186,7 +258,23 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,6 +285,7 @@ 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,
|
||||||
@@ -204,4 +293,16 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, entities, spoilered, threadId, 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,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = 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)
|
||||||
|
)
|
||||||
|
|||||||
@@ -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]
|
||||||
@@ -68,3 +69,61 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
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, 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,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
startParameter: StartParameter? = 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,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendInvoice(chatId, title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, 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,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
startParameter: StartParameter? = 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,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = sendInvoice(user.id, title, description, payload, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -13541,7 +13541,7 @@ public final class dev/inmo/tgbotapi/types/chat/Chat$Companion {
|
|||||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/types/chat/ChatBackground : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent {
|
public final class dev/inmo/tgbotapi/types/chat/ChatBackground : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/PublicChatEvent {
|
||||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ChatBackground$Companion;
|
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ChatBackground$Companion;
|
||||||
public fun <init> (Ldev/inmo/tgbotapi/types/BackgroundType;)V
|
public fun <init> (Ldev/inmo/tgbotapi/types/BackgroundType;)V
|
||||||
public final fun component1 ()Ldev/inmo/tgbotapi/types/BackgroundType;
|
public final fun component1 ()Ldev/inmo/tgbotapi/types/BackgroundType;
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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,
|
||||||
@@ -42,22 +43,23 @@ 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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (animationAsFile == null && thumbAsFile == null) {
|
return if (animationAsFile == null && thumbAsFile == null) {
|
||||||
@@ -75,6 +77,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,
|
||||||
@@ -90,22 +93,23 @@ 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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (animationAsFile == null && thumbAsFile == null) {
|
return if (animationAsFile == null && thumbAsFile == null) {
|
||||||
@@ -135,6 +139,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)
|
||||||
@@ -162,6 +168,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 {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ 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,
|
||||||
@@ -34,18 +35,19 @@ fun SendPhoto(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
return if (photo is MultipartFile) {
|
return if (photo is MultipartFile) {
|
||||||
CommonMultipartFileRequest(
|
CommonMultipartFileRequest(
|
||||||
@@ -61,6 +63,7 @@ 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,
|
||||||
@@ -70,18 +73,19 @@ fun SendPhoto(
|
|||||||
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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (photo is MultipartFile) {
|
return if (photo is MultipartFile) {
|
||||||
@@ -109,6 +113,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)
|
||||||
@@ -127,6 +133,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 {
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -43,23 +44,24 @@ 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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (videoAsFile == null && thumbAsFile == null) {
|
return if (videoAsFile == null && thumbAsFile == null) {
|
||||||
@@ -77,6 +79,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,
|
||||||
@@ -93,23 +96,24 @@ 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
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (videoAsFile == null && thumbAsFile == null) {
|
return if (videoAsFile == null && thumbAsFile == null) {
|
||||||
@@ -139,6 +143,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)
|
||||||
@@ -168,6 +174,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 {
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -12,6 +12,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 +32,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)
|
||||||
@@ -95,6 +96,52 @@ 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,
|
||||||
|
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,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) : this(
|
||||||
|
chatId = chatId,
|
||||||
|
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,
|
||||||
|
threadId = threadId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
suggestedTipAmounts ?.let { _ ->
|
suggestedTipAmounts ?.let { _ ->
|
||||||
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
require(suggestedTipAmounts.size in suggestedTipAmountsLimit)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -226,6 +227,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"
|
||||||
|
|||||||
@@ -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?,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.chat
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.BackgroundType
|
import dev.inmo.tgbotapi.types.BackgroundType
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
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 dev.inmo.tgbotapi.types.typeField
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
@@ -10,4 +11,4 @@ import kotlinx.serialization.Serializable
|
|||||||
data class ChatBackground(
|
data class ChatBackground(
|
||||||
@SerialName(typeField)
|
@SerialName(typeField)
|
||||||
val type: BackgroundType
|
val type: BackgroundType
|
||||||
) : CommonEvent
|
) : PublicChatEvent
|
||||||
|
|||||||
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ sealed interface AudioMediaGroupMemberTelegramMedia: MediaGroupMemberTelegramMed
|
|||||||
sealed interface DocumentMediaGroupMemberTelegramMedia: MediaGroupMemberTelegramMedia
|
sealed interface DocumentMediaGroupMemberTelegramMedia: MediaGroupMemberTelegramMedia
|
||||||
|
|
||||||
@Serializable(MediaGroupMemberTelegramMediaSerializer::class)
|
@Serializable(MediaGroupMemberTelegramMediaSerializer::class)
|
||||||
sealed interface VisualMediaGroupMemberTelegramMedia : MediaGroupMemberTelegramMedia, SpoilerableTelegramMedia
|
sealed interface VisualMediaGroupMemberTelegramMedia : MediaGroupMemberTelegramMedia, SpoilerableTelegramMedia, WithCustomizableCaptionTelegramMedia
|
||||||
|
|||||||
@@ -19,16 +19,18 @@ fun TelegramMediaAnimation(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
thumb: InputFile? = null
|
thumb: InputFile? = null
|
||||||
) = TelegramMediaAnimation(file, text, parseMode, null, spoilered, width, height, duration, thumb)
|
) = TelegramMediaAnimation(file, text, parseMode, null, spoilered, showCaptionAboveMedia, width, height, duration, thumb)
|
||||||
|
|
||||||
fun TelegramMediaAnimation(
|
fun TelegramMediaAnimation(
|
||||||
file: InputFile,
|
file: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
@@ -39,6 +41,7 @@ fun TelegramMediaAnimation(
|
|||||||
null,
|
null,
|
||||||
entities.toRawMessageEntities(),
|
entities.toRawMessageEntities(),
|
||||||
spoilered,
|
spoilered,
|
||||||
|
showCaptionAboveMedia,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
duration,
|
duration,
|
||||||
@@ -56,11 +59,13 @@ data class TelegramMediaAnimation internal constructor(
|
|||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
override val thumb: InputFile? = null
|
override val thumb: InputFile? = null
|
||||||
) : TelegramMedia, SizedTelegramMedia, DuratedTelegramMedia, ThumbedTelegramMedia, TextedOutput, SpoilerableTelegramMedia {
|
) : TelegramMedia, SizedTelegramMedia, DuratedTelegramMedia, ThumbedTelegramMedia, TextedOutput, SpoilerableTelegramMedia, WithCustomizableCaptionTelegramMedia {
|
||||||
override val type: String = "animation"
|
override val type: String = "animation"
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||||
|
|||||||
@@ -19,14 +19,16 @@ fun TelegramMediaPhoto(
|
|||||||
file: InputFile,
|
file: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
) = TelegramMediaPhoto(file, text, parseMode, null, spoilered)
|
showCaptionAboveMedia: Boolean = false
|
||||||
|
) = TelegramMediaPhoto(file, text, parseMode, null, spoilered, showCaptionAboveMedia)
|
||||||
|
|
||||||
fun TelegramMediaPhoto(
|
fun TelegramMediaPhoto(
|
||||||
file: InputFile,
|
file: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
) = TelegramMediaPhoto(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered)
|
showCaptionAboveMedia: Boolean = false
|
||||||
|
) = TelegramMediaPhoto(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered, showCaptionAboveMedia)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class TelegramMediaPhoto internal constructor(
|
data class TelegramMediaPhoto internal constructor(
|
||||||
@@ -39,6 +41,8 @@ data class TelegramMediaPhoto internal constructor(
|
|||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
) : TelegramMedia, VisualMediaGroupMemberTelegramMedia {
|
) : TelegramMedia, VisualMediaGroupMemberTelegramMedia {
|
||||||
override val type: String = photoTelegramMediaType
|
override val type: String = photoTelegramMediaType
|
||||||
override val textSources: TextSourcesList? by lazy {
|
override val textSources: TextSourcesList? by lazy {
|
||||||
@@ -55,19 +59,23 @@ data class TelegramMediaPhoto internal constructor(
|
|||||||
fun PhotoSize.toTelegramMediaPhoto(
|
fun PhotoSize.toTelegramMediaPhoto(
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false
|
||||||
): TelegramMediaPhoto = TelegramMediaPhoto(
|
): TelegramMediaPhoto = TelegramMediaPhoto(
|
||||||
fileId,
|
file = fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered
|
spoilered = spoilered,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia
|
||||||
)
|
)
|
||||||
|
|
||||||
fun PhotoSize.toTelegramMediaPhoto(
|
fun PhotoSize.toTelegramMediaPhoto(
|
||||||
textSources: TextSourcesList = emptyList(),
|
textSources: TextSourcesList = emptyList(),
|
||||||
spoilered: Boolean = false
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false
|
||||||
): TelegramMediaPhoto = TelegramMediaPhoto(
|
): TelegramMediaPhoto = TelegramMediaPhoto(
|
||||||
fileId,
|
file = fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered
|
spoilered = spoilered,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,21 +19,45 @@ fun TelegramMediaVideo(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
thumb: InputFile? = null
|
thumb: InputFile? = null
|
||||||
) = TelegramMediaVideo(file, text, parseMode, null, spoilered, width, height, duration, thumb)
|
) = TelegramMediaVideo(
|
||||||
|
file = file,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
rawEntities = null,
|
||||||
|
spoilered = spoilered,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
thumb = thumb
|
||||||
|
)
|
||||||
|
|
||||||
fun TelegramMediaVideo(
|
fun TelegramMediaVideo(
|
||||||
file: InputFile,
|
file: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
thumb: InputFile? = null
|
thumb: InputFile? = null
|
||||||
) = TelegramMediaVideo(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered, width, height, duration, thumb)
|
) = TelegramMediaVideo(
|
||||||
|
file = file,
|
||||||
|
text = entities.makeString(),
|
||||||
|
parseMode = null,
|
||||||
|
rawEntities = entities.toRawMessageEntities(),
|
||||||
|
spoilered = spoilered,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
duration = duration,
|
||||||
|
thumb = thumb
|
||||||
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class TelegramMediaVideo internal constructor (
|
data class TelegramMediaVideo internal constructor (
|
||||||
@@ -46,6 +70,8 @@ data class TelegramMediaVideo internal constructor (
|
|||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
|
@SerialName(showCaptionAboveMediaField)
|
||||||
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package dev.inmo.tgbotapi.types.media
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||||
|
|
||||||
|
sealed interface WithCustomizableCaptionTelegramMedia : TelegramMedia, WithCustomizableCaption
|
||||||
@@ -143,6 +143,10 @@ internal data class RawMessage(
|
|||||||
|
|
||||||
private val link_preview_options: LinkPreviewOptions? = null,
|
private val link_preview_options: LinkPreviewOptions? = null,
|
||||||
|
|
||||||
|
private val effect_id: EffectId? = null,
|
||||||
|
|
||||||
|
private val show_caption_above_media: Boolean = false,
|
||||||
|
|
||||||
private val reply_markup: InlineKeyboardMarkup? = null,
|
private val reply_markup: InlineKeyboardMarkup? = null,
|
||||||
|
|
||||||
// Business
|
// Business
|
||||||
@@ -176,7 +180,8 @@ internal data class RawMessage(
|
|||||||
caption,
|
caption,
|
||||||
adaptedCaptionEntities,
|
adaptedCaptionEntities,
|
||||||
has_media_spoiler ?: false,
|
has_media_spoiler ?: false,
|
||||||
quote
|
quote,
|
||||||
|
show_caption_above_media
|
||||||
)
|
)
|
||||||
animation != null -> AnimationContent(
|
animation != null -> AnimationContent(
|
||||||
animation,
|
animation,
|
||||||
@@ -184,7 +189,8 @@ internal data class RawMessage(
|
|||||||
caption,
|
caption,
|
||||||
adaptedCaptionEntities,
|
adaptedCaptionEntities,
|
||||||
has_media_spoiler ?: false,
|
has_media_spoiler ?: false,
|
||||||
quote
|
quote,
|
||||||
|
show_caption_above_media
|
||||||
)
|
)
|
||||||
document != null -> DocumentContent(
|
document != null -> DocumentContent(
|
||||||
document,
|
document,
|
||||||
@@ -203,7 +209,8 @@ internal data class RawMessage(
|
|||||||
caption,
|
caption,
|
||||||
adaptedCaptionEntities,
|
adaptedCaptionEntities,
|
||||||
has_media_spoiler ?: false,
|
has_media_spoiler ?: false,
|
||||||
quote
|
quote,
|
||||||
|
show_caption_above_media
|
||||||
)
|
)
|
||||||
sticker != null -> StickerContent(sticker)
|
sticker != null -> StickerContent(sticker)
|
||||||
dice != null -> DiceContent(dice)
|
dice != null -> DiceContent(dice)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ internal data class RawMessageEntity(
|
|||||||
"phone_number" -> 1
|
"phone_number" -> 1
|
||||||
"bold" -> 1
|
"bold" -> 1
|
||||||
"blockquote" -> 0
|
"blockquote" -> 0
|
||||||
|
"expandable_blockquote" -> 0
|
||||||
"italic" -> 1
|
"italic" -> 1
|
||||||
"text_mention" -> 1
|
"text_mention" -> 1
|
||||||
"strikethrough" -> 1
|
"strikethrough" -> 1
|
||||||
@@ -66,6 +67,7 @@ internal fun RawMessageEntity.asTextSource(
|
|||||||
"phone_number" -> PhoneNumberTextSource(sourceSubstring, subPartsWithRegulars)
|
"phone_number" -> PhoneNumberTextSource(sourceSubstring, subPartsWithRegulars)
|
||||||
"bold" -> BoldTextSource(sourceSubstring, subPartsWithRegulars)
|
"bold" -> BoldTextSource(sourceSubstring, subPartsWithRegulars)
|
||||||
"blockquote" -> BlockquoteTextSource(sourceSubstring, subPartsWithRegulars)
|
"blockquote" -> BlockquoteTextSource(sourceSubstring, subPartsWithRegulars)
|
||||||
|
"expandable_blockquote" -> ExpandableBlockquoteTextSource(sourceSubstring, subPartsWithRegulars)
|
||||||
"italic" -> ItalicTextSource(sourceSubstring, subPartsWithRegulars)
|
"italic" -> ItalicTextSource(sourceSubstring, subPartsWithRegulars)
|
||||||
"code" -> CodeTextSource(sourceSubstring)
|
"code" -> CodeTextSource(sourceSubstring)
|
||||||
"pre" -> PreTextSource(sourceSubstring, language)
|
"pre" -> PreTextSource(sourceSubstring, language)
|
||||||
@@ -186,6 +188,7 @@ internal fun TextSource.toRawMessageEntities(offset: Int = 0): List<RawMessageEn
|
|||||||
is PhoneNumberTextSource -> RawMessageEntity("phone_number", offset, length)
|
is PhoneNumberTextSource -> RawMessageEntity("phone_number", offset, length)
|
||||||
is BoldTextSource -> RawMessageEntity("bold", offset, length)
|
is BoldTextSource -> RawMessageEntity("bold", offset, length)
|
||||||
is BlockquoteTextSource -> RawMessageEntity("blockquote", offset, length)
|
is BlockquoteTextSource -> RawMessageEntity("blockquote", offset, length)
|
||||||
|
is ExpandableBlockquoteTextSource -> RawMessageEntity("expandable_blockquote", offset, length)
|
||||||
is ItalicTextSource -> RawMessageEntity("italic", offset, length)
|
is ItalicTextSource -> RawMessageEntity("italic", offset, length)
|
||||||
is CodeTextSource -> RawMessageEntity("code", offset, length)
|
is CodeTextSource -> RawMessageEntity("code", offset, length)
|
||||||
is PreTextSource -> RawMessageEntity("pre", offset, length, language = language)
|
is PreTextSource -> RawMessageEntity("pre", offset, length, language = language)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.SpoilerableData
|
import dev.inmo.tgbotapi.abstracts.SpoilerableData
|
||||||
import dev.inmo.tgbotapi.abstracts.TextedInput
|
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
@@ -142,6 +143,7 @@ sealed interface MediaContent: MessageContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sealed interface SpoilerableMediaContent : MediaContent, SpoilerableData
|
sealed interface SpoilerableMediaContent : MediaContent, SpoilerableData
|
||||||
|
sealed interface WithCustomizedCaptionMediaContent : MediaContent, TextedContent, WithCustomizableCaption
|
||||||
|
|
||||||
@ClassCastsIncluded
|
@ClassCastsIncluded
|
||||||
sealed interface ResendableContent {
|
sealed interface ResendableContent {
|
||||||
|
|||||||
@@ -38,6 +38,6 @@ sealed interface MediaGroupPartContent : TextedMediaContent {
|
|||||||
fun toMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia
|
fun toMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed interface VisualMediaGroupPartContent : MediaGroupPartContent, SpoilerableMediaContent {
|
sealed interface VisualMediaGroupPartContent : MediaGroupPartContent, SpoilerableMediaContent, WithCustomizedCaptionMediaContent {
|
||||||
override fun toMediaGroupMemberTelegramMedia(): VisualMediaGroupMemberTelegramMedia
|
override fun toMediaGroupMemberTelegramMedia(): VisualMediaGroupMemberTelegramMedia
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ data class AnimationContent(
|
|||||||
override val text: String?,
|
override val text: String?,
|
||||||
override val textSources: TextSourcesList = emptyList(),
|
override val textSources: TextSourcesList = emptyList(),
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
override val quote: TextQuote? = null
|
override val quote: TextQuote? = null,
|
||||||
) : TextedMediaContent, SpoilerableMediaContent {
|
override val showCaptionAboveMedia: Boolean = false
|
||||||
|
) : TextedMediaContent, SpoilerableMediaContent, WithCustomizedCaptionMediaContent {
|
||||||
override fun createResend(
|
override fun createResend(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId?,
|
messageThreadId: MessageThreadId?,
|
||||||
@@ -30,29 +31,31 @@ data class AnimationContent(
|
|||||||
replyParameters: ReplyParameters?,
|
replyParameters: ReplyParameters?,
|
||||||
replyMarkup: KeyboardMarkup?
|
replyMarkup: KeyboardMarkup?
|
||||||
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
media.fileId,
|
animation = media.fileId,
|
||||||
media.thumbnail ?.fileId,
|
thumbnail = media.thumbnail ?.fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
media.duration,
|
spoilered = spoilered,
|
||||||
media.width,
|
duration = media.duration,
|
||||||
media.height,
|
width = media.width,
|
||||||
messageThreadId,
|
height = media.height,
|
||||||
businessConnectionId,
|
threadId = messageThreadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun asTelegramMedia(): TelegramMediaAnimation = TelegramMediaAnimation(
|
override fun asTelegramMedia(): TelegramMediaAnimation = TelegramMediaAnimation(
|
||||||
media.fileId,
|
file = media.fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered,
|
spoilered = spoilered,
|
||||||
media.width,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
media.height,
|
width = media.width,
|
||||||
media.duration,
|
height = media.height,
|
||||||
media.thumbnail ?.fileId
|
duration = media.duration,
|
||||||
|
thumb = media.thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ data class PhotoContent(
|
|||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
override val textSources: TextSourcesList = emptyList(),
|
override val textSources: TextSourcesList = emptyList(),
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
override val quote: TextQuote? = null
|
override val quote: TextQuote? = null,
|
||||||
|
override val showCaptionAboveMedia: Boolean = false
|
||||||
) : MediaCollectionContent<PhotoSize>, VisualMediaGroupPartContent, WithOptionalQuoteInfo {
|
) : MediaCollectionContent<PhotoSize>, VisualMediaGroupPartContent, WithOptionalQuoteInfo {
|
||||||
override val media: PhotoSize = mediaCollection.biggest() ?: throw IllegalStateException("Can't locate any photo size for this content")
|
override val media: PhotoSize = mediaCollection.biggest() ?: throw IllegalStateException("Can't locate any photo size for this content")
|
||||||
|
|
||||||
@@ -32,19 +33,20 @@ data class PhotoContent(
|
|||||||
replyParameters: ReplyParameters?,
|
replyParameters: ReplyParameters?,
|
||||||
replyMarkup: KeyboardMarkup?
|
replyMarkup: KeyboardMarkup?
|
||||||
): Request<ContentMessage<PhotoContent>> = SendPhoto(
|
): Request<ContentMessage<PhotoContent>> = SendPhoto(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
media.fileId,
|
photo = media.fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
messageThreadId,
|
spoilered = spoilered,
|
||||||
businessConnectionId,
|
threadId = messageThreadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaPhoto = asTelegramMedia()
|
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaPhoto = asTelegramMedia()
|
||||||
|
|
||||||
override fun asTelegramMedia(): TelegramMediaPhoto = media.toTelegramMediaPhoto(textSources, spoilered)
|
override fun asTelegramMedia(): TelegramMediaPhoto = media.toTelegramMediaPhoto(textSources, spoilered, showCaptionAboveMedia)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ data class VideoContent(
|
|||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
override val textSources: TextSourcesList = emptyList(),
|
override val textSources: TextSourcesList = emptyList(),
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
override val quote: TextQuote? = null
|
override val quote: TextQuote? = null,
|
||||||
|
override val showCaptionAboveMedia: Boolean = false
|
||||||
) : VisualMediaGroupPartContent {
|
) : VisualMediaGroupPartContent {
|
||||||
override fun createResend(
|
override fun createResend(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -29,24 +30,29 @@ data class VideoContent(
|
|||||||
replyParameters: ReplyParameters?,
|
replyParameters: ReplyParameters?,
|
||||||
replyMarkup: KeyboardMarkup?
|
replyMarkup: KeyboardMarkup?
|
||||||
): Request<ContentMessage<VideoContent>> = SendVideo(
|
): Request<ContentMessage<VideoContent>> = SendVideo(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
media.fileId,
|
video = media.fileId,
|
||||||
media.thumbnail ?.fileId,
|
thumbnail = media.thumbnail ?.fileId,
|
||||||
textSources,
|
entities = textSources,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
media.duration,
|
spoilered = spoilered,
|
||||||
media.width,
|
duration = media.duration,
|
||||||
media.height,
|
width = media.width,
|
||||||
null,
|
height = media.height,
|
||||||
messageThreadId,
|
supportStreaming = null,
|
||||||
businessConnectionId,
|
threadId = messageThreadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaVideo = asTelegramMedia()
|
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaVideo = asTelegramMedia()
|
||||||
|
|
||||||
override fun asTelegramMedia(): TelegramMediaVideo = media.toTelegramMediaVideo(textSources)
|
override fun asTelegramMedia(): TelegramMediaVideo = media.toTelegramMediaVideo(
|
||||||
|
textSources = textSources,
|
||||||
|
spoilered = spoilered,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package dev.inmo.tgbotapi.types.message.textsources
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||||
|
import dev.inmo.tgbotapi.utils.internal.*
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see expandableBlockquote
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class ExpandableBlockquoteTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor (
|
||||||
|
override val source: String,
|
||||||
|
override val subsources: TextSourcesList
|
||||||
|
) : MultilevelTextSource {
|
||||||
|
override val markdown: String by lazy { source.expandableBlockquoteMarkdown() }
|
||||||
|
override val markdownV2: String by lazy { expandableBlockquoteMarkdownV2() }
|
||||||
|
override val html: String by lazy { expandableBlockquoteHTML() }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun expandableBlockquote(parts: TextSourcesList) = ExpandableBlockquoteTextSource(parts.makeString(), parts)
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun expandableBlockquote(vararg parts: TextSource) = expandableBlockquote(parts.toList())
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun expandableBlockquote(text: String) = expandableBlockquote(regular(text))
|
||||||
@@ -22,14 +22,37 @@ sealed interface TextSource {
|
|||||||
get() = source
|
get() = source
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
operator fun TextSource.plus(other: TextSource) = when {
|
||||||
inline operator fun TextSource.plus(other: TextSource) = listOf(this, other)
|
this is RegularTextSource && other is RegularTextSource -> listOf(RegularTextSource(source + other.source))
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
else -> listOf(this, other)
|
||||||
inline operator fun TextSource.plus(other: List<TextSource>) = listOf(this) + other
|
}
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
operator fun TextSource.plus(text: String) = this + regular(text)
|
||||||
inline operator fun TextSource.plus(text: String) = listOf(this, regular(text))
|
operator fun List<TextSource>.plus(text: String): List<TextSource> {
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
val newList = mutableListOf<TextSource>()
|
||||||
inline operator fun List<TextSource>.plus(text: String) = this + regular(text)
|
|
||||||
|
for (i in 0 until size - 1) {
|
||||||
|
newList.add(get(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
val sublist = lastOrNull() ?.let {
|
||||||
|
it + text
|
||||||
|
} ?: listOf(regular(text))
|
||||||
|
|
||||||
|
newList.addAll(sublist)
|
||||||
|
|
||||||
|
return newList
|
||||||
|
}
|
||||||
|
operator fun TextSource.plus(other: List<TextSource>) = other.fold(listOf(this)) { acc, textSource ->
|
||||||
|
val newList = mutableListOf<TextSource>()
|
||||||
|
|
||||||
|
for (i in 0 until acc.size - 1) {
|
||||||
|
newList.add(acc.get(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
newList.addAll(acc.last() + textSource)
|
||||||
|
|
||||||
|
newList
|
||||||
|
}
|
||||||
|
|
||||||
@Serializable(TextSourceSerializer::class)
|
@Serializable(TextSourceSerializer::class)
|
||||||
sealed interface MultilevelTextSource : TextSource {
|
sealed interface MultilevelTextSource : TextSource {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package dev.inmo.tgbotapi.types.payments.abstracts
|
|||||||
|
|
||||||
typealias Currency = String
|
typealias Currency = String
|
||||||
|
|
||||||
|
val String.Companion.XTR
|
||||||
|
get() = "XTR"
|
||||||
|
|
||||||
interface Currencied {
|
interface Currencied {
|
||||||
val currency: Currency
|
val currency: Currency
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,6 +140,44 @@ inline fun EntitiesBuilder.blockquote(text: String) = add(dev.inmo.tgbotapi.type
|
|||||||
*/
|
*/
|
||||||
inline fun EntitiesBuilder.blockquoteln(text: String) = blockquote(text) + newLine
|
inline fun EntitiesBuilder.blockquoteln(text: String) = blockquote(text) + newLine
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add blockquote using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.blockquote]
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquote(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote(parts))
|
||||||
|
/**
|
||||||
|
* Version of [EntitiesBuilder.expandableBlockquote] with new line at the end
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquoteln(parts: TextSourcesList) = expandableBlockquote(parts) + newLine
|
||||||
|
/**
|
||||||
|
* Add expandableBlockquote using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote].
|
||||||
|
* Will reuse separator config from [buildEntities]
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquote(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote(
|
||||||
|
buildEntities(separator, init)
|
||||||
|
))
|
||||||
|
/**
|
||||||
|
* Version of [EntitiesBuilder.expandableBlockquote] with new line at the end.
|
||||||
|
* Will reuse separator config from [buildEntities]
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquoteln(noinline init: EntitiesBuilderBody) = expandableBlockquote(init) + newLine
|
||||||
|
/**
|
||||||
|
* Add expandableBlockquote using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote]
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquote(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote(*parts))
|
||||||
|
/**
|
||||||
|
* Version of [EntitiesBuilder.expandableBlockquote] with new line at the end
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquoteln(vararg parts: TextSource) = expandableBlockquote(*parts) + newLine
|
||||||
|
/**
|
||||||
|
* Add expandableBlockquote using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote]
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquote(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.expandableBlockquote(text))
|
||||||
|
/**
|
||||||
|
* Version of [EntitiesBuilder.expandableBlockquote] with new line at the end
|
||||||
|
*/
|
||||||
|
inline fun EntitiesBuilder.expandableBlockquoteln(text: String) = expandableBlockquote(text) + newLine
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler]
|
* Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -45,6 +45,17 @@ internal fun MultilevelTextSource.blockquoteMarkdownV2(): String = markdownV2Def
|
|||||||
internal fun MultilevelTextSource.blockquoteHTML(): String = htmlDefault(htmlBlockquoteControl)
|
internal fun MultilevelTextSource.blockquoteHTML(): String = htmlDefault(htmlBlockquoteControl)
|
||||||
|
|
||||||
|
|
||||||
|
internal fun MultilevelTextSource.expandableBlockquoteMarkdownV2(): String = markdownV2Default(
|
||||||
|
openControlSymbol = markdownV2ExpandableBlockquoteOpenControl,
|
||||||
|
closeControlSymbol = markdownV2ExpandableBlockquoteCloseControl,
|
||||||
|
eachLineSeparator = markdownBlockquoteControl
|
||||||
|
)
|
||||||
|
internal fun MultilevelTextSource.expandableBlockquoteHTML(): String = htmlDefault(
|
||||||
|
openControlSymbol = htmlBlockquoteOpenControl,
|
||||||
|
closeControlSymbol = htmlBlockquoteControl
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
internal fun MultilevelTextSource.cashTagMarkdownV2(): String = subsources.makeMarkdownV2String()
|
internal fun MultilevelTextSource.cashTagMarkdownV2(): String = subsources.makeMarkdownV2String()
|
||||||
internal fun MultilevelTextSource.cashTagHTML(): String = subsources.makeHtmlString()
|
internal fun MultilevelTextSource.cashTagHTML(): String = subsources.makeHtmlString()
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,12 @@ const val markdownV2StrikethroughControl = "~"
|
|||||||
const val markdownV2UnderlineControl = "__"
|
const val markdownV2UnderlineControl = "__"
|
||||||
const val markdownV2UnderlineEndControl = "$markdownV2UnderlineControl$markdownV2ItalicUnderlineDelimiter"
|
const val markdownV2UnderlineEndControl = "$markdownV2UnderlineControl$markdownV2ItalicUnderlineDelimiter"
|
||||||
const val markdownV2ItalicEndControl = "$markdownItalicControl$markdownV2ItalicUnderlineDelimiter"
|
const val markdownV2ItalicEndControl = "$markdownItalicControl$markdownV2ItalicUnderlineDelimiter"
|
||||||
|
const val markdownV2ExpandableBlockquoteOpenControl = "**"
|
||||||
|
const val markdownV2ExpandableBlockquoteCloseControl = "||"
|
||||||
|
|
||||||
const val htmlBoldControl = "b"
|
const val htmlBoldControl = "b"
|
||||||
const val htmlBlockquoteControl = "blockquote"
|
const val htmlBlockquoteControl = "blockquote"
|
||||||
|
const val htmlBlockquoteOpenControl = "blockquote expandable"
|
||||||
const val htmlItalicControl = "i"
|
const val htmlItalicControl = "i"
|
||||||
const val htmlSpoilerControl = "span class=\"tg-spoiler\""
|
const val htmlSpoilerControl = "span class=\"tg-spoiler\""
|
||||||
const val htmlSpoilerClosingControl = "span"
|
const val htmlSpoilerClosingControl = "span"
|
||||||
@@ -51,6 +54,8 @@ internal fun String.boldMarkdown(): String = markdownDefault(markdownBoldControl
|
|||||||
|
|
||||||
internal fun String.blockquoteMarkdown(): String = regularMarkdown()
|
internal fun String.blockquoteMarkdown(): String = regularMarkdown()
|
||||||
|
|
||||||
|
internal fun String.expandableBlockquoteMarkdown(): String = regularMarkdown()
|
||||||
|
|
||||||
internal fun String.italicMarkdown(): String = markdownDefault(markdownItalicControl)
|
internal fun String.italicMarkdown(): String = markdownDefault(markdownItalicControl)
|
||||||
|
|
||||||
internal fun String.spoilerMarkdown(): String = regularMarkdown()
|
internal fun String.spoilerMarkdown(): String = regularMarkdown()
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package dev.inmo.tgbotapi.types.MessageEntity
|
package dev.inmo.tgbotapi.types.MessageEntity
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||||
|
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.*
|
import dev.inmo.tgbotapi.types.message.textsources.*
|
||||||
|
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||||
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
const val testText = "It (is?) is simple hello world with #tag and @mention. Start of blockquote: Block quotation started\n" +
|
const val testText = "It (is?) is simple hello world with #tag and @mention. Start of blockquote: Block quotation started\n" +
|
||||||
|
"Block quotation continued\n" +
|
||||||
|
"The last line of the block quotation\n" +
|
||||||
|
". Start of expandable blockquote: Block quotation started\n" +
|
||||||
"Block quotation continued\n" +
|
"Block quotation continued\n" +
|
||||||
"The last line of the block quotation"
|
"The last line of the block quotation"
|
||||||
const val formattedV2Text = "It \\(is?\\) *_is_ ~__simple__~* ||hello world|| with \\#tag and @mention\\. Start of blockquote: >Block quotation started\n>Block quotation continued\n>The last line of the block quotation"
|
const val formattedV2Text = "It \\(is?\\) *_is_ ~__simple__~* ||hello world|| with \\#tag and @mention\\. Start of blockquote: >Block quotation started\n>Block quotation continued\n>The last line of the block quotation\n\\. Start of expandable blockquote: **>Block quotation started\n>Block quotation continued\n>The last line of the block quotation||"
|
||||||
const val formattedHtmlText = "It (is?) <b><i>is</i> <s><u>simple</u></s></b> <span class=\"tg-spoiler\">hello world</span> with #tag and @mention. Start of blockquote: <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>"
|
const val formattedHtmlText = "It (is?) <b><i>is</i> <s><u>simple</u></s></b> <span class=\"tg-spoiler\">hello world</span> with #tag and @mention. Start of blockquote: <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>\n. Start of expandable blockquote: <blockquote expandable>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>"
|
||||||
internal val testTextEntities = listOf(
|
internal val testTextEntities = listOf(
|
||||||
RawMessageEntity(
|
RawMessageEntity(
|
||||||
"bold",
|
"bold",
|
||||||
@@ -49,6 +56,11 @@ internal val testTextEntities = listOf(
|
|||||||
"blockquote",
|
"blockquote",
|
||||||
76,
|
76,
|
||||||
86
|
86
|
||||||
|
),
|
||||||
|
RawMessageEntity(
|
||||||
|
"expandable_blockquote",
|
||||||
|
120,
|
||||||
|
204
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -72,4 +84,6 @@ fun TextSourcesList.testTextSources() {
|
|||||||
|
|
||||||
val blockquoteSource = get(9) as BlockquoteTextSource
|
val blockquoteSource = get(9) as BlockquoteTextSource
|
||||||
assertTrue (blockquoteSource.subsources.first() is RegularTextSource)
|
assertTrue (blockquoteSource.subsources.first() is RegularTextSource)
|
||||||
|
|
||||||
|
assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ class StringFormattingTests {
|
|||||||
"Block quotation started\n" +
|
"Block quotation started\n" +
|
||||||
"Block quotation continued\n" +
|
"Block quotation continued\n" +
|
||||||
"The last line of the block quotation"
|
"The last line of the block quotation"
|
||||||
|
) +
|
||||||
|
"\n. Start of expandable blockquote: " +
|
||||||
|
expandableBlockquote(
|
||||||
|
"Block quotation started\n" +
|
||||||
|
"Block quotation continued\n" +
|
||||||
|
"The last line of the block quotation"
|
||||||
)
|
)
|
||||||
sources.testTextSources()
|
sources.testTextSources()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user