1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

Merge pull request #16 from InsanusMokrassar/0.10.0

0.10.0
This commit is contained in:
InsanusMokrassar 2019-02-11 13:40:32 +08:00 committed by GitHub
commit aded71016c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
137 changed files with 1335 additions and 162 deletions

View File

@ -1,5 +1,15 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 0.10.0
* 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
* Add all `InlineQueryResult`, `InputMessageContent` and other inline mode types
* Fixes in edition of inline messages and their result types
* Replace basic exception and add `ReplyMessageNotFound` exception
## 0.9.0 ## 0.9.0

View File

@ -1,4 +1,4 @@
project.version = "0.9.3" project.version = "0.10.0"
project.group = "com.github.insanusmokrassar" project.group = "com.github.insanusmokrassar"
buildscript { buildscript {

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 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 : Titled {
override 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 { interface Locationed {
val latitude: Double val latitude: Double

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface MimeTyped {
val mimeType: String? // TODO::replace by something like enum or interface
}

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface Performerable {
val performer: String?
}

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface Titled {
val title: String?
}

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 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 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 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 { interface DisableWebPagePreview {
val disableWebPagePreview: Boolean? 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 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 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 import com.github.insanusmokrassar.TelegramBotAPI.types.TelegramDate

View File

@ -3,7 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor
import com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor import com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.MultipartRequestCallFactory import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.MultipartRequestCallFactory
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.SimpleRequestCallFactory import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.SimpleRequestCallFactory
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestException import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.newRequestException
import com.github.insanusmokrassar.TelegramBotAPI.bot.settings.limiters.EmptyLimiter import com.github.insanusmokrassar.TelegramBotAPI.bot.settings.limiters.EmptyLimiter
import com.github.insanusmokrassar.TelegramBotAPI.bot.settings.limiters.RequestLimiter import com.github.insanusmokrassar.TelegramBotAPI.bot.settings.limiters.RequestLimiter
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
@ -75,7 +75,7 @@ class KtorRequestsExecutor(
null null
} }
} ?: call.let { } ?: call.let {
throw RequestException( throw newRequestException(
responseObject, responseObject,
"Can't get result object" "Can't get result object"
) )

View File

@ -1,13 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.bot package com.github.insanusmokrassar.TelegramBotAPI.bot
import com.github.insanusmokrassar.TelegramBotAPI.types.Response import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException
import java.io.IOException
class RequestException( @Deprecated(
val response: Response<*>, "Replaced to another package",
message: String? = null, ReplaceWith(
cause: Throwable? = null "RequestException",
) : IOException( "com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException"
message,
cause
) )
)
typealias RequestException = RequestException

View File

@ -1,5 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.bot package com.github.insanusmokrassar.TelegramBotAPI.bot
import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
interface RequestsExecutor { interface RequestsExecutor {

View File

@ -0,0 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions
import com.github.insanusmokrassar.TelegramBotAPI.types.Response
open class ReplyMessageNotFound(response: Response<*>, message: String?, cause: Throwable?) :
RequestException(response, message, cause)

View File

@ -0,0 +1,22 @@
package com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions
import com.github.insanusmokrassar.TelegramBotAPI.types.Response
import java.io.IOException
fun newRequestException(
response: Response<*>,
message: String? = null,
cause: Throwable? = null
) = when (response.description) {
"Bad Request: reply message not found" -> ReplyMessageNotFound(response, message, cause)
else -> RequestException(response, message, cause)
}
open class RequestException internal constructor(
val response: Response<*>,
message: String? = null,
cause: Throwable? = null
) : IOException(
message,
cause
)

View File

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

View File

@ -0,0 +1,58 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.answers
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.serializers.InlineQueryResultSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InlineQuery
import kotlinx.serialization.*
import kotlinx.serialization.internal.ArrayListSerializer
import kotlinx.serialization.internal.BooleanSerializer
@Serializable
data class AnswerInlineQuery(
@SerialName(inlineQueryIdField)
val inlineQueryID: InlineQueryIdentifier,
@Serializable(InlineQueryAnswersResultsSerializer::class)
@SerialName(resultsField)
val results: List<InlineQueryResult> = emptyList(),
@SerialName(cachedTimeField)
@Optional
val cachedTime: Int? = null,
@SerialName(isPersonalField)
@Optional
val isPersonal: Boolean? = null,
@SerialName(nextOffsetField)
@Optional
val nextOffset: String? = null,
@SerialName(switchPmTextField)
@Optional
val switchPmText: String? = null,
@SerialName(switchPmParameterField)
@Optional
val switchPmParameter: String? = null
): SimpleRequest<Boolean> {
override fun method(): String = "answerInlineQuery"
override fun resultSerializer(): KSerializer<Boolean> = BooleanSerializer
}
fun InlineQuery.createAnswer(
results: List<InlineQueryResult> = emptyList(),
cachedTime: Int? = null,
isPersonal: Boolean? = null,
nextOffset: String? = null,
switchPmText: String? = null,
switchPmParameter: String? = null
) = AnswerInlineQuery(
id,
results,
cachedTime,
isPersonal,
nextOffset,
switchPmText,
switchPmParameter
)
object InlineQueryAnswersResultsSerializer: KSerializer<List<InlineQueryResult>> by ArrayListSerializer(
InlineQueryResultSerializer
)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members 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.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members 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.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members 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.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*

View File

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

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest 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.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
@Serializable @Serializable
data class EditChatMessageLiveLocation( data class EditChatMessageLiveLocation(
@SerialName(chatIdField) @SerialName(chatIdField)

View File

@ -3,10 +3,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
@Serializable @Serializable
data class EditInlineMessageLiveLocation( data class EditInlineMessageLiveLocation(
@SerialName(inlineMessageIdField) @SerialName(inlineMessageIdField)
@ -20,5 +18,4 @@ data class EditInlineMessageLiveLocation(
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage, EditLocationMessage { ) : EditInlineMessage, EditReplyMessage, EditLocationMessage {
override fun method(): String = "editMessageLiveLocation" override fun method(): String = "editMessageLiveLocation"
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -7,7 +7,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
@Serializable @Serializable
data class StopChatMessageLiveLocation( data class StopChatMessageLiveLocation(
@SerialName(chatIdField) @SerialName(chatIdField)

View File

@ -4,10 +4,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditIn
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
@Serializable @Serializable
data class StopInlineMessageLiveLocation( data class StopInlineMessageLiveLocation(
@SerialName(inlineMessageIdField) @SerialName(inlineMessageIdField)
@ -17,5 +15,4 @@ data class StopInlineMessageLiveLocation(
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage { ) : EditInlineMessage, EditReplyMessage {
override fun method(): String = "stopMessageLiveLocation" override fun method(): String = "stopMessageLiveLocation"
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -4,7 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditIn
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
@ -15,7 +14,5 @@ data class EditInlineMessageReplyMarkup(
@Optional @Optional
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage { ) : EditInlineMessage, EditReplyMessage {
override fun method(): String = editMessageReplyMarkupMethod override fun method(): String = editMessageReplyMarkupMethod
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -2,8 +2,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.KSerializer
import kotlinx.serialization.internal.BooleanSerializer
interface EditInlineMessage : SimpleRequest<RawMessage> { interface EditInlineMessage : SimpleRequest<Boolean> {
val inlineMessageId: InlineMessageIdentifier val inlineMessageId: InlineMessageIdentifier
override fun resultSerializer(): KSerializer<Boolean> = BooleanSerializer
} }

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts 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 import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
interface EditReplyMessage : ReplyMarkup { interface EditReplyMessage : ReplyMarkup {

View File

@ -1,10 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
interface EditTextChatMessage : SimpleRequest<RawMessage> { interface EditTextChatMessage {
val text: String val text: String
val parseMode: ParseMode? val parseMode: ParseMode?
} }

View File

@ -5,7 +5,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
@ -21,7 +20,5 @@ data class EditInlineMessageCaption(
@Optional @Optional
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage { ) : EditInlineMessage, EditTextChatMessage, EditReplyMessage {
override fun method(): String = editMessageCaptionMethod override fun method(): String = editMessageCaptionMethod
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -1,12 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
@ -27,5 +25,4 @@ data class EditInlineMessageMedia(
} }
override fun method(): String = editMessageMediaMethod override fun method(): String = editMessageMediaMethod
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
@ -25,7 +24,5 @@ data class EditInlineMessageText(
@Optional @Optional
override val replyMarkup: InlineKeyboardMarkup? = null override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage { ) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage {
override fun method(): String = editMessageMediaMethod override fun method(): String = editMessageMediaMethod
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
} }

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games 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.requests.games.abstracts.GetGameHighScores
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games 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.requests.games.abstracts.GetGameHighScores
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games 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.requests.games.abstracts.SetGameScore
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.games 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.requests.games.abstracts.SetGameScore
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.* import kotlinx.serialization.*

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send 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.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts 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 interface ReplyingMarkupSendMessageRequest<T: Any>: SendMessageRequest<T>, ReplyMarkup

View File

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

View File

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

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.games 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.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup

View File

@ -1,5 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.* import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
@ -74,7 +75,7 @@ data class SendAudioData internal constructor(
override val duration: Long? = null, override val duration: Long? = null,
@SerialName(performerField) @SerialName(performerField)
@Optional @Optional
val performer: String? = null, override val performer: String? = null,
@SerialName(titleField) @SerialName(titleField)
@Optional @Optional
override val title: String? = null, override val title: String? = null,
@ -93,7 +94,8 @@ data class SendAudioData internal constructor(
TextableSendMessageRequest<RawMessage>, TextableSendMessageRequest<RawMessage>,
ThumbedSendMessageRequest<RawMessage>, ThumbedSendMessageRequest<RawMessage>,
TitledSendMessageRequest<RawMessage>, TitledSendMessageRequest<RawMessage>,
DuratedSendMessageRequest<RawMessage> DuratedSendMessageRequest<RawMessage>,
Performerable
{ {
init { init {
text ?.let { text ?.let {

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments 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.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember 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 interface BannedChatMember : ChatMember, UntilDate

View File

@ -28,6 +28,10 @@ val invoiceTitleLimit = 1 until 32
val invoiceDescriptionLimit = 1 until 256 val invoiceDescriptionLimit = 1 until 256
val invoicePayloadBytesLimit = 1 until 128 val invoicePayloadBytesLimit = 1 until 128
val livePeriodLimit = 60 .. 86400
val inlineQueryAnswerResultsLimit = 0 .. 50
const val chatIdField = "chat_id" const val chatIdField = "chat_id"
const val messageIdField = "message_id" const val messageIdField = "message_id"
const val updateIdField = "update_id" const val updateIdField = "update_id"
@ -52,29 +56,66 @@ const val resultIdField = "result_id"
const val inlineMessageIdField = "inline_message_id" const val inlineMessageIdField = "inline_message_id"
const val callbackDataField = "callback_data" const val callbackDataField = "callback_data"
const val callbackQueryIdField = "callback_query_id" const val callbackQueryIdField = "callback_query_id"
const val inlineQueryIdField = "inline_query_id"
const val showAlertField = "show_alert" const val showAlertField = "show_alert"
const val cachedTimeField = "cached_time" const val cachedTimeField = "cached_time"
const val foursquareIdField = "foursquare_id" const val foursquareIdField = "foursquare_id"
const val foursquareTypeField = "foursquare_type" const val foursquareTypeField = "foursquare_type"
const val untilDateField = "until_date" const val untilDateField = "until_date"
const val errorMessageField = "error_message" const val errorMessageField = "error_message"
const val messageTextField = "message_text"
const val isPersonalField = "is_personal"
const val nextOffsetField = "next_offset"
const val switchPmTextField = "switch_pm_text"
const val switchPmParameterField = "switch_pm_parameter"
const val photoUrlField = "photo_url" const val photoUrlField = "photo_url"
const val photoSizeField = "photo_size" const val photoSizeField = "photo_size"
const val photoFileIdField = "photo_file_id" const val photoFileIdField = "photo_file_id"
const val gifUrlField = "gif_url"
const val gifFileIdField = "gif_file_id"
const val thumbUrlField = "thumb_url"
const val thumbWidthField = "thumb_width"
const val thumbHeightField = "thumb_height"
const val photoWidthField = "photo_width" const val photoWidthField = "photo_width"
const val photoHeightField = "photo_height" const val photoHeightField = "photo_height"
const val gifUrlField = "gif_url"
const val gifFileIdField = "gif_file_id"
const val gifWidthField = "gif_width" const val gifWidthField = "gif_width"
const val gifHeightField = "gif_height" const val gifHeightField = "gif_height"
const val gifDurationField = "gif_duration" const val gifDurationField = "gif_duration"
const val mpeg4GifUrlField = "mpeg4_url"
const val mpeg4GifFileIdField = "mpeg4_file_id"
const val mpeg4GifWidthField = "mpeg4_width"
const val mpeg4GifHeightField = "mpeg4_height"
const val mpeg4GifDurationField = "mpeg4_duration"
const val videoUrlField = "video_url"
const val videoFileIdField = "video_file_id"
const val videoWidthField = "video_width"
const val videoHeightField = "video_height"
const val videoDurationField = "video_duration"
const val audioUrlField = "audio_url"
const val audioFileIdField = "audio_file_id"
const val audioDurationField = "audio_duration"
const val voiceUrlField = "voice_url"
const val voiceFileIdField = "voice_file_id"
const val voiceDurationField = "voice_duration"
const val documentUrlField = "document_url"
const val documentFileIdField = "document_file_id"
const val stickerFileIdField = "sticker_file_id"
const val gameShortNameField = "game_short_name"
const val thumbUrlField = "thumb_url"
const val thumbWidthField = "thumb_width"
const val thumbHeightField = "thumb_height"
const val inputMessageContentField = "input_message_content" const val inputMessageContentField = "input_message_content"
const val hideUrlField = "hide_url" const val hideUrlField = "hide_url"
const val gameShortNameField = "game_short_name"
const val canSendMessagesField = "can_send_messages" const val canSendMessagesField = "can_send_messages"
const val canSendMediaMessagesField = "can_send_media_messages" const val canSendMediaMessagesField = "can_send_media_messages"
@ -129,6 +170,8 @@ const val labelField = "label"
const val amountField = "amount" const val amountField = "amount"
const val pricesField = "prices" const val pricesField = "prices"
const val payloadField = "payload" const val payloadField = "payload"
const val vcardField = "vcard"
const val resultsField = "results"
const val pointField = "point" const val pointField = "point"
const val xShiftField = "x_shift" const val xShiftField = "x_shift"

View File

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

View File

@ -18,7 +18,7 @@ class InlineQueryResultArticle(
override val replyMarkup: InlineKeyboardMarkup? = null, override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(urlField) @SerialName(urlField)
@Optional @Optional
val url: String? = null, override val url: String? = null,
@SerialName(hideUrlField) @SerialName(hideUrlField)
@Optional @Optional
val hideUrl: Boolean? = null, val hideUrl: Boolean? = null,
@ -38,6 +38,7 @@ class InlineQueryResultArticle(
ThumbSizedInlineQueryResult, ThumbSizedInlineQueryResult,
TitledInlineQueryResult, TitledInlineQueryResult,
DescribedInlineQueryResult, DescribedInlineQueryResult,
WithInputMessageContentInlineQueryResult { WithInputMessageContentInlineQueryResult,
UrlInlineQueryResult {
override val type: String = "article" override val type: String = "article"
} }

View File

@ -0,0 +1,33 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.inlineQueryResultAudioType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultAudioCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(audioFileIdField)
override val fileId: FileId,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultAudioCached {
override val type: String = inlineQueryResultAudioType
}

View File

@ -0,0 +1,40 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.inlineQueryResultAudioType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultAudioImpl(
@SerialName(idField)
override val id: String,
@SerialName(audioUrlField)
override val url: String,
@SerialName(titleField)
override val title: String,
@SerialName(performerField)
@Optional
override val performer: String? = null,
@SerialName(audioDurationField)
@Optional
override val duration: Int? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultAudio {
override val type: String = inlineQueryResultAudioType
}

View File

@ -0,0 +1,46 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultContact(
@SerialName(idField)
override val id: String,
@SerialName(phoneNumberField)
override val phoneNumber: String,
@SerialName(firstNameField)
override val firstName: String,
@SerialName(lastNameField)
@Optional
override val lastName: String? = null,
@SerialName(vcardField)
@Optional
override val vcard: String? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
CommonContactData,
WithInputMessageContentInlineQueryResult,
ThumbedInlineQueryResult,
ThumbSizedInlineQueryResult
{
override val type: String = "contact"
}

View File

@ -0,0 +1,38 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.inlineQueryResultDocumentType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultDocumentCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(documentFileIdField)
override val fileId: FileId,
@SerialName(titleField)
override val title: String,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultDocumentCached {
override val type: String = inlineQueryResultDocumentType
}

View File

@ -0,0 +1,49 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.inlineQueryResultDocumentType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultDocumentImpl(
@SerialName(idField)
override val id: String,
@SerialName(documentUrlField)
override val url: String,
@SerialName(titleField)
override val title: String,
@SerialName(mimeTypeField)
override val mimeType: String,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultDocument {
override val type: String = inlineQueryResultDocumentType
}

View File

@ -0,0 +1,36 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.inlineQueryResultGifType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultGifCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(gifFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultGifCached {
override val type: String = inlineQueryResultGifType
}

View File

@ -0,0 +1,46 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.inlineQueryResultGifType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultGifImpl(
@SerialName(idField)
override val id: String,
@SerialName(gifUrlField)
override val url: String,
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(gifWidthField)
@Optional
override val width: Int? = null,
@SerialName(gifHeightField)
@Optional
override val height: Int? = null,
@SerialName(gifDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultGif {
override val type: String = inlineQueryResultGifType
}

View File

@ -0,0 +1,48 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Livable
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultLocation(
@SerialName(idField)
override val id: String,
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(titleField)
override val title: String,
@SerialName(livePeriodField)
@Optional
override val livePeriod: Int? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
Locationed,
Livable,
TitledInlineQueryResult,
WithInputMessageContentInlineQueryResult,
ThumbedInlineQueryResult,
ThumbSizedInlineQueryResult
{
override val type: String = "location"
}

View File

@ -0,0 +1,36 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.inlineQueryResultMpeg4GifType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultMpeg4GifCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(mpeg4GifFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultMpeg4GifCached {
override val type: String = inlineQueryResultMpeg4GifType
}

View File

@ -0,0 +1,46 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.inlineQueryResultMpeg4GifType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultMpeg4GifImpl(
@SerialName(idField)
override val id: String,
@SerialName(mpeg4GifUrlField)
override val url: String,
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(mpeg4GifWidthField)
@Optional
override val width: Int? = null,
@SerialName(mpeg4GifHeightField)
@Optional
override val height: Int? = null,
@SerialName(mpeg4GifDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultMpeg4Gif {
override val type: String = inlineQueryResultMpeg4GifType
}

View File

@ -0,0 +1,39 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo.inlineQueryResultPhotoType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultPhotoCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(photoFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultPhotoCached {
override val type: String = inlineQueryResultPhotoType
}

View File

@ -0,0 +1,46 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo.inlineQueryResultPhotoType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultPhotoImpl(
@SerialName(idField)
override val id: String,
@SerialName(photoUrlField)
override val url: String,
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(photoWidthField)
@Optional
override val width: Int? = null,
@SerialName(photoHeightField)
@Optional
override val height: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultPhoto {
override val type: String = inlineQueryResultPhotoType
}

View File

@ -0,0 +1,24 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultStickerCached(
@SerialName(idField)
override val id: String,
@SerialName(stickerFileIdField)
override val fileId: FileId,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult, WithInputMessageContentInlineQueryResult, WithFileIdInlineQueryResult {
override val type: String = "sticker"
}

View File

@ -0,0 +1,53 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultVenue(
@SerialName(idField)
override val id: String,
@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,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
Locationed,
CommonVenueData,
TitledInlineQueryResult,
WithInputMessageContentInlineQueryResult,
ThumbedInlineQueryResult,
ThumbSizedInlineQueryResult
{
override val type: String = "venue"
}

View File

@ -0,0 +1,38 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.inlineQueryResultVideoType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultVideoCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(videoFileIdField)
override val fileId: FileId,
@SerialName(titleField)
override val title: String,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVideoCached {
override val type: String = inlineQueryResultVideoType
}

View File

@ -0,0 +1,51 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.inlineQueryResultVideoType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultVideoImpl(
@SerialName(idField)
override val id: String,
@SerialName(videoUrlField)
override val url: String,
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(mimeTypeField)
override val mimeType: String,
@SerialName(titleField)
override val title: String,
@SerialName(videoWidthField)
@Optional
override val width: Int? = null,
@SerialName(videoHeightField)
@Optional
override val height: Int? = null,
@SerialName(videoDurationField)
@Optional
override val duration: Int? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVideo {
override val type: String = inlineQueryResultVideoType
}

View File

@ -0,0 +1,35 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.inlineQueryResultVoiceType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultVoiceCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(voiceFileIdField)
override val fileId: FileId,
@SerialName(titleField)
override val title: String,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoiceCached {
override val type: String = inlineQueryResultVoiceType
}

View File

@ -0,0 +1,37 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.inlineQueryResultVoiceType
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
@Serializable
data class InlineQueryResultVoiceImpl(
@SerialName(idField)
override val id: String,
@SerialName(voiceUrlField)
override val url: String,
@SerialName(titleField)
override val title: String,
@SerialName(voiceDurationField)
@Optional
override val duration: Int? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoice {
override val type: String = inlineQueryResultVoiceType
}

View File

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

View File

@ -1,7 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.serializers.InlineQueryResultSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.Serializable
@Serializable(InlineQueryResultSerializer::class)
interface InlineQueryResult { interface InlineQueryResult {
val type: String val type: String
val id: String val id: String

View File

@ -1,7 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
interface OptionallyTitledInlineQueryResult : InlineQueryResult { import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Titled
val title: String?
interface OptionallyTitledInlineQueryResult : InlineQueryResult, Titled
}

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts 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 interface PositionedInlineQueryResult : InlineQueryResult, Locationed

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
interface UrlInlineQueryResult : InlineQueryResult { interface UrlInlineQueryResult : InlineQueryResult {
val url: String val url: String?
} }

View File

@ -3,5 +3,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
interface WithInputMessageContentInlineQueryResult : InlineQueryResult { interface WithInputMessageContentInlineQueryResult : InlineQueryResult {
val inputMessageContent: InputMessageContent val inputMessageContent: InputMessageContent?
} }

View File

@ -0,0 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultAudio : InlineQueryResultAudioCommon, UrlInlineQueryResult, DuratedInlineResultQuery, Performerable, TitledInlineQueryResult

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult
interface InlineQueryResultAudioCached : InlineQueryResultAudioCommon, WithFileIdInlineQueryResult

View File

@ -0,0 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult
const val inlineQueryResultAudioType = "audio"
interface InlineQueryResultAudioCommon : InlineQueryResult,
Captioned,
WithInputMessageContentInlineQueryResult

View File

@ -0,0 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultDocument : InlineQueryResultDocumentCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, ThumbSizedInlineQueryResult, MimeTyped

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult
interface InlineQueryResultDocumentCached : InlineQueryResultDocumentCommon, WithFileIdInlineQueryResult

View File

@ -0,0 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
const val inlineQueryResultDocumentType = "document"
interface InlineQueryResultDocumentCommon : InlineQueryResult,
TitledInlineQueryResult,
DescribedInlineQueryResult,
Captioned,
WithInputMessageContentInlineQueryResult

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultGif : InlineQueryResultGifCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, SizedInlineQueryResult, DuratedInlineResultQuery

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult
interface InlineQueryResultGifCached : InlineQueryResultGifCommon, WithFileIdInlineQueryResult

Some files were not shown because too many files have changed in this diff Show More