1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

InputMessageContent filling

This commit is contained in:
InsanusMokrassar 2019-02-07 11:25:49 +08:00
parent 75c2f71d70
commit 0f9533e54a
55 changed files with 178 additions and 60 deletions

View File

@ -80,3 +80,13 @@ must be regular text
* Update `MediaGroupMessage` interface
* Add implementation of `MediaGroupMessage`
* Add generating of `MediaGroupMessage` in `RawMessage`
#### Inline mode changes
// It is temporal block of changes which will be replaced before complete merge
* Most part of abstractions was replaced from `requests` and `types` on more high level
* Added abstraction `CommonVenueData`
* Added abstraction `CommonContactData`
* Added `InputMessageContent`
* Update some types and requests according to abstractions replacing

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.abstracts
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode

View File

@ -0,0 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface CommonContactData {
val phoneNumber: String
val firstName: String
val lastName: String?
val vcard: String? // TODO:: Replace by some vCard abstraction
}

View File

@ -0,0 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface CommonVenueData {
val title: String
val address: String
val foursquareId: String?
val foursquareType: String? // TODO:: Rewrite with enum or interface
}

View File

@ -0,0 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface Livable {
/**
* Period in SECONDS
*/
val livePeriod: Int?
}

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.abstracts
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface Locationed {
val latitude: Double

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
interface DisableNotification {
val disableNotification: Boolean
}

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
interface DisableWebPagePreview {
val disableWebPagePreview: Boolean?

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.TelegramDate

View File

@ -1,5 +0,0 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
interface DisableNotification {
val disableNotification: Boolean
}

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
interface ChatMemberRequest<T: Any> : ChatRequest, SimpleRequest<T> {

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.RawChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableNotification
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
interface EditReplyMessage : ReplyMarkup {

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableWebPagePreview
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup
interface ReplyingMarkupSendMessageRequest<T: Any>: SendMessageRequest<T>, ReplyMarkup

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
interface SendChatMessageRequest<T: Any> : SimpleRequest<T>, ChatRequest

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableNotification
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMessageId
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMessageId
interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>, ReplyMessageId, DisableNotification

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.*
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate
interface BannedChatMember : ChatMember, UntilDate

View File

@ -58,6 +58,7 @@ const val foursquareIdField = "foursquare_id"
const val foursquareTypeField = "foursquare_type"
const val untilDateField = "until_date"
const val errorMessageField = "error_message"
const val messageTextField = "message_text"
const val photoUrlField = "photo_url"
const val photoSizeField = "photo_size"

View File

@ -1,19 +1,20 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData
import kotlinx.serialization.*
@Serializable
data class Contact(
@SerialName(phoneNumberField)
val phoneNumber: String,
override val phoneNumber: String,
@SerialName(firstNameField)
val firstName: String,
override val firstName: String,
@SerialName(lastNameField)
@Optional
val lastName: String? = null,
override val lastName: String? = null,
@SerialName(userIdField)
@Optional
val userId: UserId? = null,
@Optional
val vcard: String? = null
)
override val vcard: String? = null
) : CommonContactData

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
interface CaptionedInlineQueryResult : InlineQueryResult, Captioned

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
interface PositionedInlineQueryResult : InlineQueryResult, Locationed

View File

@ -0,0 +1,19 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import kotlinx.serialization.*
@Serializable
data class InputContactMessageContent(
@SerialName(phoneNumberField)
override val phoneNumber: String,
@SerialName(firstNameField)
override val firstName: String,
@SerialName(lastNameField)
@Optional
override val lastName: String? = null,
@Optional
override val vcard: String? = null
) : CommonContactData, InputMessageContent

View File

@ -0,0 +1,18 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Livable
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import kotlinx.serialization.*
@Serializable
data class InputLocationMessageContent(
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(livePeriodField)
@Optional
override val livePeriod: Int? = null
) : Locationed, Livable, InputMessageContent

View File

@ -0,0 +1,21 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.disableWebPagePreviewField
import com.github.insanusmokrassar.TelegramBotAPI.types.messageTextField
import kotlinx.serialization.*
@Serializable
data class InputTextMessageContent(
@SerialName(messageTextField)
override val caption: String,
@SerialName(parseModeField)
override val parseMode: ParseMode,
@SerialName(disableWebPagePreviewField)
@Optional
override val disableWebPagePreview: Boolean? = null
) : Captioned, DisableWebPagePreview, InputMessageContent

View File

@ -0,0 +1,24 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import kotlinx.serialization.*
@Serializable
data class InputVenueMessageContent(
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(titleField)
override val title: String,
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
@Optional
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
@Optional
override val foursquareType: String? = null
) : Locationed, CommonVenueData, InputMessageContent

View File

@ -1,4 +1,3 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts
interface InputMessageContent {
}
interface InputMessageContent

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

View File

@ -1,5 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData
import kotlinx.serialization.*
@Serializable
@ -7,13 +8,13 @@ data class Venue(
@SerialName(locationField)
val location: Location,
@SerialName(titleField)
val title: String,
override val title: String,
@SerialName(addressField)
val address: String,
override val address: String,
@SerialName(foursquareIdField)
@Optional
val foursquareId: String? = null,
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
@Optional
val foursquareType: String? = null // TODO:: Rewrite with enum or interface
)
override val foursquareType: String? = null
) : CommonVenueData