1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 15:19:30 +00:00

potentially cover new update of Bot API

This commit is contained in:
2025-02-14 21:01:47 +06:00
parent 7d3e9325f1
commit d4490dec75
21 changed files with 199 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.ForwardMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
@@ -15,10 +16,11 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = execute(
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
ForwardMessage(fromChatId, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
)
public suspend fun TelegramBot.forwardMessage(
@@ -26,40 +28,45 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, startTimestamp, disableNotification, protectContent)
public suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
public suspend fun TelegramBot.forwardMessage(
fromChat: Chat,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, startTimestamp, disableNotification, protectContent)
public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
message: AccessibleMessage,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, startTimestamp, disableNotification, protectContent)
public suspend fun TelegramBot.forwardMessage(
toChat: Chat,
message: AccessibleMessage,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, startTimestamp, disableNotification, protectContent)

View File

@@ -21,6 +21,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -35,6 +36,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -55,6 +57,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -68,6 +71,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -87,6 +91,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -100,6 +105,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -119,6 +125,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -132,6 +139,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -151,6 +159,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -164,6 +173,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -183,6 +193,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -195,6 +206,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -213,6 +225,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -225,6 +238,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -243,6 +257,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -255,6 +270,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -273,6 +289,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -286,6 +303,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -304,6 +322,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -317,6 +336,7 @@ public suspend inline fun TelegramBot.copyMessage(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -334,6 +354,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChatId.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -346,6 +367,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -363,6 +385,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
threadId: MessageThreadId? = toChat.id.threadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -375,6 +398,7 @@ public suspend inline fun TelegramBot.copyMessage(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
threadId = threadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -25,6 +25,8 @@ public suspend fun TelegramBot.sendVideo(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
@@ -45,6 +47,8 @@ public suspend fun TelegramBot.sendVideo(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = cover,
startTimestamp = startTimestamp,
duration = duration,
width = width,
height = height,
@@ -87,6 +91,8 @@ public suspend fun TelegramBot.sendVideo(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = video.cover ?.fileId,
startTimestamp = video.startTimestamp,
duration = video.duration,
width = video.width,
height = video.height,
@@ -112,6 +118,8 @@ public suspend fun TelegramBot.sendVideo(
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
@@ -131,6 +139,8 @@ public suspend fun TelegramBot.sendVideo(
parseMode = parseMode,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = cover,
startTimestamp = startTimestamp,
duration = duration,
width = width,
height = height,
@@ -192,6 +202,8 @@ public suspend inline fun TelegramBot.sendVideo(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
@@ -211,6 +223,8 @@ public suspend inline fun TelegramBot.sendVideo(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = cover,
startTimestamp = startTimestamp,
duration = duration,
width = width,
height = height,
@@ -251,6 +265,8 @@ public suspend inline fun TelegramBot.sendVideo(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = video.cover ?.fileId,
startTimestamp = video.startTimestamp,
duration = video.duration,
width = video.width,
height = video.height,
@@ -275,6 +291,8 @@ public suspend inline fun TelegramBot.sendVideo(
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
@@ -293,6 +311,8 @@ public suspend inline fun TelegramBot.sendVideo(
entities = entities,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
cover = cover,
startTimestamp = startTimestamp,
duration = duration,
width = width,
height = height,