mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 09:07:12 +00:00
start adding of support business_connection_id in sending requests
This commit is contained in:
parent
953bdef657
commit
e4a3acdd68
@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.abstracts.types
|
||||
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
interface OptionallyBusinessConnectionRequest {
|
||||
val businessConnectionId: BusinessConnectionId?
|
||||
}
|
@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -28,6 +29,7 @@ fun CopyMessage(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -40,6 +42,7 @@ fun CopyMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -52,6 +55,7 @@ fun CopyMessage(
|
||||
messageId: MessageId,
|
||||
entities: List<TextSource>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -64,6 +68,7 @@ fun CopyMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -77,6 +82,7 @@ fun CopyMessage(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -89,6 +95,7 @@ fun CopyMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -101,6 +108,7 @@ fun CopyMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
entities: List<TextSource>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -113,6 +121,7 @@ fun CopyMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -135,6 +144,8 @@ data class CopyMessage internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -2,10 +2,12 @@ package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
||||
import dev.inmo.tgbotapi.abstracts.types.MessagesAction
|
||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
||||
import dev.inmo.tgbotapi.abstracts.types.ProtectContent
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
@ -20,6 +22,7 @@ fun CopyMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@ -43,6 +46,8 @@ data class CopyMessages (
|
||||
override val messageIds: List<MessageId>,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@ -53,6 +58,7 @@ data class CopyMessages (
|
||||
MessagesAction,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyBusinessConnectionRequest,
|
||||
DisableNotification {
|
||||
override val chatId: ChatIdentifier
|
||||
get() = fromChatId
|
||||
|
@ -1,9 +1,11 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendChatMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.actions.BotAction
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
@ -17,8 +19,10 @@ data class SendAction(
|
||||
@SerialName(actionField)
|
||||
val action: BotAction,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId
|
||||
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest {
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest, OptionallyBusinessConnectionRequest {
|
||||
override fun method(): String = "sendChatAction"
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -24,6 +25,8 @@ data class SendContact(
|
||||
val lastName: String? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@ -39,6 +42,7 @@ data class SendContact(
|
||||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -49,6 +53,7 @@ data class SendContact(
|
||||
contact.firstName,
|
||||
contact.lastName,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -65,6 +70,7 @@ data class SendContact(
|
||||
fun Contact.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -73,6 +79,7 @@ fun Contact.toRequest(
|
||||
chatId,
|
||||
this,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
|
@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
@ -21,7 +22,9 @@ data class SendDice(
|
||||
@SerialName(emojiField)
|
||||
val animationType: DiceAnimationType? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId?,
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -19,6 +20,7 @@ fun SendLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -32,6 +34,7 @@ fun SendLocation(
|
||||
null,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -43,11 +46,12 @@ fun SendStaticLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
fun SendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
@ -58,6 +62,7 @@ fun SendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -71,6 +76,7 @@ fun SendLiveLocation(
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -95,6 +101,8 @@ data class SendLocation internal constructor(
|
||||
override val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.abstracts.types.LinkPreviewOptionsContainer
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -26,6 +27,7 @@ fun SendTextMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -36,6 +38,7 @@ fun SendTextMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
linkPreviewOptions,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
@ -48,6 +51,7 @@ fun SendTextMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -58,6 +62,7 @@ fun SendTextMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
linkPreviewOptions,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
@ -77,6 +82,8 @@ data class SendTextMessage internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
|
@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -34,6 +35,8 @@ data class SendVenue(
|
||||
val googlePlaceType: GooglePlaceType? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@ -51,6 +54,7 @@ data class SendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -82,6 +86,7 @@ data class SendVenue(
|
||||
fun Venue.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -90,6 +95,7 @@ fun Venue.toRequest(
|
||||
chatId,
|
||||
this,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
|
@ -6,4 +6,5 @@ interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>,
|
||||
WithReplyParameters,
|
||||
DisableNotification,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyBusinessConnectionRequest
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send.games
|
||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -20,6 +21,8 @@ data class SendGame (
|
||||
val gameShortName: String,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -31,6 +32,7 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -51,6 +53,7 @@ fun SendAnimation(
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -77,6 +80,7 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -97,6 +101,7 @@ fun SendAnimation(
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -140,6 +145,8 @@ data class SendAnimationData internal constructor(
|
||||
override val height: Int? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -31,6 +32,7 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -50,6 +52,7 @@ fun SendAudio(
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -75,6 +78,7 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -94,6 +98,7 @@ fun SendAudio(
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -135,6 +140,8 @@ data class SendAudioData internal constructor(
|
||||
override val title: String? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -36,6 +37,7 @@ fun SendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -53,6 +55,7 @@ fun SendDocument(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -85,6 +88,7 @@ fun SendDocument(
|
||||
thumbnail: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -102,6 +106,7 @@ fun SendDocument(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -147,6 +152,8 @@ data class SendDocumentData internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.media.*
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||
@ -32,6 +33,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -56,6 +58,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId,
|
||||
media,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters
|
||||
@ -81,11 +84,12 @@ inline fun SendPlaylist(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<AudioContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<AudioContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
/**
|
||||
* Use this method to be sure that you are correctly sending documents media group
|
||||
@ -97,11 +101,12 @@ inline fun SendDocumentsGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
/**
|
||||
* Use this method to be sure that you are correctly sending visual media group
|
||||
@ -114,11 +119,12 @@ inline fun SendVisualMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> {
|
||||
private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>())
|
||||
@ -142,6 +148,8 @@ data class SendMediaGroupData internal constructor(
|
||||
val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -26,6 +27,7 @@ fun SendPhoto(
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -39,6 +41,7 @@ fun SendPhoto(
|
||||
null,
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -60,6 +63,7 @@ fun SendPhoto(
|
||||
entities: TextSourcesList,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -73,6 +77,7 @@ fun SendPhoto(
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -108,6 +113,8 @@ data class SendPhotoData internal constructor(
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -15,6 +16,7 @@ fun SendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@ -24,6 +26,7 @@ fun SendSticker(
|
||||
chatId,
|
||||
sticker,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -49,6 +52,8 @@ data class SendStickerByFileId internal constructor(
|
||||
val sticker: InputFile,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -32,6 +33,7 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -53,6 +55,7 @@ fun SendVideo(
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -80,6 +83,7 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -101,6 +105,7 @@ fun SendVideo(
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -146,6 +151,8 @@ data class SendVideoData internal constructor(
|
||||
val supportStreaming: Boolean? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -19,6 +20,7 @@ fun SendVideoNote(
|
||||
duration: Long? = null,
|
||||
size: Int? = null, // in documentation - length (size of video side)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -34,6 +36,7 @@ fun SendVideoNote(
|
||||
duration,
|
||||
size,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -67,6 +70,8 @@ data class SendVideoNoteData internal constructor(
|
||||
override val width: Int? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@ -27,6 +28,7 @@ fun SendVoice(
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -42,6 +44,7 @@ fun SendVoice(
|
||||
null,
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -63,6 +66,7 @@ fun SendVoice(
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
duration: Long? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@ -79,6 +83,7 @@ fun SendVoice(
|
||||
entities.toRawMessageEntities(),
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -114,6 +119,8 @@ data class SendVoiceData internal constructor(
|
||||
override val duration: Long? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
|
||||
import dev.inmo.tgbotapi.abstracts.types.*
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@ -60,6 +61,8 @@ data class SendInvoice(
|
||||
override val priceDependOnShipAddress: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.abstracts.TextedOutput
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
@ -51,6 +52,7 @@ fun SendPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -75,6 +77,7 @@ fun SendPoll(
|
||||
fun Poll.createRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -89,6 +92,7 @@ fun Poll.createRequest(
|
||||
allowMultipleAnswers,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -119,6 +123,7 @@ fun Poll.createRequest(
|
||||
false,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -133,6 +138,7 @@ fun Poll.createRequest(
|
||||
false,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -198,6 +204,8 @@ data class SendRegularPoll(
|
||||
override val closeDate: LongSeconds?,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@ -226,6 +234,7 @@ fun SendRegularPoll(
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -240,6 +249,7 @@ fun SendRegularPoll(
|
||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -257,6 +267,7 @@ fun SendQuizPoll(
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -273,6 +284,7 @@ fun SendQuizPoll(
|
||||
null,
|
||||
closeInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -289,6 +301,7 @@ fun SendQuizPoll(
|
||||
entities: List<TextSource>,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -305,6 +318,7 @@ fun SendQuizPoll(
|
||||
entities.toRawMessageEntities(),
|
||||
closeInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -323,6 +337,7 @@ internal fun SendQuizPoll(
|
||||
rawEntities: List<RawMessageEntity>? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@ -340,6 +355,7 @@ internal fun SendQuizPoll(
|
||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@ -372,6 +388,8 @@ data class SendQuizPoll internal constructor(
|
||||
override val closeDate: LongSeconds? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
@ -72,6 +72,9 @@ value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, B
|
||||
val ChatIdentifier.threadId: MessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.threadId
|
||||
|
||||
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
|
||||
get() = (this as? IdChatIdentifier) ?.businessConnectionId
|
||||
|
||||
fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is ChatId -> this
|
||||
is ChatIdWithThreadId -> ChatId(chatId)
|
||||
|
Loading…
Reference in New Issue
Block a user