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

Merge pull request #7 from InsanusMokrassar/0.8.4

0.8.4
This commit is contained in:
InsanusMokrassar 2019-01-21 16:16:10 +08:00 committed by GitHub
commit c6e7111ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
121 changed files with 693 additions and 245 deletions

View File

@ -15,3 +15,24 @@
## 0.8.3
* Now `ForwardedMessage` contains nullable `from`
## 0.8.4
* Added `createMarkdownText` and extensions for `CaptionedMediaContent` and `TextContent`
* Added `ResendableContent` and realize in different contents
* Animation
* Audio
* Document
* Photo
* Sticker
* Video
* VideoNote
* Voice
* `MessageContent` now is `ResendableContent`
* Now all media sending factories which contains `thumb` have default `null` value
* `ChatIdentifier` classes now are `data` classes
* Now `MediaGroupContent` interface contains `toMediaGroupMemberInputMedia` method for easily creating mirror input media
* Change signature of `Update`
* Now `Update` is untyped and data is `Any`
* Media groups now are separated type of updates and you can subscribe on that receiving directly
* Now `AdministratorChatMember` is interface and `CreatorChatMember` implement it

View File

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

View File

@ -1,14 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.bot.ProxySettings
import com.github.insanusmokrassar.TelegramBotAPI.bot.useWith
import com.github.insanusmokrassar.TelegramBotAPI.types.message.CommonMessageImpl
import com.github.insanusmokrassar.TelegramBotAPI.requests.get.GetUserProfilePhotos
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.toInputMediaPhoto
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendMediaGroup
import com.github.insanusmokrassar.TelegramBotAPI.types.files.biggest
import com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.*
import io.ktor.client.engine.okhttp.OkHttp
import kotlinx.coroutines.runBlocking

View File

@ -4,8 +4,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.MultipartRequestCallFactory
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base.SimpleRequestCallFactory
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestException
import com.github.insanusmokrassar.TelegramBotAPI.types.ResponseParameters
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.types.ResponseParameters
import io.ktor.client.HttpClient
import io.ktor.client.call.HttpClientCall
import io.ktor.client.engine.HttpClientEngine

View File

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

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests
import com.github.insanusmokrassar.TelegramBotAPI.types.User
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.User
import kotlinx.serialization.KSerializer
class GetMe : SimpleRequest<User> {

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate
import kotlinx.serialization.*
import kotlinx.serialization.internal.ArrayListSerializer

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.ResponseParameters
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls
import kotlinx.serialization.*
import kotlinx.serialization.json.JsonObject

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
interface ChatRequest {
val chatId: ChatIdentifier

View File

@ -1,8 +1,8 @@
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.CallbackQuery.CallbackQuery
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.StringSerializer
@Serializable
data class LeaveChat(

View File

@ -2,7 +2,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.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
interface ChatMemberRequest<T: Any> : ChatRequest, SimpleRequest<T> {
val userId: UserId

View File

@ -6,8 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.StringSerializer
@Serializable
data class GetChat(

View File

@ -4,10 +4,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.RawChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.*
import kotlinx.serialization.internal.ArrayListSerializer
@Serializable
data class GetChatAdministrators(

View File

@ -5,7 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatR
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.*
import kotlinx.serialization.internal.IntSerializer
@Serializable
data class GetChatMembersCount(

View File

@ -1,11 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.RawChatMember
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
@Serializable
data class GetChatMember(

View File

@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.StringSerializer
@Serializable
data class DeleteChatPhoto(

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.StringSerializer
@Serializable
data class UnpinChatMessage(

View File

@ -2,7 +2,8 @@ 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.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)

View File

@ -1,9 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditChatMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)

View File

@ -1,9 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditInlineMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)

View File

@ -1,10 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditChatMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditChatMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import kotlinx.serialization.*
const val editMessageReplyMarkupMethod = "editMessageReplyMarkup"

View File

@ -1,10 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditInlineMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.*
@Serializable

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
interface EditChatMessage : SimpleRequest<RawMessage> {
val chatId: ChatIdentifier

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
interface EditInlineMessage : SimpleRequest<RawMessage> {
val inlineMessageId: InlineMessageIdentifier

View File

@ -1,8 +1,8 @@
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.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
interface EditTextChatMessage : SimpleRequest<RawMessage> {
val text: String

View File

@ -1,11 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
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.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
const val editMessageCaptionMethod = "editMessageCaption"

View File

@ -1,11 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
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.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,13 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
import kotlinx.serialization.*
import java.lang.IllegalArgumentException
const val editMessageMediaMethod = "editMessageMedia"

View File

@ -1,14 +1,13 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
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.InputMedia.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.*
import java.lang.IllegalArgumentException
@Serializable
data class EditInlineMessageMedia(

View File

@ -1,12 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
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.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
import kotlinx.serialization.*
const val editMessageTextMethod = "editMessageText"
@ -30,6 +29,6 @@ data class EditChatMessageText(
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage {
override fun method(): String = editMessageMediaMethod
override fun method(): String = editMessageTextMethod
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
}

View File

@ -1,12 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
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.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
import kotlinx.serialization.*
@Serializable

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.get
import com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFile
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.fileIdField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFile
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.fileIdField
import kotlinx.serialization.*
@Serializable

View File

@ -3,9 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.get
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.stickerSetNameField
import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.StickerSet
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.*
@Serializable
data class GetStickerSet(

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.get
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendChatMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.actions.BotAction
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendChatMessageRequest
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -1,9 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import kotlinx.serialization.*
@Serializable
@ -45,7 +46,7 @@ data class SendContact(
replyMarkup
)
override fun method(): String = "sendVenue"
override fun method(): String = "sendContact"
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
}

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import kotlinx.serialization.*
// TODO:: Add location tracker for tracking location

View File

@ -1,12 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableWebPagePreview
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableWebPagePreview
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -4,5 +4,5 @@ interface DuratedSendMessageRequest<T: Any>: SendMessageRequest<T> {
/**
* Duration of media, usually in seconds
*/
val duration: Int?
val duration: Long?
}

View File

@ -1,15 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.games
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.*
@Serializable
data class SendGame (

View File

@ -1,23 +1,23 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendAnimation(
chatId: ChatIdentifier,
animation: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
duration: Int? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
disableNotification: Boolean = false,
@ -71,7 +71,7 @@ data class SendAnimationData internal constructor(
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@SerialName(widthField)
@Optional
override val width: Int? = null,

View File

@ -1,23 +1,23 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendAudio(
chatId: ChatIdentifier,
audio: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
duration: Int? = null,
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
@ -71,7 +71,7 @@ data class SendAudioData internal constructor(
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@SerialName(performerField)
@Optional
val performer: String? = null,

View File

@ -1,20 +1,20 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendDocument(
chatId: ChatIdentifier,
document: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,

View File

@ -1,13 +1,13 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.ThumbedInputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.ThumbedInputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls
import kotlinx.serialization.*
import kotlinx.serialization.internal.ArrayListSerializer

View File

@ -1,13 +1,13 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import kotlinx.serialization.*
fun SendPhoto(

View File

@ -1,23 +1,23 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendVideo(
chatId: ChatIdentifier,
video: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
duration: Int? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
supportStreaming: Boolean? = null,
@ -73,7 +73,7 @@ data class SendVideoData internal constructor(
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@SerialName(widthField)
@Optional
override val width: Int? = null,

View File

@ -1,23 +1,23 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendVideoNote(
chatId: ChatIdentifier,
videoNote: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
duration: Int? = null,
duration: Long? = null,
size: Int? = null, // in documentation - length (size of video side)
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
@ -69,7 +69,7 @@ data class SendVideoNoteData internal constructor(
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@SerialName(lengthField)
@Optional
override val width: Int? = null,

View File

@ -1,23 +1,23 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapOfNotNull
import kotlinx.serialization.*
fun SendVoice(
chatId: ChatIdentifier,
voice: InputFile,
thumb: InputFile?,
thumb: InputFile? = null,
caption: String? = null,
parseMode: ParseMode? = null,
duration: Int? = null,
duration: Long? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
@ -67,7 +67,7 @@ data class SendVoiceData internal constructor(
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,

View File

@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.stickers
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.stickerField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -2,7 +2,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.stickers
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.positionField
import com.github.insanusmokrassar.TelegramBotAPI.types.stickerField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer

View File

@ -9,7 +9,7 @@ sealed class ChatIdentifier
* Also used as User Identifier
*/
@Serializable(ChatIdentifierSerializer::class)
class ChatId(
data class ChatId(
val chatId: Identifier
) : ChatIdentifier()
@ -18,7 +18,7 @@ typealias UserId = ChatId
fun Identifier.toChatId(): ChatId = ChatId(this)
@Serializable(ChatIdentifierSerializer::class)
class Username(
data class Username(
val username: String
) : ChatIdentifier() {
init {

View File

@ -1,16 +1,13 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.User
data class AdministratorChatMember(
override val user: User,
val canBeEdited: Boolean,
val canChangeInfo: Boolean,
val canPostMessages: Boolean,
val canEditMessages: Boolean,
val canRemoveMessages: Boolean,
val canInviteUsers: Boolean,
val canRestrictMembers: Boolean,
val canPinMessages: Boolean,
interface AdministratorChatMember : ChatMember {
val canBeEdited: Boolean
val canChangeInfo: Boolean
val canPostMessages: Boolean
val canEditMessages: Boolean
val canRemoveMessages: Boolean
val canInviteUsers: Boolean
val canRestrictMembers: Boolean
val canPinMessages: Boolean
val canPromoteMembers: Boolean
) : ChatMember
}

View File

@ -0,0 +1,16 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.User
data class AdministratorChatMemberImpl(
override val user: User,
override val canBeEdited: Boolean,
override val canChangeInfo: Boolean,
override val canPostMessages: Boolean,
override val canEditMessages: Boolean,
override val canRemoveMessages: Boolean,
override val canInviteUsers: Boolean,
override val canRestrictMembers: Boolean,
override val canPinMessages: Boolean,
override val canPromoteMembers: Boolean
) : AdministratorChatMember

View File

@ -2,4 +2,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.User
data class CreatorChatMember(override val user: User) : ChatMember
data class CreatorChatMember(override val user: User) : AdministratorChatMember {
override val canBeEdited: Boolean = true
override val canChangeInfo: Boolean = true
override val canPostMessages: Boolean = true
override val canEditMessages: Boolean = true
override val canRemoveMessages: Boolean = true
override val canInviteUsers: Boolean = true
override val canRestrictMembers: Boolean = true
override val canPinMessages: Boolean = true
override val canPromoteMembers: Boolean = true
}

View File

@ -2,7 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.TelegramDate
import com.github.insanusmokrassar.TelegramBotAPI.types.User
import org.joda.time.DateTime
data class KickedChatMember(
override val user: User,

View File

@ -53,7 +53,7 @@ data class RawChatMember(
val asChatMember: ChatMember by lazy {
when (status) {
"creator" -> CreatorChatMember(user)
"administrator" -> AdministratorChatMember(
"administrator" -> AdministratorChatMemberImpl(
user,
canBeEdited,
canChangeInfo,

View File

@ -2,7 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.TelegramDate
import com.github.insanusmokrassar.TelegramBotAPI.types.User
import org.joda.time.DateTime
data class RestrictedChatMember(
override val user: User,

View File

@ -4,10 +4,7 @@ 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.Optional
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import kotlinx.serialization.*
@Serializable
class InlineQueryResultArticle(

View File

@ -1,10 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.idField
import com.github.insanusmokrassar.TelegramBotAPI.types.replyMarkupField
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
interface InlineQueryResult {
val type: String

View File

@ -1,5 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
interface DuratedInputMedia : InputMedia {
val duration: Int?
val duration: Long?
}

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import kotlinx.serialization.*
@Serializable
@ -20,7 +20,7 @@ data class InputMediaAnimation(
@Optional
override val height: Int? = null,
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@Transient
override val thumb: InputFile? = null
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia {

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import kotlinx.serialization.*
@Serializable
@ -16,7 +16,7 @@ data class InputMediaAudio(
@Optional
override val parseMode: ParseMode? = null,
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@Optional
val performer: String? = null,
@Optional

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,10 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,9 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
import kotlinx.serialization.*
@Serializable
@ -20,7 +20,7 @@ data class InputMediaVideo(
@Optional
override val height: Int? = null,
@Optional
override val duration: Int? = null,
override val duration: Long? = null,
@Transient
override val thumb: InputFile? = null
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia, MediaGroupMemberInputMedia {

View File

@ -1,7 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode
import kotlinx.serialization.*
import java.lang.IllegalArgumentException
internal const val parseModeField = "parse_mode"

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
data class ChannelChat(

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
interface Chat {
val id: ChatId

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
interface GroupChat : PublicChat {
val allMembersAreAdmins: Boolean

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
data class PrivateChat(
override val id: ChatId,

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.*

View File

@ -1,6 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
data class SupergroupChat(

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,20 +1,14 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
import kotlinx.serialization.internal.ArrayListSerializer
typealias Photo = List<PhotoSize>
fun Photo.biggest(): PhotoSize? {
var biggest: PhotoSize = firstOrNull() ?: return null
forEach {
if (it.resolution > biggest.resolution) {
biggest = it
}
}
return biggest
fun Photo.biggest(): PhotoSize? = maxBy {
it.resolution
}
object PhotoSerializer : KSerializer<Photo> by ArrayListSerializer(

View File

@ -1,8 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.MaskPosition
import kotlinx.serialization.*

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
import kotlinx.serialization.*
@Serializable

View File

@ -1,7 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.*
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntities
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntitiesSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.*
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
import com.github.insanusmokrassar.TelegramBotAPI.types.games.Game

View File

@ -1,8 +1,21 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
import com.github.insanusmokrassar.TelegramBotAPI.types.Contact
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendContact
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
data class ContactContent(
val contact: Contact
) : MessageContent
) : MessageContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<RawMessage> = SendContact(
chatId, contact, disableNotification, replyToMessageId, replyMarkup
)
}

View File

@ -1,8 +1,27 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.games.SendGame
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.games.Game
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
data class GameContent(
val game: Game
) : MessageContent
) : MessageContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<RawMessage> = SendGame(
chatId,
game.title,
disableNotification,
replyToMessageId,
replyMarkup
)
}

View File

@ -1,8 +1,27 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
import com.github.insanusmokrassar.TelegramBotAPI.types.Location
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendLocation
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
data class LocationContent(
val location: Location
) : MessageContent
) : MessageContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<RawMessage> = SendLocation(
chatId,
location.latitude,
location.longitude,
null,
disableNotification,
replyToMessageId,
replyMarkup
)
}

View File

@ -1,9 +1,32 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.MessageEntity
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.MarkdownParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownText
data class TextContent(
val text: String,
val entities: List<MessageEntity> = emptyList()
) : MessageContent
) : MessageContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<RawMessage> = SendMessage(
chatId,
toMarkdownText(),
MarkdownParseMode,
false,
disableNotification,
replyToMessageId,
replyMarkup
)
}

View File

@ -1,8 +1,21 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
import com.github.insanusmokrassar.TelegramBotAPI.types.Venue
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendVenue
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
data class VenueContent(
val venue: Venue
) : MessageContent
) : MessageContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<RawMessage> = SendVenue(
chatId, venue, disableNotification, replyToMessageId, replyMarkup
)
}

View File

@ -1,3 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts
interface MediaGroupContent : MessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia
interface MediaGroupContent : MessageContent {
fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia
}

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