From 75c2f71d709c5e5755526d2b2642abf96c9621ed Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:21:46 +0800 Subject: [PATCH 01/27] start 0.10.0 --- CHANGELOG.md | 1 + build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d9236546..779abf4b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # TelegramBotAPI changelog +## 0.10.0 ## 0.9.0 diff --git a/build.gradle b/build.gradle index e08085e6e6..810ac6ef59 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -project.version = "0.9.3" +project.version = "0.10.0" project.group = "com.github.insanusmokrassar" buildscript { From 0f9533e54a83fbb9055e676f4afa850daf988ff5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 11:25:49 +0800 Subject: [PATCH 02/27] InputMessageContent filling --- CHANGELOG.md | 10 ++++++++ .../Captioned.kt | 2 +- .../CommonAbstracts/CommonContactData.kt | 8 +++++++ .../CommonAbstracts/CommonVenueData.kt | 8 +++++++ .../TelegramBotAPI/CommonAbstracts/Livable.kt | 8 +++++++ .../Locationed.kt | 2 +- .../types/ByInlineMessageId.kt | 2 +- .../types/ByMessageId.kt | 2 +- .../types/ChatRequest.kt | 2 +- .../types/DisableNotification.kt | 5 ++++ .../types/DisableWebPagePreview.kt | 2 +- .../types/ReplyMarkup.kt | 2 +- .../types/ReplyMessageId.kt | 2 +- .../types/UntilDate.kt | 2 +- .../abstracts/types/DisableNotification.kt | 5 ---- .../requests/chat/ExportChatInviteLink.kt | 2 +- .../TelegramBotAPI/requests/chat/LeaveChat.kt | 2 +- .../chat/abstracts/ChatMemberRequest.kt | 2 +- .../requests/chat/get/GetChat.kt | 2 +- .../chat/get/GetChatAdministrators.kt | 2 +- .../requests/chat/get/GetChatMembersCount.kt | 2 +- .../requests/chat/members/KickChatMember.kt | 2 +- .../chat/members/PromoteChatMember.kt | 2 +- .../chat/members/RestrictChatMember.kt | 2 +- .../requests/chat/modify/DeleteChatPhoto.kt | 2 +- .../requests/chat/modify/PinChatMessage.kt | 4 ++-- .../chat/modify/SetChatDescription.kt | 2 +- .../requests/chat/modify/SetChatPhoto.kt | 2 +- .../requests/chat/modify/SetChatTitle.kt | 2 +- .../requests/chat/modify/UnpinChatMessage.kt | 2 +- .../chat/stickers/DeleteChatStickerSet.kt | 2 +- .../chat/stickers/SetChatStickerSet.kt | 2 +- .../edit/abstracts/EditReplyMessage.kt | 2 +- .../requests/games/GetGameHighScoresByChat.kt | 2 +- .../GetGameHighScoresByInlineMessageId.kt | 2 +- .../requests/games/SetGameScoreByChatId.kt | 2 +- .../games/SetGameScoreByInlineMessageId.kt | 2 +- .../requests/send/SendMessage.kt | 2 +- .../ReplyingMarkupSendMessageRequest.kt | 2 +- .../send/abstracts/SendChatMessageRequest.kt | 2 +- .../send/abstracts/SendMessageRequest.kt | 4 ++-- .../requests/send/games/SendGame.kt | 2 +- .../requests/send/payments/SendInvoice.kt | 2 +- .../types/ChatMember/BannedChatMember.kt | 2 +- .../TelegramBotAPI/types/Common.kt | 1 + .../TelegramBotAPI/types/Contact.kt | 11 +++++---- .../abstracts/CaptionedInlineQueryResult.kt | 2 +- .../abstracts/PositionedInlineQueryResult.kt | 2 +- .../InputContactMessageContent.kt | 19 +++++++++++++++ .../InputLocationMessageContent.kt | 18 ++++++++++++++ .../InputTextMessageContent.kt | 21 ++++++++++++++++ .../InputVenueMessageContent.kt | 24 +++++++++++++++++++ .../abstracts/InputMessageContent.kt | 3 +-- .../TelegramBotAPI/types/Location.kt | 2 +- .../TelegramBotAPI/types/Venue.kt | 11 +++++---- 55 files changed, 178 insertions(+), 60 deletions(-) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{types/abstracts => CommonAbstracts}/Captioned.kt (71%) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Livable.kt rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{types/abstracts => CommonAbstracts}/Locationed.kt (55%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/ByInlineMessageId.kt (68%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/ByMessageId.kt (66%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/ChatRequest.kt (62%) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/DisableWebPagePreview.kt (50%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/ReplyMarkup.kt (65%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/ReplyMessageId.kt (66%) rename src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/{requests/abstracts => CommonAbstracts}/types/UntilDate.kt (62%) delete mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableNotification.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 779abf4b53..89b494639e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,3 +80,13 @@ must be regular text * Update `MediaGroupMessage` interface * Add implementation of `MediaGroupMessage` * Add generating of `MediaGroupMessage` in `RawMessage` + +#### Inline mode changes + +// It is temporal block of changes which will be replaced before complete merge + +* Most part of abstractions was replaced from `requests` and `types` on more high level +* Added abstraction `CommonVenueData` +* Added abstraction `CommonContactData` +* Added `InputMessageContent` +* Update some types and requests according to abstractions replacing diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Captioned.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt similarity index 71% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Captioned.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt index 23bf23b54e..7b3c72c6f5 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Captioned.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt new file mode 100644 index 0000000000..0a7d4b09fc --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt @@ -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 +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt new file mode 100644 index 0000000000..c8dd1501d6 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt @@ -0,0 +1,8 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts + +interface CommonVenueData { + val title: String + val address: String + val foursquareId: String? + val foursquareType: String? // TODO:: Rewrite with enum or interface +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Livable.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Livable.kt new file mode 100644 index 0000000000..d0f268a2d9 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Livable.kt @@ -0,0 +1,8 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts + +interface Livable { + /** + * Period in SECONDS + */ + val livePeriod: Int? +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Locationed.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Locationed.kt similarity index 55% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Locationed.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Locationed.kt index e8cbbfeba0..0544a94e0c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/abstracts/Locationed.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Locationed.kt @@ -1,4 +1,4 @@ -package com.github.insanusmokrassar.TelegramBotAPI.types.abstracts +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts interface Locationed { val latitude: Double diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByInlineMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt similarity index 68% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByInlineMessageId.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt index 9bf0c75555..b163e044e5 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByInlineMessageId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt similarity index 66% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByMessageId.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt index 844c1ddfbb..768c99e312 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ByMessageId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ChatRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ChatRequest.kt similarity index 62% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ChatRequest.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ChatRequest.kt index 6b227e1345..8add2db69b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ChatRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ChatRequest.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt new file mode 100644 index 0000000000..a07ec1055a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types + +interface DisableNotification { + val disableNotification: Boolean +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableWebPagePreview.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableWebPagePreview.kt similarity index 50% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableWebPagePreview.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableWebPagePreview.kt index 60790ab8c5..34636ed4b0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableWebPagePreview.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableWebPagePreview.kt @@ -1,4 +1,4 @@ -package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types interface DisableWebPagePreview { val disableWebPagePreview: Boolean? diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMarkup.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMarkup.kt similarity index 65% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMarkup.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMarkup.kt index 71fc490fc2..9536f7c2a9 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMarkup.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMarkup.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMessageId.kt similarity index 66% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMessageId.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMessageId.kt index 9c72d3c704..785c5b6392 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/ReplyMessageId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMessageId.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/UntilDate.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/UntilDate.kt similarity index 62% rename from src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/UntilDate.kt rename to src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/UntilDate.kt index 3b22c62855..7be9229808 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/UntilDate.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/UntilDate.kt @@ -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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableNotification.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableNotification.kt deleted file mode 100644 index e9feb38ff1..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/types/DisableNotification.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types - -interface DisableNotification { - val disableNotification: Boolean -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt index d88cdbd862..e595a5580b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt index abe7ba5185..5b9e145d3e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt index 408a4973ed..8d83987fa5 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.UserId interface ChatMemberRequest : ChatRequest, SimpleRequest { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt index 1fdde3afb5..4625b9dd9a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt index 0733cacd82..b29d1c3d98 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.RawChatMember import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt index c7d11a722e..9d28fc4021 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt index d6c9db5775..96f917ab9c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt index 599834c976..4751adb8c6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt index 6706b899b0..cf960fa91b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt index fc4608d176..2a43b04c72 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt index 63908dbc6a..430af565cb 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt @@ -1,8 +1,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableNotification +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt index fd0d33f983..9c4b1ab62d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt index 5053581e67..7aa0d80c3e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt @@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt index faf46fa7e1..f98f80b39b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt index 1ef661ec56..18154fc892 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt index a224ebd87d..ef3c36ab43 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt index 207895dc4c..cfa6a469fe 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditReplyMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditReplyMessage.kt index 94fcf34ff6..9cfe3b6718 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditReplyMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditReplyMessage.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup interface EditReplyMessage : ReplyMarkup { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt index bbc42ff686..47d96d04b0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.games -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.SerialName diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt index 6d9d8cae81..b5e7aadc2e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.games -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.SerialName diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt index e6a96cccb7..f5a057be78 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.games -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt index efd78d4563..67551d60bc 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.games -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt index 1e6c7b5d8e..8e7c7b16bd 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableWebPagePreview +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt index adcfaeff88..85a7d41746 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup interface ReplyingMarkupSendMessageRequest: SendMessageRequest, ReplyMarkup \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt index 56ed3cb4d6..40760c976b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest interface SendChatMessageRequest : SimpleRequest, ChatRequest \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendMessageRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendMessageRequest.kt index 31ea67cf0a..7ace010c70 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendMessageRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendMessageRequest.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.DisableNotification -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMessageId +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMessageId interface SendMessageRequest : SendChatMessageRequest, ReplyMessageId, DisableNotification diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt index 2704ee8be6..38ba35bb1a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.games -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ReplyMarkup +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt index 4c7d4b6c9d..7f4239b4f1 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.* +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.* import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatMember/BannedChatMember.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatMember/BannedChatMember.kt index 31ef2097bc..1bf15213b8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatMember/BannedChatMember.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatMember/BannedChatMember.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.UntilDate +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate interface BannedChatMember : ChatMember, UntilDate \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index e9e28b1d50..7b2733b247 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -58,6 +58,7 @@ const val foursquareIdField = "foursquare_id" const val foursquareTypeField = "foursquare_type" const val untilDateField = "until_date" const val errorMessageField = "error_message" +const val messageTextField = "message_text" const val photoUrlField = "photo_url" const val photoSizeField = "photo_size" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt index 09b4ed72ea..c1fc7610d8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt @@ -1,19 +1,20 @@ package com.github.insanusmokrassar.TelegramBotAPI.types +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData import kotlinx.serialization.* @Serializable data class Contact( @SerialName(phoneNumberField) - val phoneNumber: String, + override val phoneNumber: String, @SerialName(firstNameField) - val firstName: String, + override val firstName: String, @SerialName(lastNameField) @Optional - val lastName: String? = null, + override val lastName: String? = null, @SerialName(userIdField) @Optional val userId: UserId? = null, @Optional - val vcard: String? = null -) + override val vcard: String? = null +) : CommonContactData diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt index 0e00f81679..6973c94ea0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned interface CaptionedInlineQueryResult : InlineQueryResult, Captioned diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/PositionedInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/PositionedInlineQueryResult.kt index b1b1748b66..22387eced2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/PositionedInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/PositionedInlineQueryResult.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Locationed +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed interface PositionedInlineQueryResult : InlineQueryResult, Locationed \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt new file mode 100644 index 0000000000..e08718eaf7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt @@ -0,0 +1,19 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import kotlinx.serialization.* + +@Serializable +data class InputContactMessageContent( + @SerialName(phoneNumberField) + override val phoneNumber: String, + @SerialName(firstNameField) + override val firstName: String, + @SerialName(lastNameField) + @Optional + override val lastName: String? = null, + @Optional + override val vcard: String? = null +) : CommonContactData, InputMessageContent \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt new file mode 100644 index 0000000000..747d23d067 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt @@ -0,0 +1,18 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent + +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Livable +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import kotlinx.serialization.* + +@Serializable +data class InputLocationMessageContent( + @SerialName(latitudeField) + override val latitude: Double, + @SerialName(longitudeField) + override val longitude: Double, + @SerialName(livePeriodField) + @Optional + override val livePeriod: Int? = null +) : Locationed, Livable, InputMessageContent \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt new file mode 100644 index 0000000000..d8fc3af32f --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt @@ -0,0 +1,21 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.disableWebPagePreviewField +import com.github.insanusmokrassar.TelegramBotAPI.types.messageTextField +import kotlinx.serialization.* + +@Serializable +data class InputTextMessageContent( + @SerialName(messageTextField) + override val caption: String, + @SerialName(parseModeField) + override val parseMode: ParseMode, + @SerialName(disableWebPagePreviewField) + @Optional + override val disableWebPagePreview: Boolean? = null +) : Captioned, DisableWebPagePreview, InputMessageContent \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt new file mode 100644 index 0000000000..9cc65db875 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt @@ -0,0 +1,24 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import kotlinx.serialization.* + +@Serializable +data class InputVenueMessageContent( + @SerialName(latitudeField) + override val latitude: Double, + @SerialName(longitudeField) + override val longitude: Double, + @SerialName(titleField) + override val title: String, + @SerialName(addressField) + override val address: String, + @SerialName(foursquareIdField) + @Optional + override val foursquareId: String? = null, + @SerialName(foursquareTypeField) + @Optional + override val foursquareType: String? = null +) : Locationed, CommonVenueData, InputMessageContent diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InputMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InputMessageContent.kt index fa2ec1f741..f36cbb3a20 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InputMessageContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InputMessageContent.kt @@ -1,4 +1,3 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts -interface InputMessageContent { -} \ No newline at end of file +interface InputMessageContent diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Location.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Location.kt index 3d313c268d..29ab9f3472 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Location.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Location.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types -import com.github.insanusmokrassar.TelegramBotAPI.types.abstracts.Locationed +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Venue.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Venue.kt index f979d0131c..8a7514a62d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Venue.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Venue.kt @@ -1,5 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData import kotlinx.serialization.* @Serializable @@ -7,13 +8,13 @@ data class Venue( @SerialName(locationField) val location: Location, @SerialName(titleField) - val title: String, + override val title: String, @SerialName(addressField) - val address: String, + override val address: String, @SerialName(foursquareIdField) @Optional - val foursquareId: String? = null, + override val foursquareId: String? = null, @SerialName(foursquareTypeField) @Optional - val foursquareType: String? = null // TODO:: Rewrite with enum or interface -) + override val foursquareType: String? = null +) : CommonVenueData From caa759db21cfc07ad654c3d1d6dd3c3194112a6f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 12:03:28 +0800 Subject: [PATCH 03/27] add InlineQueryResult photo and gif common and cached realisations --- .../InlineQueryResultArticle.kt | 5 ++- .../InlineQueryResultGifCachedImpl.kt | 34 +++++++++++++++ .../InlineQueryResultGifImpl.kt | 43 +++++++++++++++++++ .../InlineQueryResultPhotoCachedImpl.kt | 36 ++++++++++++++++ .../InlineQueryResultPhotoImpl.kt | 43 +++++++++++++++++++ .../abstracts/CaptionedInlineQueryResult.kt | 5 --- .../abstracts/TitledInlineQueryResult.kt | 2 +- .../abstracts/UrlInlineQueryResult.kt | 2 +- ...ithInputMessageContentInlineQueryResult.kt | 2 +- .../results/gif/InlineQueryResultGif.kt | 5 +++ .../results/gif/InlineQueryResultGifCached.kt | 5 +++ .../results/gif/InlineQueryResultGifCommon.kt | 13 ++++++ .../results/photo/InlineQueryResultPhoto.kt | 5 +++ .../photo/InlineQueryResultPhotoCached.kt | 5 +++ .../photo/InlineQueryResultPhotoCommon.kt | 14 ++++++ 15 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt delete mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGif.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhoto.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt index a63459a39e..b87ab02591 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt @@ -18,7 +18,7 @@ class InlineQueryResultArticle( override val replyMarkup: InlineKeyboardMarkup? = null, @SerialName(urlField) @Optional - val url: String? = null, + override val url: String? = null, @SerialName(hideUrlField) @Optional val hideUrl: Boolean? = null, @@ -38,6 +38,7 @@ class InlineQueryResultArticle( ThumbSizedInlineQueryResult, TitledInlineQueryResult, DescribedInlineQueryResult, - WithInputMessageContentInlineQueryResult { + WithInputMessageContentInlineQueryResult, + UrlInlineQueryResult { override val type: String = "article" } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt new file mode 100644 index 0000000000..6e6795a25b --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt @@ -0,0 +1,34 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt new file mode 100644 index 0000000000..7885dd83df --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt @@ -0,0 +1,43 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt new file mode 100644 index 0000000000..03c45825c9 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt @@ -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.photo.InlineQueryResultPhotoCached +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 \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt new file mode 100644 index 0000000000..cecc8bf11a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt @@ -0,0 +1,43 @@ +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.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 \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt deleted file mode 100644 index 6973c94ea0..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/CaptionedInlineQueryResult.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts - -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned - -interface CaptionedInlineQueryResult : InlineQueryResult, Captioned diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt index ff5781c058..965d6c085b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts interface TitledInlineQueryResult : OptionallyTitledInlineQueryResult { - override val title: String + override val title: String? } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/UrlInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/UrlInlineQueryResult.kt index 3c7ea70a62..7ce2183d48 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/UrlInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/UrlInlineQueryResult.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts interface UrlInlineQueryResult : InlineQueryResult { - val url: String + val url: String? } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/WithInputMessageContentInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/WithInputMessageContentInlineQueryResult.kt index 31ae77210c..ef24fc0b13 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/WithInputMessageContentInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/WithInputMessageContentInlineQueryResult.kt @@ -3,5 +3,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent interface WithInputMessageContentInlineQueryResult : InlineQueryResult { - val inputMessageContent: InputMessageContent + val inputMessageContent: InputMessageContent? } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGif.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGif.kt new file mode 100644 index 0000000000..215f839003 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGif.kt @@ -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 \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt new file mode 100644 index 0000000000..d1ffe0be6a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt @@ -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 InlineQueryResultGifCached : InlineQueryResultGifCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt new file mode 100644 index 0000000000..de8e0b1037 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt @@ -0,0 +1,13 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultGifCommon : InlineQueryResult, + TitledInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "gif" +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhoto.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhoto.kt new file mode 100644 index 0000000000..d6469e4a20 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhoto.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultPhoto : InlineQueryResultPhotoCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, SizedInlineQueryResult \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt new file mode 100644 index 0000000000..d2fff307ed --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultPhotoCached : InlineQueryResultPhotoCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt new file mode 100644 index 0000000000..fbf85345a4 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultPhotoCommon : InlineQueryResult, + TitledInlineQueryResult, + DescribedInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "photo" +} \ No newline at end of file From 558800c1e477e8e2a14d4753846b2808b0468262 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 12:15:16 +0800 Subject: [PATCH 04/27] add Mpeg4Gif InlineQueryResult --- .../TelegramBotAPI/types/Common.kt | 11 +++-- .../InlineQueryResultMpeg4GifCachedImpl.kt | 35 +++++++++++++++ .../InlineQueryResultMpeg4GifImpl.kt | 43 +++++++++++++++++++ .../mpeg4gif/InlineQueryResultMpeg4Gif.kt | 5 +++ .../InlineQueryResultMpeg4GifCached.kt | 5 +++ .../InlineQueryResultMpeg4GifCommon.kt | 13 ++++++ 6 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 7b2733b247..a76cd5f48c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -65,14 +65,19 @@ const val photoSizeField = "photo_size" const val photoFileIdField = "photo_file_id" const val gifUrlField = "gif_url" const val gifFileIdField = "gif_file_id" +const val gifWidthField = "gif_width" +const val gifHeightField = "gif_height" +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 thumbUrlField = "thumb_url" const val thumbWidthField = "thumb_width" const val thumbHeightField = "thumb_height" const val photoWidthField = "photo_width" const val photoHeightField = "photo_height" -const val gifWidthField = "gif_width" -const val gifHeightField = "gif_height" -const val gifDurationField = "gif_duration" const val inputMessageContentField = "input_message_content" const val hideUrlField = "hide_url" const val gameShortNameField = "game_short_name" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt new file mode 100644 index 0000000000..274e513286 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt @@ -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.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.mpeg4gif.InlineQueryResultMpeg4GifCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt new file mode 100644 index 0000000000..f21d08871a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -0,0 +1,43 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt new file mode 100644 index 0000000000..ffb42e5274 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4Gif : InlineQueryResultMpeg4GifCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, SizedInlineQueryResult, DuratedInlineResultQuery \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt new file mode 100644 index 0000000000..96023e0210 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4GifCached : InlineQueryResultMpeg4GifCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt new file mode 100644 index 0000000000..0e0f86c3c7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt @@ -0,0 +1,13 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4GifCommon : InlineQueryResult, + TitledInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "mpeg4_gif" +} \ No newline at end of file From 1ce4c97899f3becccca961848c54d73f6deab8bf Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 12:32:32 +0800 Subject: [PATCH 05/27] add Video InlineQueryResult --- .../CommonAbstracts/MimeTyped.kt | 5 ++ .../TelegramBotAPI/types/Common.kt | 19 +++++-- .../InlineQueryResultVideoCachedImpl.kt | 38 ++++++++++++++ .../InlineQueryResultVideoImpl.kt | 49 +++++++++++++++++++ .../results/video/InlineQueryResultVideo.kt | 6 +++ .../video/InlineQueryResultVideoCached.kt | 5 ++ .../video/InlineQueryResultVideoCommon.kt | 15 ++++++ .../types/files/abstracts/MimedMediaFile.kt | 6 +-- 8 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/MimeTyped.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideo.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/MimeTyped.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/MimeTyped.kt new file mode 100644 index 0000000000..e1c4f3f8b7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/MimeTyped.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts + +interface MimeTyped { + val mimeType: String? // TODO::replace by something like enum or interface +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index a76cd5f48c..a1fb1ef1a8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -60,27 +60,40 @@ const val untilDateField = "until_date" const val errorMessageField = "error_message" const val messageTextField = "message_text" + const val photoUrlField = "photo_url" const val photoSizeField = "photo_size" const val photoFileIdField = "photo_file_id" +const val photoWidthField = "photo_width" +const val photoHeightField = "photo_height" + const val gifUrlField = "gif_url" const val gifFileIdField = "gif_file_id" const val gifWidthField = "gif_width" const val gifHeightField = "gif_height" 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 gameShortNameField = "game_short_name" + const val thumbUrlField = "thumb_url" const val thumbWidthField = "thumb_width" const val thumbHeightField = "thumb_height" -const val photoWidthField = "photo_width" -const val photoHeightField = "photo_height" + const val inputMessageContentField = "input_message_content" const val hideUrlField = "hide_url" -const val gameShortNameField = "game_short_name" + const val canSendMessagesField = "can_send_messages" const val canSendMediaMessagesField = "can_send_media_messages" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt new file mode 100644 index 0000000000..df26bd3ebd --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt @@ -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.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResultVideoCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultVideoCachedImpl( + @SerialName(idField) + override val id: String, + @SerialName(videoFileIdField) + 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 +) : InlineQueryResultVideoCached diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt new file mode 100644 index 0000000000..5d57a9e26d --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -0,0 +1,49 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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(videoWidthField) + @Optional + override val width: Int? = null, + @SerialName(videoHeightField) + @Optional + override val height: Int? = null, + @SerialName(videoDurationField) + @Optional + override val duration: 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 +) : InlineQueryResultVideo diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideo.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideo.kt new file mode 100644 index 0000000000..81dfcfa602 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideo.kt @@ -0,0 +1,6 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVideo : InlineQueryResultVideoCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, MimeTyped, SizedInlineQueryResult, DuratedInlineResultQuery \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt new file mode 100644 index 0000000000..6232e95eab --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVideoCached : InlineQueryResultVideoCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt new file mode 100644 index 0000000000..7f64bcae3b --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt @@ -0,0 +1,15 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVideoCommon : InlineQueryResult, + TitledInlineQueryResult, + DescribedInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "video" +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/MimedMediaFile.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/MimedMediaFile.kt index 2ab9ffcf0a..0bc4b4e350 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/MimedMediaFile.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/MimedMediaFile.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped + internal const val mimeTypeField = "mime_type" -interface MimedMediaFile : TelegramMediaFile { - val mimeType: String? // TODO::replace by something like enum or interface -} \ No newline at end of file +interface MimedMediaFile : TelegramMediaFile, MimeTyped \ No newline at end of file From fa10535a70815792a73a697d3bef5881c9520175 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 12:47:08 +0800 Subject: [PATCH 06/27] add Audio InlineQueryResult --- .../CommonAbstracts/Performerable.kt | 5 +++ .../requests/send/media/SendAudio.kt | 6 ++- .../TelegramBotAPI/types/Common.kt | 4 ++ .../InlineQueryResultAudioCachedImpl.kt | 33 ++++++++++++++++ .../InlineQueryResultAudioImpl.kt | 39 +++++++++++++++++++ .../results/audio/InlineQueryResultAudio.kt | 6 +++ .../audio/InlineQueryResultAudioCached.kt | 5 +++ .../audio/InlineQueryResultAudioCommon.kt | 13 +++++++ .../types/InputMedia/InputMediaAudio.kt | 5 ++- .../TelegramBotAPI/types/files/AudioFile.kt | 5 ++- 10 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Performerable.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudio.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Performerable.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Performerable.kt new file mode 100644 index 0000000000..f001348d98 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Performerable.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts + +interface Performerable { + val performer: String? +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt index 82df382757..9599b3a532 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt @@ -1,5 +1,6 @@ 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.send.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.* @@ -74,7 +75,7 @@ data class SendAudioData internal constructor( override val duration: Long? = null, @SerialName(performerField) @Optional - val performer: String? = null, + override val performer: String? = null, @SerialName(titleField) @Optional override val title: String? = null, @@ -93,7 +94,8 @@ data class SendAudioData internal constructor( TextableSendMessageRequest, ThumbedSendMessageRequest, TitledSendMessageRequest, - DuratedSendMessageRequest + DuratedSendMessageRequest, + Performerable { init { text ?.let { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index a1fb1ef1a8..dafdcd418a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -85,6 +85,10 @@ 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 gameShortNameField = "game_short_name" const val thumbUrlField = "thumb_url" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt new file mode 100644 index 0000000000..b0576fe4c3 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt @@ -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.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResultAudioCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt new file mode 100644 index 0000000000..ddf4432bdc --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -0,0 +1,39 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultAudioImpl( + @SerialName(idField) + override val id: String, + @SerialName(audioUrlField) + override val url: String, + @SerialName(performerField) + override val performer: String?, + @SerialName(audioDurationField) + @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 +) : InlineQueryResultAudio diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudio.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudio.kt new file mode 100644 index 0000000000..636110e70c --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudio.kt @@ -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 \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt new file mode 100644 index 0000000000..04b8b26fc2 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultAudioCached : InlineQueryResultAudioCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt new file mode 100644 index 0000000000..eaff7927a7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt @@ -0,0 +1,13 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultAudioCommon : InlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "audio" +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaAudio.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaAudio.kt index f7c47e0fb2..e7ed5e3280 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaAudio.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaAudio.kt @@ -1,5 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField @@ -18,11 +19,11 @@ data class InputMediaAudio( @Optional override val duration: Long? = null, @Optional - val performer: String? = null, + override val performer: String? = null, @Optional override val title: String? = null, override val thumb: InputFile? = null -) : InputMedia, DuratedInputMedia, ThumbedInputMedia, TitledInputMedia, CaptionedInputMedia { +) : InputMedia, DuratedInputMedia, ThumbedInputMedia, TitledInputMedia, CaptionedInputMedia, Performerable { override val type: String = "audio" @SerialName(mediaField) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/AudioFile.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/AudioFile.kt index c55212869a..5816c4d87a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/AudioFile.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/AudioFile.kt @@ -1,5 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.files +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.* import kotlinx.serialization.* @@ -11,7 +12,7 @@ data class AudioFile( @Optional override val duration: Long? = null, @Optional - val performer: String? = null, + override val performer: String? = null, @Optional override val title: String? = null, @SerialName(mimeTypeField) @@ -22,4 +23,4 @@ data class AudioFile( override val fileSize: Long? = null, @Optional override val thumb: PhotoSize? = null -) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile +) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile, Performerable From 99c3f9b742406e7c9ed62d4a98461e4aba0cce3b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 13:10:15 +0800 Subject: [PATCH 07/27] add Voice InlineQueryResult + a little fix of Audio result --- .../TelegramBotAPI/types/Common.kt | 4 +++ .../InlineQueryResultAudioImpl.kt | 3 +- .../InlineQueryResultVoiceCachedImpl.kt | 34 ++++++++++++++++++ .../InlineQueryResultVoiceImpl.kt | 35 +++++++++++++++++++ .../results/voice/InlineQueryResultVoice.kt | 6 ++++ .../voice/InlineQueryResultVoiceCached.kt | 5 +++ .../voice/InlineQueryResultVoiceCommon.kt | 14 ++++++++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index dafdcd418a..53ba540945 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -89,6 +89,10 @@ 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 gameShortNameField = "game_short_name" const val thumbUrlField = "thumb_url" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt index ddf4432bdc..c91156d653 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -17,7 +17,8 @@ data class InlineQueryResultAudioImpl( @SerialName(audioUrlField) override val url: String, @SerialName(performerField) - override val performer: String?, + @Optional + override val performer: String? = null, @SerialName(audioDurationField) @Optional override val duration: Int? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt new file mode 100644 index 0000000000..5de6efcc0b --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt @@ -0,0 +1,34 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResultVoiceCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultVoiceCachedImpl( + @SerialName(idField) + override val id: String, + @SerialName(voiceFileIdField) + 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 +) : InlineQueryResultVoiceCached diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt new file mode 100644 index 0000000000..2fe6d985df --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt @@ -0,0 +1,35 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultVoiceImpl( + @SerialName(idField) + override val id: String, + @SerialName(voiceUrlField) + override val url: String, + @SerialName(voiceDurationField) + @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 +) : InlineQueryResultVoice diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt new file mode 100644 index 0000000000..b400854bc7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt @@ -0,0 +1,6 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVoice : InlineQueryResultVoiceCommon, UrlInlineQueryResult, DuratedInlineResultQuery \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt new file mode 100644 index 0000000000..9977b5f6b6 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVoiceCached : InlineQueryResultVoiceCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt new file mode 100644 index 0000000000..1d9332244a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultVoiceCommon : InlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult, + TitledInlineQueryResult +{ + override val type: String + get() = "audio" +} \ No newline at end of file From 78b63d7b1b024cc87bf56721059f728c30b77ab6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 13:28:31 +0800 Subject: [PATCH 08/27] add Document InlineQueryResult + a little fixes in audio and voice results --- .../TelegramBotAPI/types/Common.kt | 3 ++ .../InlineQueryResultDocumentCachedImpl.kt | 39 +++++++++++++++ .../InlineQueryResultDocumentImpl.kt | 48 +++++++++++++++++++ .../InlineQueryResultVideoImpl.kt | 2 +- .../document/InlineQueryResultDocument.kt | 6 +++ .../InlineQueryResultDocumentCached.kt | 5 ++ .../InlineQueryResultDocumentCommon.kt | 15 ++++++ .../voice/InlineQueryResultVoiceCommon.kt | 2 +- 8 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocument.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 53ba540945..1dcc51fcab 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -93,6 +93,9 @@ 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 gameShortNameField = "game_short_name" const val thumbUrlField = "thumb_url" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt new file mode 100644 index 0000000000..cc3abb6e06 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt @@ -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.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResultDocumentCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultDocumentCachedImpl( + @SerialName(idField) + override val id: String, + @SerialName(documentFileIdField) + 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 +) : InlineQueryResultDocumentCached diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt new file mode 100644 index 0000000000..1edbadc009 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -0,0 +1,48 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultDocumentImpl( + @SerialName(idField) + override val id: String, + @SerialName(documentUrlField) + override val url: 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(mimeTypeField) + override val mimeType: String? = 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 +) : InlineQueryResultDocument diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index 5d57a9e26d..57895b0326 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -18,7 +18,7 @@ data class InlineQueryResultVideoImpl( @SerialName(thumbUrlField) override val thumbUrl: String, @SerialName(mimeTypeField) - override val mimeType: String?, + override val mimeType: String? = null, @SerialName(videoWidthField) @Optional override val width: Int? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocument.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocument.kt new file mode 100644 index 0000000000..95280e3ff5 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocument.kt @@ -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 \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt new file mode 100644 index 0000000000..035fc567bc --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultDocumentCached : InlineQueryResultDocumentCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt new file mode 100644 index 0000000000..11694795e8 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt @@ -0,0 +1,15 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultDocumentCommon : InlineQueryResult, + TitledInlineQueryResult, + DescribedInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "document" +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt index 1d9332244a..3d946cd78f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt @@ -10,5 +10,5 @@ interface InlineQueryResultVoiceCommon : InlineQueryResult, TitledInlineQueryResult { override val type: String - get() = "audio" + get() = "voice" } \ No newline at end of file From fec37d633cc598fb9eb0bf014cd3e4dabcacd9a0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 13:35:41 +0800 Subject: [PATCH 09/27] add limit for live period --- .../com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 1dcc51fcab..fefb96e94f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -28,6 +28,8 @@ val invoiceTitleLimit = 1 until 32 val invoiceDescriptionLimit = 1 until 256 val invoicePayloadBytesLimit = 1 until 128 +val livePeriodLimit = 60 .. 86400 + const val chatIdField = "chat_id" const val messageIdField = "message_id" const val updateIdField = "update_id" From 8369114d26fa238737a8e6f1c5af05db04f45915 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 13:42:14 +0800 Subject: [PATCH 10/27] add Location InlineQueryResult --- .../InlineQueryResultLocation.kt | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt new file mode 100644 index 0000000000..ac9b23b390 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt @@ -0,0 +1,53 @@ +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.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultLocation( + @SerialName(idField) + override val id: String, + @SerialName(latitudeField) + override val latitude: Double, + @SerialName(longitudeField) + override val longitude: Double, + @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(titleField) + @Optional + override val title: String? = 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" +} From 1963432bc8c9dc1bba20ffe4945738ca798803ef Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 13:55:29 +0800 Subject: [PATCH 11/27] add Venue InlineQueryResult + fix titles in all results --- .../CommonAbstracts/CommonVenueData.kt | 4 +- .../TelegramBotAPI/CommonAbstracts/Titled.kt | 5 ++ .../InlineQueryResultAudioImpl.kt | 5 +- .../InlineQueryResultDocumentCachedImpl.kt | 3 +- .../InlineQueryResultDocumentImpl.kt | 5 +- .../InlineQueryResultLocation.kt | 5 +- .../InlineQueryResultVenue.kt | 56 +++++++++++++++++++ .../InlineQueryResultVideoCachedImpl.kt | 3 +- .../InlineQueryResultVideoImpl.kt | 5 +- .../InlineQueryResultVoiceCachedImpl.kt | 3 +- .../InlineQueryResultVoiceImpl.kt | 5 +- .../OptionallyTitledInlineQueryResult.kt | 6 +- .../abstracts/TitledInlineQueryResult.kt | 2 +- .../results/gif/InlineQueryResultGifCommon.kt | 2 +- .../InlineQueryResultMpeg4GifCommon.kt | 2 +- .../photo/InlineQueryResultPhotoCommon.kt | 2 +- 16 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Titled.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt index c8dd1501d6..fa5dbd0cf2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts -interface CommonVenueData { - val title: String +interface CommonVenueData : Titled { + override val title: String val address: String val foursquareId: String? val foursquareType: String? // TODO:: Rewrite with enum or interface diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Titled.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Titled.kt new file mode 100644 index 0000000000..e7532355a4 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Titled.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts + +interface Titled { + val title: String? +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt index c91156d653..64bbcdb2d4 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -16,15 +16,14 @@ data class InlineQueryResultAudioImpl( 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(titleField) - @Optional - override val title: String? = null, @SerialName(captionField) @Optional override val caption: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt index cc3abb6e06..349fb8f357 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt @@ -19,8 +19,7 @@ data class InlineQueryResultDocumentCachedImpl( @SerialName(documentFileIdField) override val fileId: FileId, @SerialName(titleField) - @Optional - override val title: String? = null, + override val title: String, @SerialName(descriptionField) @Optional override val description: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index 1edbadc009..a0a5edb3ed 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -16,6 +16,8 @@ data class InlineQueryResultDocumentImpl( override val id: String, @SerialName(documentUrlField) override val url: String, + @SerialName(titleField) + override val title: String, @SerialName(thumbUrlField) @Optional override val thumbUrl: String? = null, @@ -27,9 +29,6 @@ data class InlineQueryResultDocumentImpl( override val thumbHeight: Int? = null, @SerialName(mimeTypeField) override val mimeType: String? = null, - @SerialName(titleField) - @Optional - override val title: String? = null, @SerialName(descriptionField) @Optional override val description: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt index ac9b23b390..a2aab02c1b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt @@ -20,6 +20,8 @@ data class InlineQueryResultLocation( override val latitude: Double, @SerialName(longitudeField) override val longitude: Double, + @SerialName(titleField) + override val title: String, @SerialName(livePeriodField) @Optional override val livePeriod: Int? = null, @@ -32,9 +34,6 @@ data class InlineQueryResultLocation( @SerialName(thumbHeightField) @Optional override val thumbHeight: Int? = null, - @SerialName(titleField) - @Optional - override val title: String? = null, @SerialName(replyMarkupField) @Optional override val replyMarkup: InlineKeyboardMarkup? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt new file mode 100644 index 0000000000..dd5cdb2984 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt @@ -0,0 +1,56 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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" +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt index df26bd3ebd..beecc7ea4a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt @@ -18,8 +18,7 @@ data class InlineQueryResultVideoCachedImpl( @SerialName(videoFileIdField) override val fileId: FileId, @SerialName(titleField) - @Optional - override val title: String? = null, + override val title: String, @SerialName(descriptionField) @Optional override val description: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index 57895b0326..c5207f0fa7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -19,6 +19,8 @@ data class InlineQueryResultVideoImpl( override val thumbUrl: String, @SerialName(mimeTypeField) override val mimeType: String? = null, + @SerialName(titleField) + override val title: String, @SerialName(videoWidthField) @Optional override val width: Int? = null, @@ -28,9 +30,6 @@ data class InlineQueryResultVideoImpl( @SerialName(videoDurationField) @Optional override val duration: Int? = null, - @SerialName(titleField) - @Optional - override val title: String? = null, @SerialName(descriptionField) @Optional override val description: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt index 5de6efcc0b..59ff27efa1 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt @@ -17,8 +17,7 @@ data class InlineQueryResultVoiceCachedImpl( @SerialName(voiceFileIdField) override val fileId: FileId, @SerialName(titleField) - @Optional - override val title: String? = null, + override val title: String, @SerialName(captionField) @Optional override val caption: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt index 2fe6d985df..1f0812df48 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt @@ -14,12 +14,11 @@ data class InlineQueryResultVoiceImpl( 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(titleField) - @Optional - override val title: String? = null, @SerialName(captionField) @Optional override val caption: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult.kt index cf20f42c64..7669699c45 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult.kt @@ -1,7 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts -interface OptionallyTitledInlineQueryResult : InlineQueryResult { - val title: String? +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Titled - -} +interface OptionallyTitledInlineQueryResult : InlineQueryResult, Titled diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt index 965d6c085b..ff5781c058 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/TitledInlineQueryResult.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts interface TitledInlineQueryResult : OptionallyTitledInlineQueryResult { - override val title: String? + override val title: String } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt index de8e0b1037..13c8ca3e6f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt @@ -4,7 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* interface InlineQueryResultGifCommon : InlineQueryResult, - TitledInlineQueryResult, + OptionallyTitledInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt index 0e0f86c3c7..68f2073d6f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt @@ -4,7 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* interface InlineQueryResultMpeg4GifCommon : InlineQueryResult, - TitledInlineQueryResult, + OptionallyTitledInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt index fbf85345a4..601ac1cfac 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt @@ -4,7 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* interface InlineQueryResultPhotoCommon : InlineQueryResult, - TitledInlineQueryResult, + OptionallyTitledInlineQueryResult, DescribedInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult From 849e21bf1557a061b4686a7f6f362313cfcc9ef6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:01:09 +0800 Subject: [PATCH 12/27] add Contact InlineQueryResult + add vcard field --- .../TelegramBotAPI/types/Common.kt | 1 + .../TelegramBotAPI/types/Contact.kt | 1 + .../InlineQueryResultContact.kt | 50 +++++++++++++++++++ .../InputContactMessageContent.kt | 1 + 4 files changed, 53 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index fefb96e94f..817cfff15f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -161,6 +161,7 @@ const val labelField = "label" const val amountField = "amount" const val pricesField = "prices" const val payloadField = "payload" +const val vcardField = "vcard" const val pointField = "point" const val xShiftField = "x_shift" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt index c1fc7610d8..1ccfbaf76f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Contact.kt @@ -15,6 +15,7 @@ data class Contact( @SerialName(userIdField) @Optional val userId: UserId? = null, + @SerialName(vcardField) @Optional override val vcard: String? = null ) : CommonContactData diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt new file mode 100644 index 0000000000..ea13c55052 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt @@ -0,0 +1,50 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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" +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt index e08718eaf7..840391a117 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputContactMessageContent.kt @@ -14,6 +14,7 @@ data class InputContactMessageContent( @SerialName(lastNameField) @Optional override val lastName: String? = null, + @SerialName(vcardField) @Optional override val vcard: String? = null ) : CommonContactData, InputMessageContent \ No newline at end of file From ef127b85dc2afa237ecb0ea1e586a47e8f7949e8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:04:03 +0800 Subject: [PATCH 13/27] add cached Sticker InlineQueryResult --- .../TelegramBotAPI/types/Common.kt | 2 ++ .../InlineQueryResultStickerCached.kt | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 817cfff15f..6277ed03af 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -98,6 +98,8 @@ 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" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt new file mode 100644 index 0000000000..f71f329a87 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt @@ -0,0 +1,28 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +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" +} From 05b447da850c9c7ea9fcef42a5deb66a556c47bc Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:14:51 +0800 Subject: [PATCH 14/27] add AnswerInlineQuery --- .../requests/answers/AnswerInlineQuery.kt | 32 +++++++++++++++++++ .../TelegramBotAPI/types/Common.kt | 8 +++++ 2 files changed, 40 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt new file mode 100644 index 0000000000..ad0b8361b1 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt @@ -0,0 +1,32 @@ +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 kotlinx.serialization.* +import kotlinx.serialization.internal.BooleanSerializer + +data class AnswerInlineQuery( + @SerialName(inlineQueryIdField) + val inlineQueryID: InlineQueryIdentifier, + @SerialName(resultsField) + val results: List = 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 { + override fun method(): String = "answerInlineQuery" + override fun resultSerializer(): KSerializer = BooleanSerializer +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 6277ed03af..49fc39a4df 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -30,6 +30,8 @@ val invoicePayloadBytesLimit = 1 until 128 val livePeriodLimit = 60 .. 86400 +val inlineQueryAnswerResultsLimit = 0 .. 50 + const val chatIdField = "chat_id" const val messageIdField = "message_id" const val updateIdField = "update_id" @@ -54,6 +56,7 @@ const val resultIdField = "result_id" const val inlineMessageIdField = "inline_message_id" const val callbackDataField = "callback_data" const val callbackQueryIdField = "callback_query_id" +const val inlineQueryIdField = "inline_query_id" const val showAlertField = "show_alert" const val cachedTimeField = "cached_time" const val foursquareIdField = "foursquare_id" @@ -61,6 +64,10 @@ const val foursquareTypeField = "foursquare_type" const val untilDateField = "until_date" 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" @@ -164,6 +171,7 @@ const val amountField = "amount" const val pricesField = "prices" const val payloadField = "payload" const val vcardField = "vcard" +const val resultsField = "results" const val pointField = "point" const val xShiftField = "x_shift" From 0138036ed27bbd7d13744b5a61ac31b5af3e1c78 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:19:13 +0800 Subject: [PATCH 15/27] add InlineQuery#createAnswer --- .../requests/answers/AnswerInlineQuery.kt | 18 ++++++++++++++++++ .../InlineQueries/abstracts/InlineQuery.kt | 2 -- .../InlineQueries/query/BaseInlineQuery.kt | 6 +----- .../InlineQueries/query/LocationInlineQuery.kt | 6 +----- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt index ad0b8361b1..126abf1cdc 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt @@ -3,6 +3,7 @@ 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.abstracts.InlineQuery import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer @@ -30,3 +31,20 @@ data class AnswerInlineQuery( override fun method(): String = "answerInlineQuery" override fun resultSerializer(): KSerializer = BooleanSerializer } + +fun InlineQuery.createAnswer( + results: List = emptyList(), + cachedTime: Int? = null, + isPersonal: Boolean? = null, + nextOffset: String? = null, + switchPmText: String? = null, + switchPmParameter: String? = null +) = AnswerInlineQuery( + id, + results, + cachedTime, + isPersonal, + nextOffset, + switchPmText, + switchPmParameter +) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt index b602c21716..fcdd5be6e6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt @@ -8,6 +8,4 @@ interface InlineQuery { val from: User val query: String val offset: Long - - fun answerQuery() } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt index fd95001d15..87cd1379b6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt @@ -9,8 +9,4 @@ data class BaseInlineQuery( override val from: User, override val query: String, override val offset: Long -) : InlineQuery { - override fun answerQuery() { - TODO() - } -} \ No newline at end of file +) : InlineQuery diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt index 7afa62f9c7..5d7e890b0a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt @@ -9,8 +9,4 @@ data class LocationInlineQuery( override val query: String, override val offset: Long, val location: Location -) : InlineQuery { - override fun answerQuery() { - TODO() - } -} \ No newline at end of file +) : InlineQuery From 8aed45ae9ebf63967428119eeb8ab2b993ecb46c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 14:29:38 +0800 Subject: [PATCH 16/27] fix changelog --- CHANGELOG.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89b494639e..24bd4724a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## 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 + ## 0.9.0 * Old extension `OkHttpClient.Builder#useWith` now deprecated and must be replaced by the same in @@ -80,13 +87,3 @@ must be regular text * Update `MediaGroupMessage` interface * Add implementation of `MediaGroupMessage` * Add generating of `MediaGroupMessage` in `RawMessage` - -#### Inline mode changes - -// It is temporal block of changes which will be replaced before complete merge - -* Most part of abstractions was replaced from `requests` and `types` on more high level -* Added abstraction `CommonVenueData` -* Added abstraction `CommonContactData` -* Added `InputMessageContent` -* Update some types and requests according to abstractions replacing From f83921223e2b09fb919e397a2adc296b9fa25c39 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 19:12:26 +0800 Subject: [PATCH 17/27] fix of InlineQuery offset type --- .../TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt | 2 +- .../TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt | 2 +- .../types/InlineQueries/query/LocationInlineQuery.kt | 2 +- .../TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt index fcdd5be6e6..9f1e4d978c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/abstracts/InlineQuery.kt @@ -7,5 +7,5 @@ interface InlineQuery { val id: InlineQueryIdentifier val from: User val query: String - val offset: Long + val offset: String } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt index 87cd1379b6..6c7ba5b77d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/BaseInlineQuery.kt @@ -8,5 +8,5 @@ data class BaseInlineQuery( override val id: InlineQueryIdentifier, override val from: User, override val query: String, - override val offset: Long + override val offset: String ) : InlineQuery diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt index 5d7e890b0a..4d1c6a27be 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/LocationInlineQuery.kt @@ -7,6 +7,6 @@ data class LocationInlineQuery( override val id: InlineQueryIdentifier, override val from: User, override val query: String, - override val offset: Long, + override val offset: String, val location: Location ) : InlineQuery diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt index 015a2f05b1..054c52265f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt @@ -12,7 +12,7 @@ data class RawInlineQuery( @SerialName(queryField) val query: String, @SerialName(offsetField) - val offset: Long, + val offset: String, @SerialName(locationField) @Optional val location: Location? = null From f6ce40b62b0ff91bfbb02bd23227e043f13945b0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 19:32:31 +0800 Subject: [PATCH 18/27] resolve serialization problems --- .../InlineQueryResultAudioCachedImpl.kt | 2 + .../InlineQueryResultAudioImpl.kt | 2 + .../InlineQueryResultContact.kt | 2 + .../InlineQueryResultDocumentCachedImpl.kt | 2 + .../InlineQueryResultDocumentImpl.kt | 2 + .../InlineQueryResultGifCachedImpl.kt | 2 + .../InlineQueryResultGifImpl.kt | 2 + .../InlineQueryResultLocation.kt | 2 + .../InlineQueryResultMpeg4GifCachedImpl.kt | 2 + .../InlineQueryResultMpeg4GifImpl.kt | 2 + .../InlineQueryResultStickerCached.kt | 2 + .../InlineQueryResultVenue.kt | 2 + .../InlineQueryResultVideoCachedImpl.kt | 2 + .../InlineQueryResultVideoImpl.kt | 2 + .../InlineQueryResultVoiceCachedImpl.kt | 2 + .../InlineQueryResultVoiceImpl.kt | 2 + .../abstracts/InlineQueryResult.kt | 3 ++ .../InlineQueryResultSerializer.kt | 39 +++++++++++++++++++ 18 files changed, 74 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/serializers/InlineQueryResultSerializer.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt index b0576fe4c3..52e8931776 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt @@ -12,7 +12,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultAudioCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt index 64bbcdb2d4..692fc20304 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -10,7 +10,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultAudioImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt index ea13c55052..58c59b06e1 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt @@ -11,7 +11,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultContact( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt index 349fb8f357..78e5e3ae45 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt @@ -12,7 +12,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultDocumentCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index a0a5edb3ed..18cf268c9a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -10,7 +10,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultDocumentImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt index 6e6795a25b..a23f05c385 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt @@ -10,7 +10,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultGifCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt index 7885dd83df..c58b84bf1d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt @@ -8,7 +8,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultGifImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt index a2aab02c1b..4cd4cd855b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt @@ -12,7 +12,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultLocation( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt index 274e513286..dd997a5207 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt @@ -11,7 +11,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultMpeg4GifCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt index f21d08871a..b851f550c3 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -8,7 +8,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultMpeg4GifImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt index f71f329a87..65b7e4186b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt @@ -11,7 +11,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultStickerCached( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt index dd5cdb2984..5dcc21e06e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt @@ -11,7 +11,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultVenue( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt index beecc7ea4a..e245c0ee0e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt @@ -11,7 +11,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultVideoCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index c5207f0fa7..94c14f940f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -9,7 +9,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultVideoImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt index 59ff27efa1..a4bd5d5d34 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt @@ -10,7 +10,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultVoiceCachedImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt index 1f0812df48..a733a0d0f6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt @@ -8,7 +8,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQuer import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class InlineQueryResultVoiceImpl( @SerialName(idField) override val id: String, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt index 1bc539487e..3f8fa1640b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt @@ -1,7 +1,10 @@ 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 kotlinx.serialization.* +@Serializable(InlineQueryResultSerializer::class) interface InlineQueryResult { val type: String val id: String diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/serializers/InlineQueryResultSerializer.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/serializers/InlineQueryResultSerializer.kt new file mode 100644 index 0000000000..1ac85e94b6 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/serializers/InlineQueryResultSerializer.kt @@ -0,0 +1,39 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.serializers + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult +import kotlinx.serialization.* +import sun.reflect.generics.reflectiveObjects.NotImplementedException + +@Serializer(InlineQueryResult::class) +object InlineQueryResultSerializer : + KSerializer { + override fun serialize(output: Encoder, obj: InlineQueryResult) { + when(obj) { + is InlineQueryResultArticle -> InlineQueryResultArticle.serializer().serialize(output, obj) + is InlineQueryResultAudioCachedImpl -> InlineQueryResultAudioCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultAudioImpl -> InlineQueryResultAudioImpl.serializer().serialize(output, obj) + is InlineQueryResultContact -> InlineQueryResultContact.serializer().serialize(output, obj) + is InlineQueryResultDocumentCachedImpl -> InlineQueryResultDocumentCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultDocumentImpl -> InlineQueryResultDocumentImpl.serializer().serialize(output, obj) + is InlineQueryResultGame -> InlineQueryResultGame.serializer().serialize(output, obj) + is InlineQueryResultGifCachedImpl -> InlineQueryResultGifCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultGifImpl -> InlineQueryResultGifImpl.serializer().serialize(output, obj) + is InlineQueryResultLocation -> InlineQueryResultLocation.serializer().serialize(output, obj) + is InlineQueryResultMpeg4GifCachedImpl -> InlineQueryResultMpeg4GifCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultMpeg4GifImpl -> InlineQueryResultMpeg4GifImpl.serializer().serialize(output, obj) + is InlineQueryResultPhotoCachedImpl -> InlineQueryResultPhotoCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultPhotoImpl -> InlineQueryResultPhotoImpl.serializer().serialize(output, obj) + is InlineQueryResultStickerCached -> InlineQueryResultStickerCached.serializer().serialize(output, obj) + is InlineQueryResultVenue -> InlineQueryResultVenue.serializer().serialize(output, obj) + is InlineQueryResultVideoCachedImpl -> InlineQueryResultVideoCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultVideoImpl -> InlineQueryResultVideoImpl.serializer().serialize(output, obj) + is InlineQueryResultVoiceCachedImpl -> InlineQueryResultVoiceCachedImpl.serializer().serialize(output, obj) + is InlineQueryResultVoiceImpl -> InlineQueryResultVoiceImpl.serializer().serialize(output, obj) + } + } + + override fun deserialize(input: Decoder): InlineQueryResult { + throw NotImplementedException() + } +} \ No newline at end of file From ceabdd4492f137b74cbe33cf4e82b137552930b8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 19:36:03 +0800 Subject: [PATCH 19/27] one more fix for serialization of AnswerInlineQuery --- .../TelegramBotAPI/requests/answers/AnswerInlineQuery.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt index 126abf1cdc..63d406a697 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt @@ -3,13 +3,16 @@ 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 data class AnswerInlineQuery( @SerialName(inlineQueryIdField) val inlineQueryID: InlineQueryIdentifier, + @Serializable(InlineQueryAnswersResultsSerializer::class) @SerialName(resultsField) val results: List = emptyList(), @SerialName(cachedTimeField) @@ -48,3 +51,7 @@ fun InlineQuery.createAnswer( switchPmText, switchPmParameter ) + +object InlineQueryAnswersResultsSerializer: KSerializer> by ArrayListSerializer( + InlineQueryResultSerializer +) From 6f53e92b6901afca0ed35c1623e555a16e4d9a0c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 19:38:47 +0800 Subject: [PATCH 20/27] make AnswerInlineQuery serializable -.- --- .../TelegramBotAPI/requests/answers/AnswerInlineQuery.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt index 63d406a697..b4181e0f7e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt @@ -9,6 +9,7 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.ArrayListSerializer import kotlinx.serialization.internal.BooleanSerializer +@Serializable data class AnswerInlineQuery( @SerialName(inlineQueryIdField) val inlineQueryID: InlineQueryIdentifier, From a04f1515eacdfa218c1b5291d03d911a45da91b3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 19:50:08 +0800 Subject: [PATCH 21/27] fix type field in InlineQueryResult --- .../InlineQueryResult/InlineQueryResultAudioCachedImpl.kt | 7 ++++--- .../InlineQueryResult/InlineQueryResultAudioImpl.kt | 5 ++++- .../InlineQueryResultDocumentCachedImpl.kt | 7 ++++--- .../InlineQueryResult/InlineQueryResultDocumentImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultGifCachedImpl.kt | 7 ++++--- .../InlineQueryResult/InlineQueryResultGifImpl.kt | 5 ++++- .../InlineQueryResultMpeg4GifCachedImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultPhotoImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultVideoCachedImpl.kt | 7 ++++--- .../InlineQueryResult/InlineQueryResultVideoImpl.kt | 5 ++++- .../InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt | 7 ++++--- .../InlineQueryResult/InlineQueryResultVoiceImpl.kt | 5 ++++- .../results/audio/InlineQueryResultAudioCommon.kt | 6 ++---- .../results/document/InlineQueryResultDocumentCommon.kt | 6 ++---- .../abstracts/results/gif/InlineQueryResultGifCommon.kt | 6 ++---- .../results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt | 6 ++---- .../results/photo/InlineQueryResultPhotoCommon.kt | 6 ++---- .../results/video/InlineQueryResultVideoCommon.kt | 6 ++---- .../results/voice/InlineQueryResultVoiceCommon.kt | 6 ++---- 21 files changed, 70 insertions(+), 52 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt index 52e8931776..61886550b8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt @@ -5,8 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts. import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResultAudioCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.* import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField @@ -32,4 +31,6 @@ data class InlineQueryResultAudioCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultAudioCached +) : InlineQueryResultAudioCached { + override val type: String = inlineQueryResultAudioType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt index 692fc20304..45170521b8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField @@ -38,4 +39,6 @@ data class InlineQueryResultAudioImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultAudio +) : InlineQueryResultAudio { + override val type: String = inlineQueryResultAudioType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt index 78e5e3ae45..23636ab77a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt @@ -5,8 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts. import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResultDocumentCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.* import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField @@ -37,4 +36,6 @@ data class InlineQueryResultDocumentCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultDocumentCached +) : InlineQueryResultDocumentCached { + override val type: String = inlineQueryResultDocumentType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index 18cf268c9a..621631c69a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField @@ -46,4 +47,6 @@ data class InlineQueryResultDocumentImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultDocument +) : InlineQueryResultDocument { + override val type: String = inlineQueryResultDocumentType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt index a23f05c385..d4ba1bfb60 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt @@ -1,12 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -33,4 +32,6 @@ data class InlineQueryResultGifCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultGifCached +) : InlineQueryResultGifCached { + override val type: String = inlineQueryResultGifType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt index c58b84bf1d..78819542f7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts. import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.inlineQueryResultGifType import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -42,4 +43,6 @@ data class InlineQueryResultGifImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultGif +) : InlineQueryResultGif { + override val type: String = inlineQueryResultGifType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt index dd997a5207..7b55d6333f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt @@ -8,6 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa 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.mpeg4gif.InlineQueryResultMpeg4GifCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.inlineQueryResultMpeg4GifType import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -34,4 +35,6 @@ data class InlineQueryResultMpeg4GifCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultMpeg4GifCached +) : InlineQueryResultMpeg4GifCached { + override val type: String = inlineQueryResultMpeg4GifType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt index b851f550c3..aabf2b4792 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -42,4 +43,6 @@ data class InlineQueryResultMpeg4GifImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultMpeg4Gif +) : InlineQueryResultMpeg4Gif { + override val type: String = inlineQueryResultMpeg4GifType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt index 03c45825c9..63eb575864 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoCachedImpl.kt @@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue 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 @@ -33,4 +34,6 @@ data class InlineQueryResultPhotoCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultPhotoCached \ No newline at end of file +) : InlineQueryResultPhotoCached { + override val type: String = inlineQueryResultPhotoType +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt index cecc8bf11a..15ed0d5993 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt @@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue 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 @@ -40,4 +41,6 @@ data class InlineQueryResultPhotoImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultPhoto \ No newline at end of file +) : InlineQueryResultPhoto { + override val type: String = inlineQueryResultPhotoType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt index e245c0ee0e..ae350d2d56 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt @@ -5,8 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts. import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResultVideoCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional @@ -36,4 +35,6 @@ data class InlineQueryResultVideoCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultVideoCached +) : InlineQueryResultVideoCached { + override val type: String = inlineQueryResultVideoType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index 94c14f940f..1511b17aa8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.ParseMode.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField import kotlinx.serialization.Optional @@ -47,4 +48,6 @@ data class InlineQueryResultVideoImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultVideo +) : InlineQueryResultVideo { + override val type: String = inlineQueryResultVideoType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt index a4bd5d5d34..8a139c52f2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt @@ -5,8 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts. import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResultVoiceCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -32,4 +31,6 @@ data class InlineQueryResultVoiceCachedImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultVoiceCached +) : InlineQueryResultVoiceCached { + override val type: String = inlineQueryResultVoiceType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt index a733a0d0f6..168a98028c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt @@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.ParseMode.parseModeField import kotlinx.serialization.Optional import kotlinx.serialization.SerialName @@ -33,4 +34,6 @@ data class InlineQueryResultVoiceImpl( @SerialName(inputMessageContentField) @Optional override val inputMessageContent: InputMessageContent? = null -) : InlineQueryResultVoice +) : InlineQueryResultVoice { + override val type: String = inlineQueryResultVoiceType +} diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt index eaff7927a7..6ec5f8db33 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt @@ -4,10 +4,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultAudioType = "audio" + interface InlineQueryResultAudioCommon : InlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "audio" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt index 11694795e8..9591211aeb 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt @@ -4,12 +4,10 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultDocumentType = "document" + interface InlineQueryResultDocumentCommon : InlineQueryResult, TitledInlineQueryResult, DescribedInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "document" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt index 13c8ca3e6f..4ceb8e2766 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt @@ -3,11 +3,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultGifType = "gif" + interface InlineQueryResultGifCommon : InlineQueryResult, OptionallyTitledInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "gif" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt index 68f2073d6f..6b2611ba2a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt @@ -3,11 +3,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultMpeg4GifType = "mpeg4_gif" + interface InlineQueryResultMpeg4GifCommon : InlineQueryResult, OptionallyTitledInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "mpeg4_gif" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt index 601ac1cfac..f0d78f077a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt @@ -3,12 +3,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultPhotoType = "photo" + interface InlineQueryResultPhotoCommon : InlineQueryResult, OptionallyTitledInlineQueryResult, DescribedInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "photo" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt index 7f64bcae3b..802929836c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt @@ -4,12 +4,10 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultVideoType = "video" + interface InlineQueryResultVideoCommon : InlineQueryResult, TitledInlineQueryResult, DescribedInlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult -{ - override val type: String - get() = "video" -} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt index 3d946cd78f..570259b838 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt @@ -4,11 +4,9 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +const val inlineQueryResultVoiceType = "voice" + interface InlineQueryResultVoiceCommon : InlineQueryResult, Captioned, WithInputMessageContentInlineQueryResult, TitledInlineQueryResult -{ - override val type: String - get() = "voice" -} \ No newline at end of file From 983e5edf7b08777f87b276f68eca3a179357be55 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 20:19:25 +0800 Subject: [PATCH 22/27] inline messages edit result fixes --- CHANGELOG.md | 1 + .../edit/LiveLocation/EditChatMessageLiveLocation.kt | 1 - .../edit/LiveLocation/EditInlineMessageLiveLocation.kt | 3 +-- .../edit/LiveLocation/StopChatMessageLiveLocation.kt | 1 - .../edit/LiveLocation/StopInlineMessageLiveLocation.kt | 2 -- .../edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt | 2 -- .../requests/edit/abstracts/EditInlineMessage.kt | 5 ++++- .../requests/edit/abstracts/EditTextChatMessage.kt | 4 +--- .../requests/edit/caption/EditInlineMessageCaption.kt | 2 -- .../requests/edit/media/EditInlineMessageMedia.kt | 3 +-- .../requests/edit/text/EditInlineMessageText.kt | 2 -- 11 files changed, 8 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24bd4724a4..c9cc4f49bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * 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 ## 0.9.0 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt index 1fdbce0748..6e274db55f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt @@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* -// TODO:: Replace return type by RawMessage or Boolean (as in documentation) @Serializable data class EditChatMessageLiveLocation( @SerialName(chatIdField) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt index 83d032ba86..5ade3ffb97 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt @@ -5,8 +5,8 @@ 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.* +import kotlinx.serialization.internal.BooleanSerializer -// TODO:: Replace return type by RawMessage or Boolean (as in documentation) @Serializable data class EditInlineMessageLiveLocation( @SerialName(inlineMessageIdField) @@ -20,5 +20,4 @@ data class EditInlineMessageLiveLocation( override val replyMarkup: InlineKeyboardMarkup? = null ) : EditInlineMessage, EditReplyMessage, EditLocationMessage { override fun method(): String = "editMessageLiveLocation" - override fun resultSerializer(): KSerializer = RawMessage.serializer() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt index 16693cf6ce..aa9fae5b02 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt @@ -7,7 +7,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* -// TODO:: Replace return type by RawMessage or Boolean (as in documentation) @Serializable data class StopChatMessageLiveLocation( @SerialName(chatIdField) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt index ccbd01aa37..d696d0be2d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt @@ -7,7 +7,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* -// TODO:: Replace return type by RawMessage or Boolean (as in documentation) @Serializable data class StopInlineMessageLiveLocation( @SerialName(inlineMessageIdField) @@ -17,5 +16,4 @@ data class StopInlineMessageLiveLocation( override val replyMarkup: InlineKeyboardMarkup? = null ) : EditInlineMessage, EditReplyMessage { override fun method(): String = "stopMessageLiveLocation" - override fun resultSerializer(): KSerializer = RawMessage.serializer() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt index 38ad293c5f..6739d5cc6d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt @@ -15,7 +15,5 @@ data class EditInlineMessageReplyMarkup( @Optional override val replyMarkup: InlineKeyboardMarkup? = null ) : EditInlineMessage, EditReplyMessage { - override fun method(): String = editMessageReplyMarkupMethod - override fun resultSerializer(): KSerializer = RawMessage.serializer() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt index 5f57497583..7b9c44732b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt @@ -3,7 +3,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest 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 { +interface EditInlineMessage : SimpleRequest { val inlineMessageId: InlineMessageIdentifier + override fun resultSerializer(): KSerializer = BooleanSerializer } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditTextChatMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditTextChatMessage.kt index 9f87a729c1..028f5694a6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditTextChatMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditTextChatMessage.kt @@ -1,10 +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 -interface EditTextChatMessage : SimpleRequest { +interface EditTextChatMessage { val text: String val parseMode: ParseMode? } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt index d4a6a07030..5c021d7492 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt @@ -21,7 +21,5 @@ data class EditInlineMessageCaption( @Optional override val replyMarkup: InlineKeyboardMarkup? = null ) : EditInlineMessage, EditTextChatMessage, EditReplyMessage { - override fun method(): String = editMessageCaptionMethod - override fun resultSerializer(): KSerializer = RawMessage.serializer() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt index 828941bee8..c55e3f9dae 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt @@ -1,4 +1,4 @@ -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.edit.abstracts.* @@ -27,5 +27,4 @@ data class EditInlineMessageMedia( } override fun method(): String = editMessageMediaMethod - override fun resultSerializer(): KSerializer = RawMessage.serializer() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt index bb853c2704..a130e46c4a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt @@ -25,7 +25,5 @@ data class EditInlineMessageText( @Optional override val replyMarkup: InlineKeyboardMarkup? = null ) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage { - override fun method(): String = editMessageMediaMethod - override fun resultSerializer(): KSerializer = RawMessage.serializer() } From a6d0925cfde9f38214231c8d69e82d167d15077e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 20:25:04 +0800 Subject: [PATCH 23/27] optimize imports --- .../requests/chat/ExportChatInviteLink.kt | 2 +- .../TelegramBotAPI/requests/chat/LeaveChat.kt | 2 +- .../requests/chat/abstracts/ChatMemberRequest.kt | 2 +- .../TelegramBotAPI/requests/chat/get/GetChat.kt | 2 +- .../requests/chat/get/GetChatAdministrators.kt | 2 +- .../requests/chat/get/GetChatMembersCount.kt | 2 +- .../requests/chat/modify/DeleteChatPhoto.kt | 2 +- .../requests/chat/modify/PinChatMessage.kt | 2 +- .../requests/chat/modify/SetChatDescription.kt | 2 +- .../requests/chat/modify/SetChatPhoto.kt | 2 +- .../requests/chat/modify/SetChatTitle.kt | 2 +- .../requests/chat/modify/UnpinChatMessage.kt | 2 +- .../chat/stickers/DeleteChatStickerSet.kt | 2 +- .../requests/chat/stickers/SetChatStickerSet.kt | 2 +- .../LiveLocation/EditInlineMessageLiveLocation.kt | 2 -- .../LiveLocation/StopInlineMessageLiveLocation.kt | 1 - .../ReplyMarkup/EditInlineMessageReplyMarkup.kt | 1 - .../requests/edit/abstracts/EditInlineMessage.kt | 1 - .../edit/caption/EditInlineMessageCaption.kt | 1 - .../requests/edit/media/EditInlineMessageMedia.kt | 2 -- .../requests/edit/text/EditInlineMessageText.kt | 1 - .../send/abstracts/SendChatMessageRequest.kt | 2 +- .../InlineQueryResultAudioCachedImpl.kt | 13 +++++-------- .../InlineQueryResultAudioImpl.kt | 12 ++++-------- .../InlineQueryResult/InlineQueryResultContact.kt | 14 ++++---------- .../InlineQueryResultDocumentCachedImpl.kt | 13 +++++-------- .../InlineQueryResultDocumentImpl.kt | 11 ++++------- .../InlineQueryResultGifCachedImpl.kt | 11 +++++------ .../InlineQueryResult/InlineQueryResultGifImpl.kt | 10 ++++------ .../InlineQueryResultLocation.kt | 12 +++--------- .../InlineQueryResultMpeg4GifCachedImpl.kt | 12 ++++-------- .../InlineQueryResultMpeg4GifImpl.kt | 10 ++++------ .../InlineQueryResultStickerCached.kt | 12 +++--------- .../InlineQueryResult/InlineQueryResultVenue.kt | 15 +++++---------- .../InlineQueryResultVideoCachedImpl.kt | 12 +++++------- .../InlineQueryResultVideoImpl.kt | 10 ++++------ .../InlineQueryResultVoiceCachedImpl.kt | 11 +++++------ .../InlineQueryResultVoiceImpl.kt | 10 ++++------ .../abstracts/InlineQueryResult.kt | 2 +- .../results/audio/InlineQueryResultAudioCached.kt | 2 +- .../results/audio/InlineQueryResultAudioCommon.kt | 4 ++-- .../document/InlineQueryResultDocumentCached.kt | 2 +- .../document/InlineQueryResultDocumentCommon.kt | 1 - .../results/gif/InlineQueryResultGifCached.kt | 2 +- .../mpeg4gif/InlineQueryResultMpeg4GifCached.kt | 2 +- .../results/photo/InlineQueryResultPhotoCached.kt | 2 +- .../results/video/InlineQueryResultVideoCached.kt | 2 +- .../results/video/InlineQueryResultVideoCommon.kt | 1 - .../results/voice/InlineQueryResultVoice.kt | 4 ++-- .../results/voice/InlineQueryResultVoiceCached.kt | 2 +- .../results/voice/InlineQueryResultVoiceCommon.kt | 1 - .../InputLocationMessageContent.kt | 2 +- .../InputTextMessageContent.kt | 4 ++-- .../InputVenueMessageContent.kt | 3 ++- .../TelegramBotAPI/types/Response.kt | 2 -- .../TelegramBotAPI/utils/CaptionSourcer.kt | 1 - 56 files changed, 100 insertions(+), 166 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt index e595a5580b..722ed86f88 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt index 5b9e145d3e..f38465e7d7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt index 8d83987fa5..951323ec38 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/abstracts/ChatMemberRequest.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.UserId interface ChatMemberRequest : ChatRequest, SimpleRequest { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt index 4625b9dd9a..fdd9ce0bd6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt index b29d1c3d98..92f52b1e57 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.RawChatMember import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt index 9d28fc4021..643f138f82 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt index 2a43b04c72..92f927d9a7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt index 430af565cb..000b055562 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt @@ -1,8 +1,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt index 9c4b1ab62d..d48e24a90b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt index 7aa0d80c3e..78d766f62e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt @@ -1,8 +1,8 @@ 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.MultipartRequest -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt index f98f80b39b..79f2ce0ebb 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt index 18154fc892..3f362c72fc 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt index ef3c36ab43..c02109cda6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt index cfa6a469fe..4e0d4519fa 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt index 5ade3ffb97..652dac2282 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt @@ -3,9 +3,7 @@ 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 kotlinx.serialization.* -import kotlinx.serialization.internal.BooleanSerializer @Serializable data class EditInlineMessageLiveLocation( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt index d696d0be2d..04b24c45e7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt @@ -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.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt index 6739d5cc6d..854760446f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt @@ -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.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt index 7b9c44732b..9efd879fb6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/abstracts/EditInlineMessage.kt @@ -2,7 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.KSerializer import kotlinx.serialization.internal.BooleanSerializer diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt index 5c021d7492..72c4e2474a 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt @@ -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.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt index c55e3f9dae..c99f147e47 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt @@ -2,11 +2,9 @@ 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.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.* @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt index a130e46c4a..edc4647004 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt @@ -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.parseModeField import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.* @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt index 40760c976b..303ffc446c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/abstracts/SendChatMessageRequest.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts -import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest interface SendChatMessageRequest : SimpleRequest, ChatRequest \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt index 61886550b8..a010003078 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioCachedImpl.kt @@ -1,17 +1,14 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultAudioCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt index 45170521b8..bc87900ef0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultAudioImpl.kt @@ -1,17 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +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.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultAudioImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt index 58c59b06e1..2adf85af81 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt @@ -1,17 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultContact( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt index 23636ab77a..726d940ff6 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentCachedImpl.kt @@ -1,17 +1,14 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultDocumentCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index 621631c69a..182ad61929 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -1,17 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +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.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import kotlinx.serialization.* @Serializable data class InlineQueryResultDocumentImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt index d4ba1bfb60..c9ecb27da4 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifCachedImpl.kt @@ -1,15 +1,14 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultGifCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt index 78819542f7..b59ddb2593 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt @@ -1,15 +1,13 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.inlineQueryResultGifType import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultGifImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt index 4cd4cd855b..71f8bbbe11 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt @@ -2,17 +2,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Livable import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultLocation( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt index 7b55d6333f..956f1edcb7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt @@ -1,18 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.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 kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultMpeg4GifCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt index aabf2b4792..945afca6e2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -1,15 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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 kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultMpeg4GifImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt index 65b7e4186b..d8577d6be0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultStickerCached.kt @@ -1,17 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultStickerCached( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt index 5dcc21e06e..d5809da48f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt @@ -1,17 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +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.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultVenue( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt index ae350d2d56..60ad8cb164 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoCachedImpl.kt @@ -1,16 +1,14 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultVideoCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index 1511b17aa8..ca07faac35 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -1,16 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import kotlinx.serialization.* @Serializable data class InlineQueryResultVideoImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt index 8a139c52f2..9113a6cf3c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceCachedImpl.kt @@ -1,15 +1,14 @@ 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.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.* import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField -import kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultVoiceCachedImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt index 168a98028c..6871756798 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVoiceImpl.kt @@ -1,15 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode -import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup 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 kotlinx.serialization.Optional -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import kotlinx.serialization.* @Serializable data class InlineQueryResultVoiceImpl( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt index 3f8fa1640b..65204864ea 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt @@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQue import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.serializers.InlineQueryResultSerializer import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import kotlinx.serialization.* +import kotlinx.serialization.Serializable @Serializable(InlineQueryResultSerializer::class) interface InlineQueryResult { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt index 04b8b26fc2..d9865cec6c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultAudioCached : InlineQueryResultAudioCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt index 6ec5f8db33..16ab18ef6d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt @@ -1,8 +1,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.audio import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult const val inlineQueryResultAudioType = "audio" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt index 035fc567bc..d22ff9126e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultDocumentCached : InlineQueryResultDocumentCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt index 9591211aeb..a2d33c3a56 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.document import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* const val inlineQueryResultDocumentType = "document" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt index d1ffe0be6a..da2d5c7027 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultGifCached : InlineQueryResultGifCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt index 96023e0210..d11f688e75 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultMpeg4GifCached : InlineQueryResultMpeg4GifCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt index d2fff307ed..07a2a3dc49 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.photo -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultPhotoCached : InlineQueryResultPhotoCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt index 6232e95eab..35812b63a0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultVideoCached : InlineQueryResultVideoCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt index 802929836c..a4e29a8d61 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* const val inlineQueryResultVideoType = "video" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt index b400854bc7..9d1326dc4c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoice.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.DuratedInlineResultQuery +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult interface InlineQueryResultVoice : InlineQueryResultVoiceCommon, UrlInlineQueryResult, DuratedInlineResultQuery \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt index 9977b5f6b6..a64b3bac2e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCached.kt @@ -1,5 +1,5 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.WithFileIdInlineQueryResult interface InlineQueryResultVoiceCached : InlineQueryResultVoiceCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt index 570259b838..779da1e701 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* const val inlineQueryResultVoiceType = "voice" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt index 747d23d067..c6c1cd172b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputLocationMessageContent.kt @@ -1,8 +1,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Livable import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed +import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt index d8fc3af32f..a6b8012e64 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputTextMessageContent.kt @@ -1,10 +1,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview +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.CommonAbstracts.Captioned -import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent import com.github.insanusmokrassar.TelegramBotAPI.types.disableWebPagePreviewField import com.github.insanusmokrassar.TelegramBotAPI.types.messageTextField import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt index 9cc65db875..2c17cee68b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InputMessageContent/InputVenueMessageContent.kt @@ -1,6 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InputMessageContent -import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.* +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.abstracts.InputMessageContent import kotlinx.serialization.* diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Response.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Response.kt index a0089723fe..437c9faacc 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Response.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Response.kt @@ -1,8 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types import kotlinx.serialization.* -import org.joda.time.DateTime -import java.util.concurrent.TimeUnit @Deprecated( "Deprecated because incorrect name", diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt index 0024ae2bdd..ab354a2b0b 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt @@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.captionLength import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.TextContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.textLength -import com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.toMarkdown @Deprecated( "Deprecated because old version have problem with long texts, but new one must return list of strings" From 9f3d6785282b3ad3abfd18510e68cba31a49a8a3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 8 Feb 2019 14:35:41 +0800 Subject: [PATCH 24/27] fix mime_type of inline result document and video implementations --- .../InlineQueryResult/InlineQueryResultDocumentImpl.kt | 4 ++-- .../InlineQueryResult/InlineQueryResultVideoImpl.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index 182ad61929..f6a2dce048 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -18,6 +18,8 @@ data class InlineQueryResultDocumentImpl( override val url: String, @SerialName(titleField) override val title: String, + @SerialName(mimeTypeField) + override val mimeType: String, @SerialName(thumbUrlField) @Optional override val thumbUrl: String? = null, @@ -27,8 +29,6 @@ data class InlineQueryResultDocumentImpl( @SerialName(thumbHeightField) @Optional override val thumbHeight: Int? = null, - @SerialName(mimeTypeField) - override val mimeType: String? = null, @SerialName(descriptionField) @Optional override val description: String? = null, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index ca07faac35..df32e33267 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -19,7 +19,7 @@ data class InlineQueryResultVideoImpl( @SerialName(thumbUrlField) override val thumbUrl: String, @SerialName(mimeTypeField) - override val mimeType: String? = null, + override val mimeType: String, @SerialName(titleField) override val title: String, @SerialName(videoWidthField) From 1dc80f69298927fe2285f33065781739dc0d6e19 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 10 Feb 2019 13:41:20 +0800 Subject: [PATCH 25/27] replace of exceptions --- CHANGELOG.md | 1 + .../bot/Ktor/KtorRequestsExecutor.kt | 5 +++-- .../TelegramBotAPI/bot/RequestException.kt | 17 +++++++------- .../TelegramBotAPI/bot/RequestsExecutor.kt | 1 + .../bot/exceptions/ReplyMessageNotFound.kt | 6 +++++ .../bot/exceptions/RequestException.kt | 22 +++++++++++++++++++ .../utils/extensions/RequestsExecutor.kt | 2 +- 7 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/ReplyMessageNotFound.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index c9cc4f49bf..9e75892d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * 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 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt index a9c7e94aa1..8a25f9b59c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt @@ -3,7 +3,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor 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.bot.exceptions.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.RequestLimiter import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request @@ -75,7 +76,7 @@ class KtorRequestsExecutor( null } } ?: call.let { - throw RequestException( + throw newRequestException( responseObject, "Can't get result object" ) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt index f58666a347..58a8a1ef45 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt @@ -1,13 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot +import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException import com.github.insanusmokrassar.TelegramBotAPI.types.Response import java.io.IOException -class RequestException( - val response: Response<*>, - message: String? = null, - cause: Throwable? = null -) : IOException( - message, - cause -) \ No newline at end of file +@Deprecated( + "Replaced to another package", + ReplaceWith( + "RequestException", + "com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException" + ) +) +typealias RequestException = RequestException \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestsExecutor.kt index 467185130b..e2eacbb377 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestsExecutor.kt @@ -1,5 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot +import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request interface RequestsExecutor { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/ReplyMessageNotFound.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/ReplyMessageNotFound.kt new file mode 100644 index 0000000000..0208179047 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/ReplyMessageNotFound.kt @@ -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) \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt new file mode 100644 index 0000000000..1783631604 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt @@ -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 +) \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt index 4c3b8bf9f4..149db08c1c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestException +import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor import com.github.insanusmokrassar.TelegramBotAPI.requests.* import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request From d67d16c72d59fd3010982c695ac29f2ec41d18ee Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 10 Feb 2019 13:46:23 +0800 Subject: [PATCH 26/27] add ReplaceWith to old functions and replace built-in usages of deprecations --- .../types/message/content/TextContent.kt | 2 +- .../types/message/content/media/AudioContent.kt | 4 ++-- .../types/message/content/media/DocumentContent.kt | 4 ++-- .../types/message/content/media/PhotoContent.kt | 6 +++--- .../types/message/content/media/VideoContent.kt | 6 +++--- .../types/message/content/media/VoiceContent.kt | 4 ++-- .../TelegramBotAPI/utils/CaptionSourcer.kt | 12 ++++++++++-- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt index 005aece25d..370d79eeb5 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt @@ -23,7 +23,7 @@ data class TextContent( replyMarkup: KeyboardMarkup? ): Request = SendMessage( chatId, - toMarkdownText(), + toMarkdownTexts().first(), MarkdownParseMode, false, disableNotification, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt index e9aa329313..204a371a47 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt @@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent -import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption +import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions data class AudioContent( override val media: AudioFile, @@ -27,7 +27,7 @@ data class AudioContent( chatId, media.fileId, media.thumb ?.fileId, - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, media.duration, media.performer, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt index 1ceed1fa24..73e79fde97 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/DocumentContent.kt @@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.DocumentFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent -import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption +import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions data class DocumentContent( override val media: DocumentFile, @@ -27,7 +27,7 @@ data class DocumentContent( chatId, media.fileId, media.thumb ?.fileId, - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, disableNotification, replyToMessageId, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt index 3b62698857..3a15314fb5 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt @@ -13,7 +13,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize import com.github.insanusmokrassar.TelegramBotAPI.types.files.biggest import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption +import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions data class PhotoContent( override val media: List, @@ -28,7 +28,7 @@ data class PhotoContent( ): Request = SendPhoto( chatId, media.biggest() ?.fileId ?: throw IllegalStateException("Empty list of media"), - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, disableNotification, replyToMessageId, @@ -37,7 +37,7 @@ data class PhotoContent( override fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia = InputMediaPhoto( media.biggest() ?.fileId ?: throw IllegalStateException("Can't locate any photo size for this content"), - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode ) } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt index 3312be91f0..44db88818c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt @@ -12,7 +12,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption +import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions data class VideoContent( override val media: VideoFile, @@ -28,7 +28,7 @@ data class VideoContent( chatId, media.fileId, media.thumb ?.fileId, - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, media.duration, media.width, @@ -41,7 +41,7 @@ data class VideoContent( override fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia = InputMediaVideo( media.fileId, - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, media.width, media.height, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt index b61c4fc2cd..86f1fba9b7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt @@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.VoiceFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent -import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption +import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions data class VoiceContent( override val media: VoiceFile, @@ -27,7 +27,7 @@ data class VoiceContent( chatId, media.fileId, null, - toMarkdownCaption(), + toMarkdownCaptions().firstOrNull(), MarkdownParseMode, media.duration, disableNotification, diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt index ab354a2b0b..336496dcd2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionSourcer.kt @@ -55,7 +55,11 @@ fun createMarkdownText( } @Deprecated( - "Deprecated because old version have problem with long texts, but new one must return list of strings" + "Deprecated because old version have problem with long texts, but new one must return list of strings", + ReplaceWith( + "toMarkdownCaptions().firstOrNull()", + "com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions" + ) ) fun CaptionedMediaContent.toMarkdownCaption(): String? = toMarkdownCaptions().firstOrNull() @@ -69,7 +73,11 @@ fun CaptionedMediaContent.fullEntitiesList(): List = caption ?.le } ?: emptyList() @Deprecated( - "Deprecated because old version have problem with long texts, but new one must return list of strings" + "Deprecated because old version have problem with long texts, but new one must return list of strings", + ReplaceWith( + "toMarkdownTexts().first()", + "com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownTexts" + ) ) fun TextContent.toMarkdownText(): String = toMarkdownTexts().first() From 42bb036c413a7086eb826f1ef27eb6098c53d49e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 10 Feb 2019 13:47:58 +0800 Subject: [PATCH 27/27] optimize imports --- .../TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt | 1 - .../insanusmokrassar/TelegramBotAPI/bot/RequestException.kt | 2 -- .../TelegramBotAPI/types/message/content/TextContent.kt | 1 - .../TelegramBotAPI/utils/extensions/RequestsExecutor.kt | 2 +- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt index 8a25f9b59c..8b8eebf996 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt @@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor 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.exceptions.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.RequestLimiter diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt index 58a8a1ef45..a531196030 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt @@ -1,8 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException -import com.github.insanusmokrassar.TelegramBotAPI.types.Response -import java.io.IOException @Deprecated( "Replaced to another package", diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt index 370d79eeb5..b84bd17791 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/TextContent.kt @@ -9,7 +9,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.MarkdownParseM 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 import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownTexts data class TextContent( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt index 149db08c1c..1c621db8b0 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions -import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException import com.github.insanusmokrassar.TelegramBotAPI.requests.* import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request import com.github.insanusmokrassar.TelegramBotAPI.types.Response