From a8d71041458125cdb479d5bc43e7fc64e0c21038 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 15 Feb 2020 15:33:04 +0600 Subject: [PATCH] extract RequestsExecutor extensions --- TelegramBotAPI/CHANGELOG.md => CHANGELOG.md | 9 + TelegramBotAPI-extensions-api/build.gradle | 6 +- .../extensions/api/DeleteMessage.kt | 28 +++ .../extensions/api/ForwardMessage.kt | 50 ++++++ .../TelegramBotAPI/extensions/api/GetMe.kt | 6 + .../extensions/api/GetUpdates.kt | 27 +++ .../extensions/api/LiveLocation.kt | 80 +++++++++ .../TelegramBotAPI/extensions/api/StopPoll.kt | 34 ++++ .../api/answers/AnswerCallbackQuery.kt | 22 +++ .../api/answers/AnswerInlineQuery.kt | 29 +++ .../payments/AnswerPreCheckoutQuery.kt | 23 +++ .../answers/payments/AnswerShippingQuery.kt | 28 +++ .../api/chat/ExportChatInviteLink.kt | 14 ++ .../extensions/api/chat/LeaveChat.kt | 14 ++ .../extensions/api/chat/get/GetChat.kt | 14 ++ .../api/chat/get/GetChatAdministrators.kt | 14 ++ .../api/chat/get/GetChatMembersCount.kt | 14 ++ .../api/chat/members/GetChatMember.kt | 26 +++ .../api/chat/members/KickChatMember.kt | 30 ++++ .../api/chat/members/PromoteChatMember.kt | 112 ++++++++++++ .../api/chat/members/RestrictChatMember.kt | 36 ++++ .../SetChatAdministratorCustomTitle.kt | 30 ++++ .../api/chat/members/UnbanChatMember.kt | 27 +++ .../api/chat/modify/DeleteChatPhoto.kt | 14 ++ .../api/chat/modify/PinChatMessage.kt | 29 +++ .../api/chat/modify/SetChatDescription.kt | 16 ++ .../api/chat/modify/SetChatPermissions.kt | 17 ++ .../api/chat/modify/SetChatPhoto.kt | 17 ++ .../api/chat/modify/SetChatTitle.kt | 16 ++ .../api/chat/modify/UnpinChatMessage.kt | 14 ++ .../api/chat/stickers/DeleteChatStickerSet.kt | 14 ++ .../api/chat/stickers/SetChatStickerSet.kt | 17 ++ .../EditChatMessageLiveLocation.kt | 60 +++++++ .../EditInlineMessageLiveLocation.kt | 23 +++ .../StopChatMessageLiveLocation.kt | 31 ++++ .../StopInlineMessageLiveLocation.kt | 15 ++ .../ReplyMarkup/EditChatMessageReplyMarkup.kt | 29 +++ .../EditInlineMessageReplyMarkup.kt | 11 ++ .../edit/caption/EditChatMessageCaption.kt | 39 ++++ .../edit/caption/EditInlineMessageCaption.kt | 14 ++ .../api/edit/media/EditChatMessageMedia.kt | 33 ++++ .../api/edit/media/EditInlineMessageMedia.kt | 13 ++ .../api/edit/text/EditChatMessageText.kt | 39 ++++ .../api/edit/text/EditInlineMessageText.kt | 15 ++ .../api/games/GetGameHighScoresByChat.kt | 54 ++++++ .../GetGameHighScoresByInlineMessageId.kt | 19 ++ .../api/games/SetGameScoreByChatId.kt | 72 ++++++++ .../games/SetGameScoreByInlineMessageId.kt | 25 +++ .../extensions/api/get/GetFile.kt | 16 ++ .../extensions/api/get/GetStickerSet.kt | 17 ++ .../api/get/GetUserProfilePhotos.kt | 22 +++ .../extensions/api/send/SendAction.kt | 102 +++++++++++ .../extensions/api/send/SendContact.kt | 55 ++++++ .../extensions/api/send/SendLocation.kt | 71 ++++++++ .../extensions/api/send/SendMessage.kt | 54 ++++++ .../extensions/api/send/SendVenue.kt | 59 ++++++ .../extensions/api/send/games/SendGame.kt | 51 ++++++ .../api/send/media/SendAnimation.kt | 167 +++++++++++++++++ .../extensions/api/send/media/SendAudio.kt | 168 ++++++++++++++++++ .../extensions/api/send/media/SendDocument.kt | 139 +++++++++++++++ .../api/send/media/SendMediaGroup.kt | 28 +++ .../extensions/api/send/media/SendPhoto.kt | 136 ++++++++++++++ .../extensions/api/send/media/SendSticker.kt | 66 +++++++ .../extensions/api/send/media/SendVideo.kt | 135 ++++++++++++++ .../api/send/media/SendVideoNote.kt | 157 ++++++++++++++++ .../extensions/api/send/media/SendVoice.kt | 149 ++++++++++++++++ .../api/send/payments/SendInvoice.kt | 54 ++++++ .../extensions/api/send/polls/SendPoll.kt | 135 ++++++++++++++ .../api/stickers/AddStickerToSet.kt | 90 ++++++++++ .../api/stickers/CreateNewStickerSet.kt | 54 ++++++ .../api/stickers/DeleteStickerFromSet.kt | 20 +++ .../api/stickers/SetStickerPositionInSet.kt | 24 +++ .../api/stickers/UploadStickerFile.kt | 21 +++ .../extensions/api/webhook/DeleteWebhook.kt | 6 + .../extensions/api/webhook/GetWebhookInfo.kt | 6 + .../extensions/api/webhook/SetWebhook.kt | 28 +++ .../TelegramBotAPI/requests/DeleteMessage.kt | 3 + .../TelegramBotAPI/requests/ForwardMessage.kt | 6 + .../TelegramBotAPI/requests/GetMe.kt | 1 + .../TelegramBotAPI/requests/GetUpdates.kt | 2 + .../TelegramBotAPI/requests/LiveLocation.kt | 6 +- .../TelegramBotAPI/requests/StopPoll.kt | 4 + .../requests/answers/AnswerCallbackQuery.kt | 2 + .../requests/answers/AnswerInlineQuery.kt | 2 + .../payments/AnswerPreCheckoutQuery.kt | 4 + .../answers/payments/AnswerShippingQuery.kt | 4 + .../requests/chat/ExportChatInviteLink.kt | 2 + .../TelegramBotAPI/requests/chat/LeaveChat.kt | 2 + .../requests/chat/get/GetChat.kt | 2 + .../chat/get/GetChatAdministrators.kt | 2 + .../requests/chat/get/GetChatMembersCount.kt | 2 + .../requests/chat/members/GetChatMember.kt | 4 + .../requests/chat/members/KickChatMember.kt | 4 + .../chat/members/PromoteChatMember.kt | 4 + .../chat/members/RestrictChatMember.kt | 4 + .../SetChatAdministratorCustomTitle.kt | 4 + .../requests/chat/members/UnbanChatMember.kt | 4 + .../requests/chat/modify/DeleteChatPhoto.kt | 2 + .../requests/chat/modify/PinChatMessage.kt | 3 + .../chat/modify/SetChatDescription.kt | 2 + .../chat/modify/SetChatPermissions.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 + .../EditChatMessageLiveLocation.kt | 6 + .../EditInlineMessageLiveLocation.kt | 2 + .../StopChatMessageLiveLocation.kt | 3 + .../StopInlineMessageLiveLocation.kt | 1 + .../ReplyMarkup/EditChatMessageReplyMarkup.kt | 3 + .../EditInlineMessageReplyMarkup.kt | 1 + .../edit/caption/EditChatMessageCaption.kt | 3 + .../edit/caption/EditInlineMessageCaption.kt | 1 + .../edit/media/EditChatMessageMedia.kt | 3 + .../edit/media/EditInlineMessageMedia.kt | 1 + .../requests/edit/text/EditChatMessageText.kt | 3 + .../edit/text/EditInlineMessageText.kt | 1 + .../requests/games/GetGameHighScoresByChat.kt | 6 + .../GetGameHighScoresByInlineMessageId.kt | 2 + .../requests/games/SetGameScoreByChatId.kt | 6 + .../games/SetGameScoreByInlineMessageId.kt | 2 + .../TelegramBotAPI/requests/get/GetFile.kt | 2 + .../requests/get/GetStickerSet.kt | 2 + .../requests/get/GetUserProfilePhotos.kt | 2 + .../requests/send/SendAction.kt | 22 +++ .../requests/send/SendContact.kt | 4 + .../requests/send/SendLocation.kt | 4 + .../requests/send/SendMessage.kt | 4 + .../TelegramBotAPI/requests/send/SendVenue.kt | 4 + .../requests/send/games/SendGame.kt | 4 + .../requests/send/media/SendAnimation.kt | 7 + .../requests/send/media/SendAudio.kt | 7 + .../requests/send/media/SendDocument.kt | 7 + .../requests/send/media/SendMediaGroup.kt | 2 + .../requests/send/media/SendPhoto.kt | 6 + .../requests/send/media/SendSticker.kt | 6 + .../requests/send/media/SendVideo.kt | 7 + .../requests/send/media/SendVideoNote.kt | 7 + .../requests/send/media/SendVoice.kt | 7 + .../requests/send/payments/SendInvoice.kt | 2 + .../requests/send/polls/SendPoll.kt | 8 + .../requests/stickers/AddStickerToSet.kt | 8 + .../requests/stickers/CreateNewStickerSet.kt | 4 + .../requests/stickers/DeleteStickerFromSet.kt | 2 + .../stickers/SetStickerPositionInSet.kt | 2 + .../requests/stickers/UploadStickerFile.kt | 2 + .../requests/webhook/GetWebhookInfo.kt | 1 + .../requests/webhook/SetWebhook.kt | 2 + 149 files changed, 3611 insertions(+), 4 deletions(-) rename TelegramBotAPI/CHANGELOG.md => CHANGELOG.md (98%) create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/DeleteMessage.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/ForwardMessage.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetMe.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetUpdates.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/LiveLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/StopPoll.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerCallbackQuery.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerInlineQuery.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerShippingQuery.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/ExportChatInviteLink.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/LeaveChat.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChat.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatAdministrators.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatMembersCount.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/GetChatMember.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/KickChatMember.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/PromoteChatMember.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/RestrictChatMember.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/UnbanChatMember.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/DeleteChatPhoto.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/PinChatMessage.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatDescription.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPermissions.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPhoto.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatTitle.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/UnpinChatMessage.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/DeleteChatStickerSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/SetChatStickerSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditInlineMessageLiveLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopChatMessageLiveLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopInlineMessageLiveLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditChatMessageCaption.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditInlineMessageCaption.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditChatMessageMedia.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditInlineMessageMedia.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditChatMessageText.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditInlineMessageText.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByChat.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByInlineMessageId.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByChatId.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByInlineMessageId.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetFile.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetStickerSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetUserProfilePhotos.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendAction.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendContact.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendLocation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendMessage.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendVenue.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/games/SendGame.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAnimation.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAudio.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendDocument.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendMediaGroup.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendPhoto.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendSticker.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideo.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideoNote.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVoice.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/payments/SendInvoice.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/polls/SendPoll.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStickerToSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStickerSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/DeleteStickerFromSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerPositionInSet.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/UploadStickerFile.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/DeleteWebhook.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/GetWebhookInfo.kt create mode 100644 TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhook.kt diff --git a/TelegramBotAPI/CHANGELOG.md b/CHANGELOG.md similarity index 98% rename from TelegramBotAPI/CHANGELOG.md rename to CHANGELOG.md index e414b69f35..6ef811ca14 100644 --- a/TelegramBotAPI/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,15 @@ ### 0.23.3 +__API Extensions__ + +* For `SendPhoto` was added new functions for uploading of `MultipartFile` +* `deleteWebhook` extension for `RequestsExecutor` was added + +__Telegram Bot API__ + +* `LiveLocation` now have public constructor, but it is still not recommended to use directly + ## 0.22.0 * **`KtorCallFactory` must return `HttpStatement` instead of `HttpClientCall`** diff --git a/TelegramBotAPI-extensions-api/build.gradle b/TelegramBotAPI-extensions-api/build.gradle index df8c3f07bd..ee02105871 100644 --- a/TelegramBotAPI-extensions-api/build.gradle +++ b/TelegramBotAPI-extensions-api/build.gradle @@ -37,10 +37,10 @@ kotlin { commonMain { dependencies { implementation kotlin('stdlib') - if (project.hasProperty('DEV_MODE') && project.property('DEV_MODE') == "true") { - project (":TelegramBotAPI") - } else { + if (project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") { api "${project.group}:TelegramBotAPI:$library_version" + } else { + implementation project(":TelegramBotAPI") } } } diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/DeleteMessage.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/DeleteMessage.kt new file mode 100644 index 0000000000..70039acd22 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/DeleteMessage.kt @@ -0,0 +1,28 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.DeleteMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message + +suspend fun RequestsExecutor.deleteMessage( + chatId: ChatIdentifier, + messageId: MessageIdentifier +) = execute( + DeleteMessage(chatId, messageId) +) + +suspend fun RequestsExecutor.deleteMessage( + chat: Chat, + messageId: MessageIdentifier +) = deleteMessage(chat.id, messageId) + +suspend fun RequestsExecutor.deleteMessage( + message: Message +) = deleteMessage(message.chat, message.messageId) + +suspend fun Message.delete( + requestsExecutor: RequestsExecutor +) = requestsExecutor.deleteMessage(this) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/ForwardMessage.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/ForwardMessage.kt new file mode 100644 index 0000000000..ea73e06de3 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/ForwardMessage.kt @@ -0,0 +1,50 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.ForwardMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message + +suspend fun RequestsExecutor.forwardMessage( + fromChatId: ChatIdentifier, + toChatId: ChatIdentifier, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = execute( + ForwardMessage(fromChatId, toChatId, messageId, disableNotification) +) + +suspend fun RequestsExecutor.forwardMessage( + fromChat: Chat, + toChatId: ChatIdentifier, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification) + +suspend fun RequestsExecutor.forwardMessage( + fromChatId: ChatIdentifier, + toChat: Chat, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification) + +suspend fun RequestsExecutor.forwardMessage( + fromChat: Chat, + toChat: Chat, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification) + +suspend fun RequestsExecutor.forwardMessage( + toChatId: ChatIdentifier, + message: Message, + disableNotification: Boolean = false +) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification) + +suspend fun RequestsExecutor.forwardMessage( + toChat: Chat, + message: Message, + disableNotification: Boolean = false +) = forwardMessage(message.chat, toChat, message.messageId, disableNotification) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetMe.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetMe.kt new file mode 100644 index 0000000000..d0a48bdbf4 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetMe.kt @@ -0,0 +1,6 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.GetMe + +suspend fun RequestsExecutor.getMe() = execute(GetMe()) \ No newline at end of file diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetUpdates.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetUpdates.kt new file mode 100644 index 0000000000..7d9edc0b54 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/GetUpdates.kt @@ -0,0 +1,27 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.GetUpdates +import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST +import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update + +suspend fun RequestsExecutor.getUpdates( + offset: UpdateIdentifier? = null, + limit: Int? = null, + timeout: Int? = null, + allowed_updates: List? = ALL_UPDATES_LIST +) = execute( + GetUpdates( + offset, limit, timeout, allowed_updates + ) +) + +suspend fun RequestsExecutor.getUpdates( + lastUpdate: Update, + limit: Int? = null, + timeout: Int? = null, + allowed_updates: List? = ALL_UPDATES_LIST +) = getUpdates( + lastUpdate.updateId + 1, limit, timeout, allowed_updates +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/LiveLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/LiveLocation.kt new file mode 100644 index 0000000000..0fc869784c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/LiveLocation.kt @@ -0,0 +1,80 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.LiveLocation +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import kotlinx.coroutines.CoroutineScope +import kotlin.math.ceil + +private val livePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L + +suspend fun RequestsExecutor.startLiveLocation( + scope: CoroutineScope, + chatId: ChatIdentifier, + latitude: Double, + longitude: Double, + liveTimeMillis: Long = livePeriodDelayMillis, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +): LiveLocation { + val liveTimeAsDouble = liveTimeMillis.toDouble() + val locationMessage = execute( + SendLocation( + chatId, + latitude, + longitude, + ceil(liveTimeAsDouble / 1000).toLong(), + disableNotification, + replyToMessageId, + replyMarkup + ) + ) + + return LiveLocation( + this, + scope, + liveTimeAsDouble, + locationMessage + ) +} + +suspend fun RequestsExecutor.startLiveLocation( + scope: CoroutineScope, + chat: Chat, + latitude: Double, + longitude: Double, + liveTimeMillis: Long = livePeriodDelayMillis, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +): LiveLocation = startLiveLocation( + scope, chat.id, latitude, longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.startLiveLocation( + scope: CoroutineScope, + chatId: ChatId, + location: Location, + liveTimeMillis: Long = livePeriodDelayMillis, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +): LiveLocation = startLiveLocation( + scope, chatId, location.latitude, location.longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.startLiveLocation( + scope: CoroutineScope, + chat: Chat, + location: Location, + liveTimeMillis: Long = livePeriodDelayMillis, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +): LiveLocation = startLiveLocation( + scope, chat.id, location.latitude, location.longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/StopPoll.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/StopPoll.kt new file mode 100644 index 0000000000..668f716b38 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/StopPoll.kt @@ -0,0 +1,34 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.StopPoll +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message + +suspend fun RequestsExecutor.stopPoll( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + StopPoll(chatId, messageId, replyMarkup) +) + +suspend fun RequestsExecutor.stopPoll( + chat: Chat, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = stopPoll(chat.id, messageId, replyMarkup) + +suspend fun RequestsExecutor.stopPoll( + chatId: ChatId, + message: Message, + replyMarkup: InlineKeyboardMarkup? = null +) = stopPoll(chatId, message.messageId, replyMarkup) + +suspend fun RequestsExecutor.stopPoll( + chat: Chat, + message: Message, + replyMarkup: InlineKeyboardMarkup? = null +) = stopPoll(chat.id, message.messageId, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerCallbackQuery.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerCallbackQuery.kt new file mode 100644 index 0000000000..c3bc33741a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerCallbackQuery.kt @@ -0,0 +1,22 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.AnswerCallbackQuery +import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery.CallbackQuery +import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQueryIdentifier + +suspend fun RequestsExecutor.answerCallbackQuery( + callbackQueryId: CallbackQueryIdentifier, + text: String? = null, + showAlert: Boolean? = null, + url: String? = null, + cachedTimeSeconds: Int? = null +) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds)) + +suspend fun RequestsExecutor.answerCallbackQuery( + callbackQuery: CallbackQuery, + text: String? = null, + showAlert: Boolean? = null, + url: String? = null, + cachedTimeSeconds: Int? = null +) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerInlineQuery.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerInlineQuery.kt new file mode 100644 index 0000000000..7cc553212c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/AnswerInlineQuery.kt @@ -0,0 +1,29 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.AnswerInlineQuery +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InlineQuery +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueryIdentifier + +suspend fun RequestsExecutor.answerInlineQuery( + inlineQueryID: InlineQueryIdentifier, + results: List = emptyList(), + cachedTime: Int? = null, + isPersonal: Boolean? = null, + nextOffset: String? = null, + switchPmText: String? = null, + switchPmParameter: String? = null +) = execute( + AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) +) + +suspend fun RequestsExecutor.answerInlineQuery( + inlineQuery: InlineQuery, + results: List = emptyList(), + cachedTime: Int? = null, + isPersonal: Boolean? = null, + nextOffset: String? = null, + switchPmText: String? = null, + switchPmParameter: String? = null +) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt new file mode 100644 index 0000000000..0bdf7e3c30 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt @@ -0,0 +1,23 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers.payments + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.payments.AnswerPreCheckoutQueryError +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.payments.AnswerPreCheckoutQueryOk +import com.github.insanusmokrassar.TelegramBotAPI.types.PreCheckoutQueryId +import com.github.insanusmokrassar.TelegramBotAPI.types.payments.PreCheckoutQuery + +suspend fun RequestsExecutor.answerPreCheckoutQueryOk( + id: PreCheckoutQueryId +) = execute(AnswerPreCheckoutQueryOk(id)) +suspend fun RequestsExecutor.answerPreCheckoutQueryOk( + preCheckoutQuery: PreCheckoutQuery +) = answerPreCheckoutQueryOk(preCheckoutQuery.id) + +suspend fun RequestsExecutor.answerPreCheckoutQueryError( + id: PreCheckoutQueryId, + error: String +) = execute(AnswerPreCheckoutQueryError(id, error)) +suspend fun RequestsExecutor.answerPreCheckoutQueryError( + preCheckoutQuery: PreCheckoutQuery, + error: String +) = answerPreCheckoutQueryError(preCheckoutQuery.id, error) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerShippingQuery.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerShippingQuery.kt new file mode 100644 index 0000000000..c154230a59 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/answers/payments/AnswerShippingQuery.kt @@ -0,0 +1,28 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers.payments + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.payments.AnswerShippingQueryError +import com.github.insanusmokrassar.TelegramBotAPI.requests.answers.payments.AnswerShippingQueryOk +import com.github.insanusmokrassar.TelegramBotAPI.types.ShippingQueryIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingOption +import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery + +suspend fun RequestsExecutor.answerShippingQueryOk( + id: ShippingQueryIdentifier, + shippingOptions: List +) = execute(AnswerShippingQueryOk(id, shippingOptions)) +suspend fun RequestsExecutor.answerShippingQueryOk( + shippingQuery: ShippingQuery, + shippingOptions: List +) = answerShippingQueryOk(shippingQuery.id, shippingOptions) + +suspend fun RequestsExecutor.answerShippingQueryError( + id: ShippingQueryIdentifier, + error: String +) = execute(AnswerShippingQueryError(id, error)) +suspend fun RequestsExecutor.answerShippingQueryError( + shippingQuery: ShippingQuery, + error: String +) = answerShippingQueryError(shippingQuery.id, error) + + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/ExportChatInviteLink.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/ExportChatInviteLink.kt new file mode 100644 index 0000000000..a3051466f1 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/ExportChatInviteLink.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.ExportChatInviteLink +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.exportChatInviteLink( + chatId: ChatIdentifier +) = execute(ExportChatInviteLink(chatId)) + +suspend fun RequestsExecutor.exportChatInviteLink( + chat: PublicChat +) = exportChatInviteLink(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/LeaveChat.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/LeaveChat.kt new file mode 100644 index 0000000000..2523ad5034 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/LeaveChat.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.LeaveChat +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.leaveChat( + chatId: ChatIdentifier +) = execute(LeaveChat(chatId)) + +suspend fun RequestsExecutor.leaveChat( + chat: PublicChat +) = leaveChat(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChat.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChat.kt new file mode 100644 index 0000000000..e7912097da --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChat.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChat +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.getChat( + chatId: ChatIdentifier +) = execute(GetChat(chatId)) + +suspend fun RequestsExecutor.getChat( + chat: Chat +) = getChat(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatAdministrators.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatAdministrators.kt new file mode 100644 index 0000000000..35b7197060 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatAdministrators.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChatAdministrators +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.getChatAdministrators( + chatId: ChatIdentifier +) = execute(GetChatAdministrators(chatId)) + +suspend fun RequestsExecutor.getChatAdministrators( + chat: PublicChat +) = getChatAdministrators(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatMembersCount.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatMembersCount.kt new file mode 100644 index 0000000000..3c93f12c84 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/get/GetChatMembersCount.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChatMembersCount +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.getChatMembersCount( + chatId: ChatIdentifier +) = execute(GetChatMembersCount(chatId)) + +suspend fun RequestsExecutor.getChatMembersCount( + chat: PublicChat +) = getChatMembersCount(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/GetChatMember.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/GetChatMember.kt new file mode 100644 index 0000000000..0297d92d9c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/GetChatMember.kt @@ -0,0 +1,26 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.GetChatMember +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.getChatMember( + chatId: ChatIdentifier, + userId: UserId +) = execute(GetChatMember(chatId, userId)) + +suspend fun RequestsExecutor.getChatMember( + chat: PublicChat, + userId: UserId +) = getChatMember(chat.id, userId) + +suspend fun RequestsExecutor.getChatMember( + chatId: ChatId, + user: User +) = getChatMember(chatId, user.id) + +suspend fun RequestsExecutor.getChatMember( + chat: PublicChat, + user: User +) = getChatMember(chat.id, user.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/KickChatMember.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/KickChatMember.kt new file mode 100644 index 0000000000..1f0aa9c32e --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/KickChatMember.kt @@ -0,0 +1,30 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.KickChatMember +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.kickChatMember( + chatId: ChatIdentifier, + userId: UserId, + untilDate: TelegramDate? = null +) = execute(KickChatMember(chatId, userId, untilDate)) + +suspend fun RequestsExecutor.kickChatMember( + chat: PublicChat, + userId: UserId, + untilDate: TelegramDate? = null +) = kickChatMember(chat.id, userId, untilDate) + +suspend fun RequestsExecutor.kickChatMember( + chatId: ChatId, + user: User, + untilDate: TelegramDate? = null +) = kickChatMember(chatId, user.id, untilDate) + +suspend fun RequestsExecutor.kickChatMember( + chat: PublicChat, + user: User, + untilDate: TelegramDate? = null +) = kickChatMember(chat.id, user.id, untilDate) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/PromoteChatMember.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/PromoteChatMember.kt new file mode 100644 index 0000000000..24c1205670 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/PromoteChatMember.kt @@ -0,0 +1,112 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.PromoteChatMember +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.promoteChatMember( + chatId: ChatIdentifier, + userId: UserId, + untilDate: TelegramDate? = null, + canChangeInfo: Boolean? = null, + canPostMessages: Boolean? = null, + canEditMessages: Boolean? = null, + canDeleteMessages: Boolean? = null, + canInviteUsers: Boolean? = null, + canRestrictMembers: Boolean? = null, + canPinMessages: Boolean? = null, + canPromoteMembers: Boolean? = null +) = execute( + PromoteChatMember( + chatId, + userId, + untilDate, + canChangeInfo, + canPostMessages, + canEditMessages, + canDeleteMessages, + canInviteUsers, + canRestrictMembers, + canPinMessages, + canPromoteMembers + ) +) + +suspend fun RequestsExecutor.promoteChatMember( + chat: PublicChat, + userId: UserId, + untilDate: TelegramDate? = null, + canChangeInfo: Boolean? = null, + canPostMessages: Boolean? = null, + canEditMessages: Boolean? = null, + canDeleteMessages: Boolean? = null, + canInviteUsers: Boolean? = null, + canRestrictMembers: Boolean? = null, + canPinMessages: Boolean? = null, + canPromoteMembers: Boolean? = null +) = promoteChatMember( + chat.id, + userId, + untilDate, + canChangeInfo, + canPostMessages, + canEditMessages, + canDeleteMessages, + canInviteUsers, + canRestrictMembers, + canPinMessages, + canPromoteMembers +) + +suspend fun RequestsExecutor.promoteChatMember( + chatId: ChatId, + user: User, + untilDate: TelegramDate? = null, + canChangeInfo: Boolean? = null, + canPostMessages: Boolean? = null, + canEditMessages: Boolean? = null, + canDeleteMessages: Boolean? = null, + canInviteUsers: Boolean? = null, + canRestrictMembers: Boolean? = null, + canPinMessages: Boolean? = null, + canPromoteMembers: Boolean? = null +) = promoteChatMember( + chatId, + user.id, + untilDate, + canChangeInfo, + canPostMessages, + canEditMessages, + canDeleteMessages, + canInviteUsers, + canRestrictMembers, + canPinMessages, + canPromoteMembers +) + +suspend fun RequestsExecutor.promoteChatMember( + chat: PublicChat, + user: User, + untilDate: TelegramDate? = null, + canChangeInfo: Boolean? = null, + canPostMessages: Boolean? = null, + canEditMessages: Boolean? = null, + canDeleteMessages: Boolean? = null, + canInviteUsers: Boolean? = null, + canRestrictMembers: Boolean? = null, + canPinMessages: Boolean? = null, + canPromoteMembers: Boolean? = null +) = promoteChatMember( + chat.id, + user.id, + untilDate, + canChangeInfo, + canPostMessages, + canEditMessages, + canDeleteMessages, + canInviteUsers, + canRestrictMembers, + canPinMessages, + canPromoteMembers +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/RestrictChatMember.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/RestrictChatMember.kt new file mode 100644 index 0000000000..6360aec348 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/RestrictChatMember.kt @@ -0,0 +1,36 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.RestrictChatMember +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.restrictChatMember( + chatId: ChatIdentifier, + userId: UserId, + untilDate: TelegramDate? = null, + permissions: ChatPermissions = ChatPermissions() +) = execute(RestrictChatMember(chatId, userId, untilDate, permissions)) + +suspend fun RequestsExecutor.restrictChatMember( + chat: PublicChat, + userId: UserId, + untilDate: TelegramDate? = null, + permissions: ChatPermissions = ChatPermissions() +) = restrictChatMember(chat.id, userId, untilDate, permissions) + +suspend fun RequestsExecutor.restrictChatMember( + chatId: ChatId, + user: User, + untilDate: TelegramDate? = null, + permissions: ChatPermissions = ChatPermissions() +) = restrictChatMember(chatId, user.id, untilDate, permissions) + +suspend fun RequestsExecutor.restrictChatMember( + chat: PublicChat, + user: User, + untilDate: TelegramDate? = null, + permissions: ChatPermissions = ChatPermissions() +) = restrictChatMember(chat.id, user.id, untilDate, permissions) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt new file mode 100644 index 0000000000..2f545eeae7 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt @@ -0,0 +1,30 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.SetChatAdministratorCustomTitle +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.setChatAdministratorCustomTitle( + chatId: ChatId, + userId: UserId, + customTitle: String +) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) + +suspend fun RequestsExecutor.setChatAdministratorCustomTitle( + chat: PublicChat, + userId: UserId, + customTitle: String +) = setChatAdministratorCustomTitle(chat.id, userId, customTitle) + +suspend fun RequestsExecutor.setChatAdministratorCustomTitle( + chatId: ChatId, + user: User, + customTitle: String +) = setChatAdministratorCustomTitle(chatId, user.id, customTitle) + +suspend fun RequestsExecutor.setChatAdministratorCustomTitle( + chat: PublicChat, + user: User, + customTitle: String +) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle) \ No newline at end of file diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/UnbanChatMember.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/UnbanChatMember.kt new file mode 100644 index 0000000000..35c1f26f25 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/members/UnbanChatMember.kt @@ -0,0 +1,27 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.members.UnbanChatMember +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.unbanChatMember( + chatId: ChatIdentifier, + userId: UserId +) = execute(UnbanChatMember(chatId, userId)) + +suspend fun RequestsExecutor.unbanChatMember( + chat: PublicChat, + userId: UserId +) = unbanChatMember(chat.id, userId) + +suspend fun RequestsExecutor.unbanChatMember( + chatId: ChatId, + user: User +) = unbanChatMember(chatId, user.id) + +suspend fun RequestsExecutor.unbanChatMember( + chat: PublicChat, + user: User +) = unbanChatMember(chat.id, user.id) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/DeleteChatPhoto.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/DeleteChatPhoto.kt new file mode 100644 index 0000000000..919f91b3fb --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/DeleteChatPhoto.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.DeleteChatPhoto +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.deleteChatPhoto( + chatId: ChatIdentifier +) = execute(DeleteChatPhoto(chatId)) + +suspend fun RequestsExecutor.deleteChatPhoto( + chat: PublicChat +) = deleteChatPhoto(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/PinChatMessage.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/PinChatMessage.kt new file mode 100644 index 0000000000..d678a95c1d --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/PinChatMessage.kt @@ -0,0 +1,29 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.PinChatMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message + +suspend fun RequestsExecutor.pinChatMessage( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = execute(PinChatMessage(chatId, messageId, disableNotification)) + +suspend fun RequestsExecutor.pinChatMessage( + chat: PublicChat, + messageId: MessageIdentifier, + disableNotification: Boolean = false +) = pinChatMessage(chat.id, messageId, disableNotification) + +suspend fun RequestsExecutor.pinChatMessage( + message: Message, + disableNotification: Boolean = false +) = if (message.chat is PublicChat) { + pinChatMessage(message.chat.id, message.messageId, disableNotification) +} else { + error("It is possible to pin messages only in non one-to-one chats") +} diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatDescription.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatDescription.kt new file mode 100644 index 0000000000..c20234ceed --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatDescription.kt @@ -0,0 +1,16 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.SetChatDescription +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.setChatDescription( + chatId: ChatIdentifier, + description: String +) = execute(SetChatDescription(chatId, description)) + +suspend fun RequestsExecutor.setChatDescription( + chat: PublicChat, + description: String +) = setChatDescription(chat.id, description) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPermissions.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPermissions.kt new file mode 100644 index 0000000000..b10f4bf27d --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPermissions.kt @@ -0,0 +1,17 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.SetChatPermissions +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.setDefaultChatMembersPermissions( + chatId: ChatIdentifier, + permissions: ChatPermissions +) = execute(SetChatPermissions(chatId, permissions)) + +suspend fun RequestsExecutor.setDefaultChatMembersPermissions( + chat: PublicChat, + permissions: ChatPermissions +) = setDefaultChatMembersPermissions(chat.id, permissions) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPhoto.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPhoto.kt new file mode 100644 index 0000000000..19f3ab0683 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatPhoto.kt @@ -0,0 +1,17 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.SetChatPhoto +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.setChatPhoto( + chatId: ChatIdentifier, + photo: MultipartFile +) = execute(SetChatPhoto(chatId, photo)) + +suspend fun RequestsExecutor.setChatPhoto( + chat: PublicChat, + photo: MultipartFile +) = setChatPhoto(chat.id, photo) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatTitle.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatTitle.kt new file mode 100644 index 0000000000..130495aeaf --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/SetChatTitle.kt @@ -0,0 +1,16 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.SetChatTitle +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.setChatTitle( + chatId: ChatIdentifier, + title: String +) = execute(SetChatTitle(chatId, title)) + +suspend fun RequestsExecutor.setChatTitle( + chat: PublicChat, + title: String +) = setChatTitle(chat.id, title) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/UnpinChatMessage.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/UnpinChatMessage.kt new file mode 100644 index 0000000000..dc542e9a21 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/modify/UnpinChatMessage.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.UnpinChatMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat + +suspend fun RequestsExecutor.unpinChatMessage( + chatId: ChatIdentifier +) = execute(UnpinChatMessage(chatId)) + +suspend fun RequestsExecutor.unpinChatMessage( + chat: PublicChat +) = unpinChatMessage(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/DeleteChatStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/DeleteChatStickerSet.kt new file mode 100644 index 0000000000..6fd6969b51 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/DeleteChatStickerSet.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers.DeleteChatStickerSet +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat + +suspend fun RequestsExecutor.deleteChatStickerSet( + chatId: ChatIdentifier +) = execute(DeleteChatStickerSet(chatId)) + +suspend fun RequestsExecutor.deleteChatStickerSet( + chat: SupergroupChat +) = deleteChatStickerSet(chat.id) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/SetChatStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/SetChatStickerSet.kt new file mode 100644 index 0000000000..c1ca61482f --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/chat/stickers/SetChatStickerSet.kt @@ -0,0 +1,17 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.stickers.SetChatStickerSet +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.StickerSetName +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat + +suspend fun RequestsExecutor.setChatStickerSet( + chatId: ChatIdentifier, + stickerSetName: StickerSetName +) = execute(SetChatStickerSet(chatId, stickerSetName)) + +suspend fun RequestsExecutor.setChatStickerSet( + chat: SupergroupChat, + stickerSetName: StickerSetName +) = setChatStickerSet(chat.id, stickerSetName) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt new file mode 100644 index 0000000000..72ea23b52a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditChatMessageLiveLocation.kt @@ -0,0 +1,60 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditChatMessageLiveLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.LocationContent + +suspend fun RequestsExecutor.editLiveLocation( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + latitude: Double, + longitude: Double, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageLiveLocation( + chatId, messageId, latitude, longitude, replyMarkup + ) +) + +suspend fun RequestsExecutor.editLiveLocation( + chat: Chat, + messageId: MessageIdentifier, + latitude: Double, + longitude: Double, + replyMarkup: InlineKeyboardMarkup? = null +) = editLiveLocation(chat.id, messageId, latitude, longitude, replyMarkup) + +suspend fun RequestsExecutor.editLiveLocation( + message: ContentMessage, + latitude: Double, + longitude: Double, + replyMarkup: InlineKeyboardMarkup? = null +) = editLiveLocation(message.chat, message.messageId, latitude, longitude, replyMarkup) + +suspend fun RequestsExecutor.editLiveLocation( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + location: Location, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageLiveLocation( + chatId, messageId, location.latitude, location.longitude, replyMarkup + ) +) + +suspend fun RequestsExecutor.editLiveLocation( + chat: Chat, + messageId: MessageIdentifier, + location: Location, + replyMarkup: InlineKeyboardMarkup? = null +) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, replyMarkup) + +suspend fun RequestsExecutor.editLiveLocation( + message: ContentMessage, + location: Location, + replyMarkup: InlineKeyboardMarkup? = null +) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditInlineMessageLiveLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditInlineMessageLiveLocation.kt new file mode 100644 index 0000000000..c48fe51212 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/EditInlineMessageLiveLocation.kt @@ -0,0 +1,23 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditInlineMessageLiveLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.Location +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.editLiveLocation( + inlineMessageId: InlineMessageIdentifier, + latitude: Double, + longitude: Double, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditInlineMessageLiveLocation( + inlineMessageId, latitude, longitude, replyMarkup + ) +) +suspend fun RequestsExecutor.editLiveLocation( + inlineMessageId: InlineMessageIdentifier, + location: Location, + replyMarkup: InlineKeyboardMarkup? = null +) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopChatMessageLiveLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopChatMessageLiveLocation.kt new file mode 100644 index 0000000000..0835dd90e1 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopChatMessageLiveLocation.kt @@ -0,0 +1,31 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.StopChatMessageLiveLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.LocationContent + +suspend fun RequestsExecutor.stopLiveLocation( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + StopChatMessageLiveLocation( + chatId, messageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.stopLiveLocation( + chat: Chat, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = stopLiveLocation(chat.id, messageId, replyMarkup) + +suspend fun RequestsExecutor.stopLiveLocation( + message: ContentMessage, + replyMarkup: InlineKeyboardMarkup? = null +) = stopLiveLocation(message.chat, message.messageId, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopInlineMessageLiveLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopInlineMessageLiveLocation.kt new file mode 100644 index 0000000000..b1a25409ed --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/LiveLocation/StopInlineMessageLiveLocation.kt @@ -0,0 +1,15 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.StopInlineMessageLiveLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.stopLiveLocation( + inlineMessageId: InlineMessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + StopInlineMessageLiveLocation( + inlineMessageId, replyMarkup + ) +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt new file mode 100644 index 0000000000..d02884f5b1 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt @@ -0,0 +1,29 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.ReplyMarkup + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup.EditChatMessageReplyMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message + +suspend fun RequestsExecutor.editMessageReplyMarkup( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageReplyMarkup(chatId, messageId, replyMarkup) +) + +suspend fun RequestsExecutor.editMessageReplyMarkup( + chat: Chat, + messageId: MessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageReplyMarkup(chat.id, messageId, replyMarkup) + +suspend fun RequestsExecutor.editMessageReplyMarkup( + message: Message, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt new file mode 100644 index 0000000000..66f7df4730 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt @@ -0,0 +1,11 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.ReplyMarkup + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup.EditInlineMessageReplyMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.editMessageReplyMarkup( + inlineMessageId: InlineMessageIdentifier, + replyMarkup: InlineKeyboardMarkup? = null +) = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup)) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditChatMessageCaption.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditChatMessageCaption.kt new file mode 100644 index 0000000000..e448ad2324 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditChatMessageCaption.kt @@ -0,0 +1,39 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.caption + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedInput +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption.EditChatMessageCaption +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent + +suspend fun RequestsExecutor.editMessageCaption( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + text: String, + parseMode: ParseMode? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup) +) + +suspend fun RequestsExecutor.editMessageCaption( + chat: Chat, + messageId: MessageIdentifier, + text: String, + parseMode: ParseMode? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup) + +suspend fun RequestsExecutor.editMessageCaption( + message: ContentMessage, + text: String, + parseMode: ParseMode? = null, + replyMarkup: InlineKeyboardMarkup? = null +): ContentMessage where T : CaptionedInput, T : MediaContent { + return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) +} diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditInlineMessageCaption.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditInlineMessageCaption.kt new file mode 100644 index 0000000000..a561699e6e --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/caption/EditInlineMessageCaption.kt @@ -0,0 +1,14 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.caption + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption.EditInlineMessageCaption +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.editMessageCaption( + inlineMessageId: InlineMessageIdentifier, + text: String, + parseMode: ParseMode? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup)) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditChatMessageMedia.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditChatMessageMedia.kt new file mode 100644 index 0000000000..5406985cbf --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditChatMessageMedia.kt @@ -0,0 +1,33 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.EditChatMessageMedia +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent + +suspend fun RequestsExecutor.editMessageMedia( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + media: InputMedia, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageMedia(chatId, messageId, media, replyMarkup) +) + +suspend fun RequestsExecutor.editMessageMedia( + chat: Chat, + messageId: MessageIdentifier, + media: InputMedia, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageMedia(chat.id, messageId, media, replyMarkup) + +suspend fun RequestsExecutor.editMessageMedia( + message: ContentMessage, + media: InputMedia, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageMedia(message.chat.id, message.messageId, media, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditInlineMessageMedia.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditInlineMessageMedia.kt new file mode 100644 index 0000000000..1768ac1f15 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/media/EditInlineMessageMedia.kt @@ -0,0 +1,13 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.EditInlineMessageMedia +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.editMessageCaption( + inlineMessageId: InlineMessageIdentifier, + media: InputMedia, + replyMarkup: InlineKeyboardMarkup? = null +) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup)) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditChatMessageText.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditChatMessageText.kt new file mode 100644 index 0000000000..18320bc153 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditChatMessageText.kt @@ -0,0 +1,39 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.text + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text.EditChatMessageText +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.TextContent + +suspend fun RequestsExecutor.editMessageText( + chatId: ChatIdentifier, + messageId: MessageIdentifier, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup) +) + +suspend fun RequestsExecutor.editMessageText( + chat: Chat, + messageId: MessageIdentifier, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup) + +suspend fun RequestsExecutor.editMessageText( + message: ContentMessage, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = editMessageText(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup) \ No newline at end of file diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditInlineMessageText.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditInlineMessageText.kt new file mode 100644 index 0000000000..2d0521d73a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/edit/text/EditInlineMessageText.kt @@ -0,0 +1,15 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.text + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text.EditInlineMessageText +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup + +suspend fun RequestsExecutor.editMessageText( + inlineMessageId: InlineMessageIdentifier, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, disableWebPagePreview, replyMarkup)) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByChat.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByChat.kt new file mode 100644 index 0000000000..9253f8d27c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByChat.kt @@ -0,0 +1,54 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.games.GetGameHighScoresByChat +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.GameContent + +suspend fun RequestsExecutor.getGameScore( + userId: UserId, + chatId: ChatId, + messageId: MessageIdentifier +) = execute( + GetGameHighScoresByChat(userId, chatId, messageId) +) + +suspend fun RequestsExecutor.getGameScore( + user: CommonUser, + chatId: ChatId, + messageId: MessageIdentifier +) = getGameScore( + user.id, chatId, messageId +) + +suspend fun RequestsExecutor.getGameScore( + userId: UserId, + chat: Chat, + messageId: MessageIdentifier +) = getGameScore( + userId, chat.id, messageId +) + +suspend fun RequestsExecutor.getGameScore( + user: CommonUser, + chat: Chat, + messageId: MessageIdentifier +) = getGameScore( + user.id, chat.id, messageId +) + +suspend fun RequestsExecutor.getGameScore( + userId: UserId, + message: ContentMessage +) = getGameScore( + userId, message.chat.id, message.messageId +) + +suspend fun RequestsExecutor.getGameScore( + user: CommonUser, + message: ContentMessage +) = getGameScore( + user.id, message.chat.id, message.messageId +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByInlineMessageId.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByInlineMessageId.kt new file mode 100644 index 0000000000..a1ea482a94 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/GetGameHighScoresByInlineMessageId.kt @@ -0,0 +1,19 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.games.GetGameHighScoresByInlineMessageId +import com.github.insanusmokrassar.TelegramBotAPI.types.* + +suspend fun RequestsExecutor.getGameScore( + userId: UserId, + inlineMessageId: InlineMessageIdentifier +) = execute( + GetGameHighScoresByInlineMessageId( + userId, inlineMessageId + ) +) + +suspend fun RequestsExecutor.getGameScore( + user: CommonUser, + inlineMessageId: InlineMessageIdentifier +) = getGameScore(user.id, inlineMessageId) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByChatId.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByChatId.kt new file mode 100644 index 0000000000..789ca0af5e --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByChatId.kt @@ -0,0 +1,72 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.games.SetGameScoreByChatId +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.GameContent + +suspend fun RequestsExecutor.setGameScore( + userId: UserId, + score: Long, + chatId: ChatId, + messageId: MessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = execute( + SetGameScoreByChatId(userId, score, chatId, messageId, force, disableEditMessage) +) + +suspend fun RequestsExecutor.setGameScore( + user: CommonUser, + score: Long, + chatId: ChatId, + messageId: MessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore( + user.id, score, chatId, messageId, force, disableEditMessage +) + +suspend fun RequestsExecutor.setGameScore( + userId: UserId, + score: Long, + chat: Chat, + messageId: MessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore( + userId, score, chat.id, messageId, force, disableEditMessage +) + +suspend fun RequestsExecutor.setGameScore( + user: CommonUser, + score: Long, + chat: Chat, + messageId: MessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore( + user.id, score, chat.id, messageId, force, disableEditMessage +) + +suspend fun RequestsExecutor.setGameScore( + userId: UserId, + score: Long, + message: ContentMessage, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore( + userId, score, message.chat.id, message.messageId, force, disableEditMessage +) + +suspend fun RequestsExecutor.setGameScore( + user: CommonUser, + score: Long, + message: ContentMessage, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore( + user.id, score, message.chat.id, message.messageId, force, disableEditMessage +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByInlineMessageId.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByInlineMessageId.kt new file mode 100644 index 0000000000..ded6c96916 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/games/SetGameScoreByInlineMessageId.kt @@ -0,0 +1,25 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.games.SetGameScoreByInlineMessageId +import com.github.insanusmokrassar.TelegramBotAPI.types.* + +suspend fun RequestsExecutor.setGameScore( + userId: UserId, + score: Long, + inlineMessageId: InlineMessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = execute( + SetGameScoreByInlineMessageId( + userId, score, inlineMessageId, force, disableEditMessage + ) +) + +suspend fun RequestsExecutor.setGameScore( + user: CommonUser, + score: Long, + inlineMessageId: InlineMessageIdentifier, + force: Boolean = false, + disableEditMessage: Boolean = false +) = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetFile.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetFile.kt new file mode 100644 index 0000000000..1fde6e92ea --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetFile.kt @@ -0,0 +1,16 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.get.GetFile +import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.TelegramMediaFile + +suspend fun RequestsExecutor.getFileAdditionalInfo( + fileId: FileId +) = execute( + GetFile(fileId) +) + +suspend fun RequestsExecutor.getFileAdditionalInfo( + file: TelegramMediaFile +) = getFileAdditionalInfo(file.fileId) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetStickerSet.kt new file mode 100644 index 0000000000..0fce1971cd --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetStickerSet.kt @@ -0,0 +1,17 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.get.GetStickerSet +import com.github.insanusmokrassar.TelegramBotAPI.types.files.Sticker + +suspend fun RequestsExecutor.getStickerSet( + name: String +) = execute( + GetStickerSet(name) +) + +suspend fun RequestsExecutor.getStickerSet( + sticker: Sticker +) = getStickerSet( + sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method") +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetUserProfilePhotos.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetUserProfilePhotos.kt new file mode 100644 index 0000000000..a3f613e543 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/get/GetUserProfilePhotos.kt @@ -0,0 +1,22 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.get.GetUserProfilePhotos +import com.github.insanusmokrassar.TelegramBotAPI.types.CommonUser +import com.github.insanusmokrassar.TelegramBotAPI.types.UserId + +suspend fun RequestsExecutor.getUserProfilePhotos( + userId: UserId, + offset: Int? = null, + limit: Int? = null +) = execute( + GetUserProfilePhotos( + userId, offset, limit + ) +) + +suspend fun RequestsExecutor.getUserProfilePhotos( + user: CommonUser, + offset: Int? = null, + limit: Int? = null +) = getUserProfilePhotos(user.id, offset, limit) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendAction.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendAction.kt new file mode 100644 index 0000000000..a2366ab56a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendAction.kt @@ -0,0 +1,102 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendAction +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.actions.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendBotAction( + chatId: ChatIdentifier, + action: BotAction +) = execute( + SendAction(chatId, action) +) + +suspend fun RequestsExecutor.sendBotAction( + chat: Chat, + action: BotAction +) = sendBotAction(chat.id, action) + + +suspend fun RequestsExecutor.sendActionTyping( + chatId: ChatIdentifier +) = sendBotAction(chatId, TypingAction) + +suspend fun RequestsExecutor.sendActionUploadPhoto( + chatId: ChatIdentifier +) = sendBotAction(chatId, UploadPhotoAction) + +suspend fun RequestsExecutor.sendActionRecordVideo( + chatId: ChatIdentifier +) = sendBotAction(chatId, RecordVideoAction) + +suspend fun RequestsExecutor.sendActionUploadVideo( + chatId: ChatIdentifier +) = sendBotAction(chatId, UploadVideoAction) + +suspend fun RequestsExecutor.sendActionRecordAudio( + chatId: ChatIdentifier +) = sendBotAction(chatId, RecordAudioAction) + +suspend fun RequestsExecutor.sendActionUploadAudio( + chatId: ChatIdentifier +) = sendBotAction(chatId, UploadAudioAction) + +suspend fun RequestsExecutor.sendActionUploadDocument( + chatId: ChatIdentifier +) = sendBotAction(chatId, UploadDocumentAction) + +suspend fun RequestsExecutor.sendActionFindLocation( + chatId: ChatIdentifier +) = sendBotAction(chatId, FindLocationAction) + +suspend fun RequestsExecutor.sendActionRecordVideoNote( + chatId: ChatIdentifier +) = sendBotAction(chatId, RecordVideoNoteAction) + +suspend fun RequestsExecutor.sendActionUploadVideoNote( + chatId: ChatIdentifier +) = sendBotAction(chatId, UploadVideoNoteAction) + + +suspend fun RequestsExecutor.sendActionTyping( + chat: Chat +) = sendBotAction(chat, TypingAction) + +suspend fun RequestsExecutor.sendActionUploadPhoto( + chat: Chat +) = sendBotAction(chat, UploadPhotoAction) + +suspend fun RequestsExecutor.sendActionRecordVideo( + chat: Chat +) = sendBotAction(chat, RecordVideoAction) + +suspend fun RequestsExecutor.sendActionUploadVideo( + chat: Chat +) = sendBotAction(chat, UploadVideoAction) + +suspend fun RequestsExecutor.sendActionRecordAudio( + chat: Chat +) = sendBotAction(chat, RecordAudioAction) + +suspend fun RequestsExecutor.sendActionUploadAudio( + chat: Chat +) = sendBotAction(chat, UploadAudioAction) + +suspend fun RequestsExecutor.sendActionUploadDocument( + chat: Chat +) = sendBotAction(chat, UploadDocumentAction) + +suspend fun RequestsExecutor.sendActionFindLocation( + chat: Chat +) = sendBotAction(chat, FindLocationAction) + +suspend fun RequestsExecutor.sendActionRecordVideoNote( + chat: Chat +) = sendBotAction(chat, RecordVideoNoteAction) + +suspend fun RequestsExecutor.sendActionUploadVideoNote( + chat: Chat +) = sendBotAction(chat, UploadVideoNoteAction) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendContact.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendContact.kt new file mode 100644 index 0000000000..6aa4a2cb94 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendContact.kt @@ -0,0 +1,55 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendContact +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendContact( + chatId: ChatIdentifier, + phoneNumber: String, + firstName: String, + lastName: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendContact( + chatId, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendContact( + chatId: ChatIdentifier, + contact: Contact, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendContact( + chatId, contact, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendContact( + chat: Chat, + phoneNumber: String, + firstName: String, + lastName: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendContact( + chat.id, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendContact( + chat: Chat, + contact: Contact, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendContact( + chat.id, contact, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendLocation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendLocation.kt new file mode 100644 index 0000000000..2b0437f063 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendLocation.kt @@ -0,0 +1,71 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendLocation +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendLocation( + chatId: ChatIdentifier, + latitude: Double, + longitude: Double, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendLocation( + chatId, + latitude, + longitude, + disableNotification = disableNotification, + replyToMessageId = replyToMessageId, + replyMarkup = replyMarkup + ) +) + +suspend fun RequestsExecutor.sendLocation( + chatId: ChatIdentifier, + location: Location, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chatId, + location.latitude, + location.longitude, + disableNotification, + replyToMessageId, + replyMarkup +) + +suspend fun RequestsExecutor.sendLocation( + chat: Chat, + latitude: Double, + longitude: Double, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chat.id, + latitude, + longitude, + disableNotification, + replyToMessageId, + replyMarkup +) + +suspend fun RequestsExecutor.sendLocation( + chat: Chat, + location: Location, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chat.id, + location.latitude, + location.longitude, + disableNotification, + replyToMessageId, + replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendMessage.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendMessage.kt new file mode 100644 index 0000000000..0275e9916c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendMessage.kt @@ -0,0 +1,54 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendTextMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendMessage( + chatId: ChatIdentifier, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendTextMessage( + chatId: ChatIdentifier, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendMessage( + chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendMessage( + chat: Chat, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) + + +suspend fun RequestsExecutor.sendTextMessage( + chat: Chat, + text: String, + parseMode: ParseMode? = null, + disableWebPagePreview: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendVenue.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendVenue.kt new file mode 100644 index 0000000000..4f358d4ad3 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendVenue.kt @@ -0,0 +1,59 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendVenue +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendVenue( + chatId: ChatIdentifier, + latitude: Double, + longitude: Double, + title: String, + address: String, + foursquareId: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVenue( + chatId, latitude, longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVenue( + chat: Chat, + latitude: Double, + longitude: Double, + title: String, + address: String, + foursquareId: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVenue( + chat.id, latitude, longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVenue( + chatId: ChatIdentifier, + venue: Venue, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVenue( + chatId, venue, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVenue( + chat: Chat, + venue: Venue, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVenue( + chat.id, venue, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/games/SendGame.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/games/SendGame.kt new file mode 100644 index 0000000000..fc1bc641d6 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/games/SendGame.kt @@ -0,0 +1,51 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.games + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.games.SendGame +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.games.Game + +suspend fun RequestsExecutor.sendGame( + chatId: ChatIdentifier, + gameShortName: String, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendGame( + chatId, gameShortName, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendGame( + chat: Chat, + gameShortName: String, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendGame( + chat.id, gameShortName, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendGame( + chatId: ChatIdentifier, + game: Game, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendGame( + chatId, game.title, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendGame( + chat: Chat, + game: Game, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendGame( + chat.id, game.title, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAnimation.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAnimation.kt new file mode 100644 index 0000000000..c7ee2df51b --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAnimation.kt @@ -0,0 +1,167 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendAnimation +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.AnimationFile +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAnimation( + chatId, + animation, + thumb, + text, + parseMode, + duration, + width, + height, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: AnimationFile, + thumb: PhotoSize? = animation.thumb, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAnimation( + chatId, animation.fileId, thumb ?.fileId, text, parseMode, animation.duration, animation.width, animation.height, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAnimation( + chatId, + animation, + thumb, + text, + parseMode, + duration, + width, + height, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAnimation( + chatId, + animation, + thumb, + text, + parseMode, + duration, + width, + height, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAnimation( + chatId, + animation, + thumb, + text, + parseMode, + duration, + width, + height, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAnimation( + chatId, animation, thumb ?.fileId , text, parseMode, duration, width, height, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendAnimation( + chatId: ChatIdentifier, + animation: AnimationFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAnimation( + chatId, animation.fileId, thumb, text, parseMode, animation.duration, animation.width, animation.height, disableNotification, replyToMessageId, replyMarkup +) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAudio.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAudio.kt new file mode 100644 index 0000000000..0951bc44f4 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendAudio.kt @@ -0,0 +1,168 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendAudio +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + performer: String? = null, + title: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAudio( + chatId, + audio, + thumb, + text, + parseMode, + duration, + performer, + title, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: AudioFile, + thumb: PhotoSize? = audio.thumb, + text: String? = null, + parseMode: ParseMode? = null, + title: String? = audio.title, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAudio( + chatId, audio.fileId, thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + performer: String? = null, + title: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAudio( + chatId, + audio, + thumb, + text, + parseMode, + duration, + performer, + title, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + performer: String? = null, + title: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAudio( + chatId, + audio, + thumb, + text, + parseMode, + duration, + performer, + title, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + performer: String? = null, + title: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendAudio( + chatId, + audio, + thumb, + text, + parseMode, + duration, + performer, + title, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + performer: String? = null, + title: String? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAudio( + chatId, audio, thumb ?.fileId , text, parseMode, duration, performer, title, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendAudio( + chatId: ChatIdentifier, + audio: AudioFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + title: String? = audio.title, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendAudio( + chatId, audio.fileId, thumb, text, parseMode, audio.duration, audio.performer, title, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendDocument.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendDocument.kt new file mode 100644 index 0000000000..a5fe4ffb7d --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendDocument.kt @@ -0,0 +1,139 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendDocument +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.DocumentFile +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendDocument( + chatId, + document, + thumb, + text, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: DocumentFile, + thumb: PhotoSize? = document.thumb, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendDocument( + chatId, document.fileId, thumb ?.fileId, text, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendDocument( + chatId, + document, + thumb, + text, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendDocument( + chatId, + document, + thumb, + text, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendDocument( + chatId, + document, + thumb, + text, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendDocument( + chatId, document, thumb ?.fileId , text, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendDocument( + chatId: ChatIdentifier, + document: DocumentFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendDocument( + chatId, document.fileId, thumb, text, parseMode, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendMediaGroup.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendMediaGroup.kt new file mode 100644 index 0000000000..3c8448f445 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendMediaGroup.kt @@ -0,0 +1,28 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendMediaGroup +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat + +suspend fun RequestsExecutor.sendMediaGroup( + chatId: ChatIdentifier, + media: List, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null +) = execute( + SendMediaGroup( + chatId, media, disableNotification, replyToMessageId + ) +) + +suspend fun RequestsExecutor.sendMediaGroup( + chat: Chat, + media: List, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null +) = sendMediaGroup( + chat.id, media, disableNotification, replyToMessageId +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendPhoto.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendPhoto.kt new file mode 100644 index 0000000000..f9460cdc9f --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendPhoto.kt @@ -0,0 +1,136 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendPhoto +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.files.* + +suspend fun RequestsExecutor.sendPhoto( + chatId: ChatIdentifier, + fileId: FileId, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendPhoto( + chatId, + fileId, + caption, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendPhoto( + chatId: ChatIdentifier, + photo: MultipartFile, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendPhoto( + chatId, + photo, + caption, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendPhoto( + chatId: ChatIdentifier, + file: PhotoSize, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chatId, file.fileId, caption, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendPhoto( + chatId: ChatIdentifier, + photo: Photo, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chatId, photo.biggest() ?: throw IllegalArgumentException("Photo $photo is empty"), caption, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendPhoto( + chat: Chat, + fileId: FileId, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chat.id, + fileId, + caption, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup +) + +suspend fun RequestsExecutor.sendPhoto( + chat: Chat, + file: PhotoSize, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chat.id, file.fileId, caption, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendPhoto( + chat: Chat, + photo: Photo, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chat.id, photo.biggest() ?: throw IllegalArgumentException("Photo $photo is empty"), caption, parseMode, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendPhoto( + chat: Chat, + fileId: MultipartFile, + caption: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendPhoto( + chat.id, + fileId, + caption, + parseMode, + disableNotification, + replyToMessageId, + replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendSticker.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendSticker.kt new file mode 100644 index 0000000000..bc315db06c --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendSticker.kt @@ -0,0 +1,66 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendSticker +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.files.Sticker + +suspend fun RequestsExecutor.sendSticker( + chatId: ChatIdentifier, + sticker: FileId, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendSticker(chatId, sticker, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendSticker( + chatId: ChatIdentifier, + sticker: MultipartFile, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendSticker(chatId, sticker, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendSticker( + chat: Chat, + sticker: FileId, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendSticker(chat.id, sticker, disableNotification, replyToMessageId, replyMarkup) + +suspend fun RequestsExecutor.sendSticker( + chat: Chat, + sticker: MultipartFile, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendSticker(chat.id, sticker, disableNotification, replyToMessageId, replyMarkup) + +suspend fun RequestsExecutor.sendSticker( + chatId: ChatIdentifier, + sticker: Sticker, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendSticker( + chatId, sticker.fileId, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendSticker( + chat: Chat, + sticker: Sticker, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendSticker(chat.id, sticker.fileId, disableNotification, replyToMessageId, replyMarkup) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideo.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideo.kt new file mode 100644 index 0000000000..d623c96509 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideo.kt @@ -0,0 +1,135 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideo +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize +import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideo( + chatId, + video, + thumb, + text, + parseMode, + duration, + width, + height, + null, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: VideoFile, + thumb: PhotoSize? = video.thumb, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideo( + chatId, video.fileId, thumb ?.fileId, text, parseMode, video.duration, video.width, video.height, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + supportStreaming: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideo(chatId, video, thumb, text, parseMode, duration, width, height, supportStreaming, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + supportStreaming: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideo(chatId, video, thumb, text, parseMode, duration, width, height, supportStreaming, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideo(chatId, video, thumb, text, parseMode, duration, width, height, null, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + width: Int? = null, + height: Int? = null, + supportStreaming: Boolean? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideo( + chatId, video, thumb ?.fileId , text, parseMode, duration, width, height, supportStreaming, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVideo( + chatId: ChatIdentifier, + video: VideoFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideo( + chatId, video.fileId, thumb, text, parseMode, video.duration, video.width, video.height, disableNotification, replyToMessageId, replyMarkup +) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideoNote.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideoNote.kt new file mode 100644 index 0000000000..8fc6ff6946 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideoNote.kt @@ -0,0 +1,157 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideoNote +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize +import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + size: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideoNote( + chatId, + videoNote, + thumb, + text, + parseMode, + duration, + size, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: VideoFile, + thumb: PhotoSize? = videoNote.thumb, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideoNote( + chatId, videoNote.fileId, thumb ?.fileId, text, parseMode, videoNote.duration, videoNote.width, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + size: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideoNote( + chatId, + videoNote, + thumb, + text, + parseMode, + duration, + size, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + size: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideoNote( + chatId, + videoNote, + thumb, + text, + parseMode, + duration, + size, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + size: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVideoNote( + chatId, + videoNote, + thumb, + text, + parseMode, + duration, + size, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + size: Int? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideoNote( + chatId, videoNote, thumb ?.fileId , text, parseMode, duration, size, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVideoNote( + chatId: ChatIdentifier, + videoNote: VideoFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVideoNote( + chatId, videoNote.fileId, thumb, text, parseMode, videoNote.duration, videoNote.width, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVoice.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVoice.kt new file mode 100644 index 0000000000..f0e233378f --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVoice.kt @@ -0,0 +1,149 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVoice +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile +import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: FileId, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVoice( + chatId, + voice, + thumb, + text, + parseMode, + duration, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: AudioFile, + thumb: PhotoSize? = voice.thumb, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVoice( + chatId, voice.fileId, thumb ?.fileId, text, parseMode, voice.duration, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: MultipartFile, + thumb: FileId? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVoice( + chatId, + voice, + thumb, + text, + parseMode, + duration, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: MultipartFile, + thumb: MultipartFile? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVoice( + chatId, + voice, + thumb, + text, + parseMode, + duration, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: FileId, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendVoice( + chatId, + voice, + thumb, + text, + parseMode, + duration, + disableNotification, + replyToMessageId, + replyMarkup + ) +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: MultipartFile, + thumb: PhotoSize? = null, + text: String? = null, + parseMode: ParseMode? = null, + duration: Long? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVoice( + chatId, voice, thumb ?.fileId , text, parseMode, duration, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendVoice( + chatId: ChatIdentifier, + voice: AudioFile, + thumb: MultipartFile, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendVoice( + chatId, voice.fileId, thumb, text, parseMode, voice.duration, disableNotification, replyToMessageId, replyMarkup +) + diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/payments/SendInvoice.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/payments/SendInvoice.kt new file mode 100644 index 0000000000..6f5b50f7c6 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/payments/SendInvoice.kt @@ -0,0 +1,54 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.payments + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments.SendInvoice +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.payments.LabeledPrice +import com.github.insanusmokrassar.TelegramBotAPI.types.payments.abstracts.Currency + +suspend fun RequestsExecutor.sendInvoice( + chatId: ChatId, + title: String, + description: String, + payload: String, + providerToken: String, + startParameter: StartParameter, + currency: Currency, + prices: List, + providerData: String? = null, + requireName: Boolean = false, + requirePhoneNumber: Boolean = false, + requireEmail: Boolean = false, + requireShippingAddress: Boolean = false, + shouldSendPhoneNumberToProvider: Boolean = false, + shouldSendEmailToProvider: Boolean = false, + priceDependOnShipAddress: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = execute( + SendInvoice(chatId, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, replyMarkup) +) + +suspend fun RequestsExecutor.sendInvoice( + user: CommonUser, + title: String, + description: String, + payload: String, + providerToken: String, + startParameter: StartParameter, + currency: Currency, + prices: List, + providerData: String? = null, + requireName: Boolean = false, + requirePhoneNumber: Boolean = false, + requireEmail: Boolean = false, + requireShippingAddress: Boolean = false, + shouldSendPhoneNumberToProvider: Boolean = false, + shouldSendEmailToProvider: Boolean = false, + priceDependOnShipAddress: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: InlineKeyboardMarkup? = null +) = sendInvoice(user.id, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, replyMarkup) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/polls/SendPoll.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/polls/SendPoll.kt new file mode 100644 index 0000000000..813b91fa0b --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/polls/SendPoll.kt @@ -0,0 +1,135 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.polls + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls.SendQuizPoll +import com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls.SendRegularPoll +import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.polls.QuizPoll +import com.github.insanusmokrassar.TelegramBotAPI.types.polls.RegularPoll + +suspend fun RequestsExecutor.sendRegularPoll( + chatId: ChatIdentifier, + question: String, + options: List, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + allowMultipleAnswers: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendRegularPoll( + chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup + ) +) +suspend fun RequestsExecutor.sendRegularPoll( + chatId: ChatIdentifier, + poll: RegularPoll, + isClosed: Boolean = false, + question: String = poll.question, + options: List = poll.options.map { it.text }, + isAnonymous: Boolean = poll.isAnonymous, + allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendRegularPoll( + chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendRegularPoll( + chat: Chat, + question: String, + options: List, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + allowMultipleAnswers: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendRegularPoll( + chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendRegularPoll( + chat: Chat, + poll: RegularPoll, + isClosed: Boolean = false, + question: String = poll.question, + options: List = poll.options.map { it.text }, + isAnonymous: Boolean = poll.isAnonymous, + allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendRegularPoll( + chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup +) + + +suspend fun RequestsExecutor.sendQuizPoll( + chatId: ChatIdentifier, + question: String, + options: List, + correctOptionId: Int, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendQuizPoll( + chatId, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendQuizPoll( + chat: Chat, + question: String, + options: List, + correctOptionId: Int, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendQuizPoll( + chat.id, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup +) + +suspend fun RequestsExecutor.sendQuizPoll( + chatId: ChatIdentifier, + isClosed: Boolean = false, + quizPoll: QuizPoll, + question: String = quizPoll.question, + options: List = quizPoll.options.map { it.text }, + correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"), + isAnonymous: Boolean = quizPoll.isAnonymous, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendQuizPoll( + chatId, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup + ) +) + +suspend fun RequestsExecutor.sendQuizPoll( + chat: Chat, + isClosed: Boolean = false, + quizPoll: QuizPoll, + question: String = quizPoll.question, + options: List = quizPoll.options.map { it.text }, + correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"), + isAnonymous: Boolean = quizPoll.isAnonymous, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendQuizPoll( + chat.id, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStickerToSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStickerToSet.kt new file mode 100644 index 0000000000..e2436eb245 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStickerToSet.kt @@ -0,0 +1,90 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.AddStickerToSet +import com.github.insanusmokrassar.TelegramBotAPI.types.CommonUser +import com.github.insanusmokrassar.TelegramBotAPI.types.UserId +import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.MaskPosition +import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.StickerSet + +suspend fun RequestsExecutor.addStickerToSet( + userId: UserId, + stickerSetName: String, + sticker: FileId, + emojis: String, + maskPosition: MaskPosition? = null +) = execute( + AddStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) +) + +suspend fun RequestsExecutor.addStickerToSet( + userId: UserId, + stickerSetName: String, + sticker: MultipartFile, + emojis: String, + maskPosition: MaskPosition? = null +) = execute( + AddStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) +) + +suspend fun RequestsExecutor.addStickerToSet( + user: CommonUser, + stickerSetName: String, + sticker: FileId, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + user.id, stickerSetName, sticker, emojis, maskPosition +) + +suspend fun RequestsExecutor.addStickerToSet( + user: CommonUser, + stickerSetName: String, + sticker: MultipartFile, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + user.id, stickerSetName, sticker, emojis, maskPosition +) + +suspend fun RequestsExecutor.addStickerToSet( + userId: UserId, + stickerSet: StickerSet, + sticker: FileId, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + userId, stickerSet.name, sticker, emojis, maskPosition +) + +suspend fun RequestsExecutor.addStickerToSet( + userId: UserId, + stickerSet: StickerSet, + sticker: MultipartFile, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + userId, stickerSet.name, sticker, emojis, maskPosition +) + +suspend fun RequestsExecutor.addStickerToSet( + user: CommonUser, + stickerSet: StickerSet, + sticker: FileId, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + user.id, stickerSet.name, sticker, emojis, maskPosition +) + +suspend fun RequestsExecutor.addStickerToSet( + user: CommonUser, + stickerSet: StickerSet, + sticker: MultipartFile, + emojis: String, + maskPosition: MaskPosition? = null +) = addStickerToSet( + user.id, stickerSet.name, sticker, emojis, maskPosition +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStickerSet.kt new file mode 100644 index 0000000000..b65acc0f0a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStickerSet.kt @@ -0,0 +1,54 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.CreateNewStickerSet +import com.github.insanusmokrassar.TelegramBotAPI.types.CommonUser +import com.github.insanusmokrassar.TelegramBotAPI.types.UserId +import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.MaskPosition + +suspend fun RequestsExecutor.createNewStickerSet( + userId: UserId, + name: String, + sticker: FileId, + emojis: String, + containsMasks: Boolean? = null, + maskPosition: MaskPosition? = null +) = execute( + CreateNewStickerSet(userId, name, sticker, emojis, containsMasks, maskPosition) +) + +suspend fun RequestsExecutor.createNewStickerSet( + userId: UserId, + name: String, + sticker: MultipartFile, + emojis: String, + containsMasks: Boolean? = null, + maskPosition: MaskPosition? = null +) = execute( + CreateNewStickerSet(userId, name, sticker, emojis, containsMasks, maskPosition) +) + + +suspend fun RequestsExecutor.createNewStickerSet( + user: CommonUser, + name: String, + sticker: FileId, + emojis: String, + containsMasks: Boolean? = null, + maskPosition: MaskPosition? = null +) = createNewStickerSet( + user.id, name, sticker, emojis, containsMasks, maskPosition +) + +suspend fun RequestsExecutor.createNewStickerSet( + user: CommonUser, + name: String, + sticker: MultipartFile, + emojis: String, + containsMasks: Boolean? = null, + maskPosition: MaskPosition? = null +) = createNewStickerSet( + user.id, name, sticker, emojis, containsMasks, maskPosition +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/DeleteStickerFromSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/DeleteStickerFromSet.kt new file mode 100644 index 0000000000..3206463af1 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/DeleteStickerFromSet.kt @@ -0,0 +1,20 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.DeleteStickerFromSet +import com.github.insanusmokrassar.TelegramBotAPI.types.files.Sticker + +suspend fun RequestsExecutor.deleteStickerFromSet( + sticker: FileId +) = execute( + DeleteStickerFromSet( + sticker + ) +) + +suspend fun RequestsExecutor.deleteStickerFromSet( + sticker: Sticker +) = deleteStickerFromSet( + sticker.fileId +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerPositionInSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerPositionInSet.kt new file mode 100644 index 0000000000..553d131ab3 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerPositionInSet.kt @@ -0,0 +1,24 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.SetStickerPositionInSet +import com.github.insanusmokrassar.TelegramBotAPI.types.files.Sticker + +suspend fun RequestsExecutor.setStickerPositionInSet( + sticker: FileId, + position: Int +) = execute( + SetStickerPositionInSet( + sticker, + position + ) +) + +suspend fun RequestsExecutor.setStickerPositionInSet( + sticker: Sticker, + position: Int +) = setStickerPositionInSet( + sticker.fileId, + position +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/UploadStickerFile.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/UploadStickerFile.kt new file mode 100644 index 0000000000..e61ace8cce --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/UploadStickerFile.kt @@ -0,0 +1,21 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.UploadStickerFile +import com.github.insanusmokrassar.TelegramBotAPI.types.CommonUser +import com.github.insanusmokrassar.TelegramBotAPI.types.UserId + +suspend fun RequestsExecutor.uploadStickerFile( + userId: UserId, + sticker: MultipartFile +) = execute( + UploadStickerFile(userId, sticker) +) + +suspend fun RequestsExecutor.uploadStickerFile( + user: CommonUser, + sticker: MultipartFile +) = execute( + UploadStickerFile(user.id, sticker) +) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/DeleteWebhook.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/DeleteWebhook.kt new file mode 100644 index 0000000000..24ae2bb00a --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/DeleteWebhook.kt @@ -0,0 +1,6 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.DeleteWebhook + +suspend fun RequestsExecutor.deleteWebhook() = execute(DeleteWebhook()) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/GetWebhookInfo.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/GetWebhookInfo.kt new file mode 100644 index 0000000000..e8547f44d6 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/GetWebhookInfo.kt @@ -0,0 +1,6 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.GetWebhookInfo + +suspend fun RequestsExecutor.getWebhookInfo() = execute(GetWebhookInfo()) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhook.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhook.kt new file mode 100644 index 0000000000..7d2e45d493 --- /dev/null +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhook.kt @@ -0,0 +1,28 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook + +import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile +import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook + +suspend fun RequestsExecutor.setWebhookInfo( + url: String, + certificate: FileId, + maxAllowedConnections: Int? = null, + allowedUpdates: List? = null +) = execute( + SetWebhook( + url, certificate, maxAllowedConnections, allowedUpdates + ) +) + +suspend fun RequestsExecutor.setWebhookInfo( + url: String, + certificate: MultipartFile, + maxAllowedConnections: Int? = null, + allowedUpdates: List? = null +) = execute( + SetWebhook( + url, certificate, maxAllowedConnections, allowedUpdates + ) +) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt index a7df40851a..f6befe6c15 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt @@ -24,6 +24,7 @@ data class DeleteMessage( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteMessage( chatId: ChatIdentifier, messageId: MessageIdentifier @@ -31,11 +32,13 @@ suspend fun RequestsExecutor.deleteMessage( DeleteMessage(chatId, messageId) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteMessage( chat: Chat, messageId: MessageIdentifier ) = deleteMessage(chat.id, messageId) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteMessage( message: Message ) = deleteMessage(message.chat, message.messageId) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/ForwardMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/ForwardMessage.kt index ebdf92e1fc..22e78d45ad 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/ForwardMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/ForwardMessage.kt @@ -32,6 +32,7 @@ data class ForwardMessage( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( fromChatId: ChatIdentifier, toChatId: ChatIdentifier, @@ -41,6 +42,7 @@ suspend fun RequestsExecutor.forwardMessage( ForwardMessage(fromChatId, toChatId, messageId, disableNotification) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( fromChat: Chat, toChatId: ChatIdentifier, @@ -48,6 +50,7 @@ suspend fun RequestsExecutor.forwardMessage( disableNotification: Boolean = false ) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( fromChatId: ChatIdentifier, toChat: Chat, @@ -55,6 +58,7 @@ suspend fun RequestsExecutor.forwardMessage( disableNotification: Boolean = false ) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( fromChat: Chat, toChat: Chat, @@ -62,12 +66,14 @@ suspend fun RequestsExecutor.forwardMessage( disableNotification: Boolean = false ) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( toChatId: ChatIdentifier, message: Message, disableNotification: Boolean = false ) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.forwardMessage( toChat: Chat, message: Message, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetMe.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetMe.kt index dfebfca2c1..5af10ee101 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetMe.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetMe.kt @@ -14,4 +14,5 @@ class GetMe : SimpleRequest { get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getMe() = execute(GetMe()) \ No newline at end of file diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt index c4094cb6a9..485e3bf8a6 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt @@ -29,6 +29,7 @@ data class GetUpdates( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getUpdates( offset: UpdateIdentifier? = null, limit: Int? = null, @@ -40,6 +41,7 @@ suspend fun RequestsExecutor.getUpdates( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getUpdates( lastUpdate: Update, limit: Int? = null, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/LiveLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/LiveLocation.kt index de8dddff05..c762441253 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/LiveLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/LiveLocation.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.launch import kotlin.math.ceil private val livePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L -class LiveLocation internal constructor( +class LiveLocation( private val requestsExecutor: RequestsExecutor, scope: CoroutineScope, autoCloseTimeDelay: Double, @@ -66,6 +66,7 @@ class LiveLocation internal constructor( } } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.startLiveLocation( scope: CoroutineScope, chatId: ChatIdentifier, @@ -97,6 +98,7 @@ suspend fun RequestsExecutor.startLiveLocation( ) } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.startLiveLocation( scope: CoroutineScope, chat: Chat, @@ -110,6 +112,7 @@ suspend fun RequestsExecutor.startLiveLocation( scope, chat.id, latitude, longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.startLiveLocation( scope: CoroutineScope, chatId: ChatId, @@ -122,6 +125,7 @@ suspend fun RequestsExecutor.startLiveLocation( scope, chatId, location.latitude, location.longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.startLiveLocation( scope: CoroutineScope, chat: Chat, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/StopPoll.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/StopPoll.kt index cdf2960886..a087d0b423 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/StopPoll.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/StopPoll.kt @@ -27,6 +27,7 @@ data class StopPoll( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopPoll( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -35,18 +36,21 @@ suspend fun RequestsExecutor.stopPoll( StopPoll(chatId, messageId, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopPoll( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = stopPoll(chat.id, messageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopPoll( chatId: ChatId, message: Message, replyMarkup: InlineKeyboardMarkup? = null ) = stopPoll(chatId, message.messageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopPoll( chat: Chat, message: Message, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerCallbackQuery.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerCallbackQuery.kt index 0c92f280e0..b298c0679d 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerCallbackQuery.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerCallbackQuery.kt @@ -34,6 +34,7 @@ fun CallbackQuery.createAnswer( cachedTimeSeconds: Int? = null ): AnswerCallbackQuery = AnswerCallbackQuery(id, text, showAlert, url, cachedTimeSeconds) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerCallbackQuery( callbackQueryId: CallbackQueryIdentifier, text: String? = null, @@ -42,6 +43,7 @@ suspend fun RequestsExecutor.answerCallbackQuery( cachedTimeSeconds: Int? = null ) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerCallbackQuery( callbackQuery: CallbackQuery, text: String? = null, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt index 6d42f8162e..cc7d7cdfaa 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/AnswerInlineQuery.kt @@ -52,6 +52,7 @@ fun InlineQuery.createAnswer( switchPmParameter ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerInlineQuery( inlineQueryID: InlineQueryIdentifier, results: List = emptyList(), @@ -64,6 +65,7 @@ suspend fun RequestsExecutor.answerInlineQuery( AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerInlineQuery( inlineQuery: InlineQuery, results: List = emptyList(), diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerPreCheckoutQuery.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerPreCheckoutQuery.kt index d148db2c93..353c6d7e34 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerPreCheckoutQuery.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerPreCheckoutQuery.kt @@ -42,17 +42,21 @@ fun PreCheckoutQuery.createAnswerError( error ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerPreCheckoutQueryOk( id: PreCheckoutQueryId ) = execute(AnswerPreCheckoutQueryOk(id)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerPreCheckoutQueryOk( preCheckoutQuery: PreCheckoutQuery ) = answerPreCheckoutQueryOk(preCheckoutQuery.id) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerPreCheckoutQueryError( id: PreCheckoutQueryId, error: String ) = execute(AnswerPreCheckoutQueryError(id, error)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerPreCheckoutQueryError( preCheckoutQuery: PreCheckoutQuery, error: String diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerShippingQuery.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerShippingQuery.kt index 9f6ab3ed03..4d9d2c5b74 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerShippingQuery.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/answers/payments/AnswerShippingQuery.kt @@ -53,19 +53,23 @@ fun ShippingQuery.createAnswerError( error ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerShippingQueryOk( id: ShippingQueryIdentifier, shippingOptions: List ) = execute(AnswerShippingQueryOk(id, shippingOptions)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerShippingQueryOk( shippingQuery: ShippingQuery, shippingOptions: List ) = answerShippingQueryOk(shippingQuery.id, shippingOptions) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerShippingQueryError( id: ShippingQueryIdentifier, error: String ) = execute(AnswerShippingQueryError(id, error)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.answerShippingQueryError( shippingQuery: ShippingQuery, error: String diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt index b118d2de3c..8dfaa5e279 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/ExportChatInviteLink.kt @@ -21,10 +21,12 @@ data class ExportChatInviteLink( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.exportChatInviteLink( chatId: ChatIdentifier ) = execute(ExportChatInviteLink(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.exportChatInviteLink( chat: PublicChat ) = exportChatInviteLink(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt index 3b61920134..79327a6257 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/LeaveChat.kt @@ -21,10 +21,12 @@ data class LeaveChat( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.leaveChat( chatId: ChatIdentifier ) = execute(LeaveChat(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.leaveChat( chat: PublicChat ) = leaveChat(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt index 9ef14933b5..cd257a99f8 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChat.kt @@ -22,10 +22,12 @@ data class GetChat( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChat( chatId: ChatIdentifier ) = execute(GetChat(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChat( chat: Chat ) = getChat(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt index d63f4a935c..0e43498c1c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatAdministrators.kt @@ -27,10 +27,12 @@ data class GetChatAdministrators( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatAdministrators( chatId: ChatIdentifier ) = execute(GetChatAdministrators(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatAdministrators( chat: PublicChat ) = getChatAdministrators(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt index 3ec346406c..2ba659c347 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/get/GetChatMembersCount.kt @@ -21,10 +21,12 @@ data class GetChatMembersCount( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMembersCount( chatId: ChatIdentifier ) = execute(GetChatMembersCount(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMembersCount( chat: PublicChat ) = getChatMembersCount(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/GetChatMember.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/GetChatMember.kt index 16fca63049..cb75a0da7a 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/GetChatMember.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/GetChatMember.kt @@ -22,21 +22,25 @@ data class GetChatMember( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMember( chatId: ChatIdentifier, userId: UserId ) = execute(GetChatMember(chatId, userId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMember( chat: PublicChat, userId: UserId ) = getChatMember(chat.id, userId) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMember( chatId: ChatId, user: User ) = getChatMember(chatId, user.id) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getChatMember( chat: PublicChat, user: User diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt index ff1d67b00b..a33931a40c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/KickChatMember.kt @@ -24,24 +24,28 @@ data class KickChatMember( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.kickChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null ) = execute(KickChatMember(chatId, userId, untilDate)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.kickChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null ) = kickChatMember(chat.id, userId, untilDate) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.kickChatMember( chatId: ChatId, user: User, untilDate: TelegramDate? = null ) = kickChatMember(chatId, user.id, untilDate) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.kickChatMember( chat: PublicChat, user: User, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt index 7c97a566f0..4e43b4260e 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/PromoteChatMember.kt @@ -40,6 +40,7 @@ data class PromoteChatMember( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.promoteChatMember( chatId: ChatIdentifier, userId: UserId, @@ -68,6 +69,7 @@ suspend fun RequestsExecutor.promoteChatMember( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.promoteChatMember( chat: PublicChat, userId: UserId, @@ -94,6 +96,7 @@ suspend fun RequestsExecutor.promoteChatMember( canPromoteMembers ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.promoteChatMember( chatId: ChatId, user: User, @@ -120,6 +123,7 @@ suspend fun RequestsExecutor.promoteChatMember( canPromoteMembers ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.promoteChatMember( chat: PublicChat, user: User, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt index af97803fc9..2986af0c7c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/RestrictChatMember.kt @@ -27,6 +27,7 @@ data class RestrictChatMember( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.restrictChatMember( chatId: ChatIdentifier, userId: UserId, @@ -34,6 +35,7 @@ suspend fun RequestsExecutor.restrictChatMember( permissions: ChatPermissions = ChatPermissions() ) = execute(RestrictChatMember(chatId, userId, untilDate, permissions)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.restrictChatMember( chat: PublicChat, userId: UserId, @@ -41,6 +43,7 @@ suspend fun RequestsExecutor.restrictChatMember( permissions: ChatPermissions = ChatPermissions() ) = restrictChatMember(chat.id, userId, untilDate, permissions) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.restrictChatMember( chatId: ChatId, user: User, @@ -48,6 +51,7 @@ suspend fun RequestsExecutor.restrictChatMember( permissions: ChatPermissions = ChatPermissions() ) = restrictChatMember(chatId, user.id, untilDate, permissions) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.restrictChatMember( chat: PublicChat, user: User, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt index 8af7c0e98d..91785b0299 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt @@ -34,24 +34,28 @@ data class SetChatAdministratorCustomTitle( } } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatAdministratorCustomTitle( chatId: ChatId, userId: UserId, customTitle: String ) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatAdministratorCustomTitle( chat: PublicChat, userId: UserId, customTitle: String ) = setChatAdministratorCustomTitle(chat.id, userId, customTitle) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatAdministratorCustomTitle( chatId: ChatId, user: User, customTitle: String ) = setChatAdministratorCustomTitle(chatId, user.id, customTitle) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatAdministratorCustomTitle( chat: PublicChat, user: User, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/UnbanChatMember.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/UnbanChatMember.kt index ec0cecb479..e9f1f3402f 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/UnbanChatMember.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/UnbanChatMember.kt @@ -21,21 +21,25 @@ data class UnbanChatMember( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unbanChatMember( chatId: ChatIdentifier, userId: UserId ) = execute(UnbanChatMember(chatId, userId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unbanChatMember( chat: PublicChat, userId: UserId ) = unbanChatMember(chat.id, userId) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unbanChatMember( chatId: ChatId, user: User ) = unbanChatMember(chatId, user.id) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unbanChatMember( chat: PublicChat, user: User diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt index 854782d7aa..1638ad3fd7 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/DeleteChatPhoto.kt @@ -21,10 +21,12 @@ data class DeleteChatPhoto( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteChatPhoto( chatId: ChatIdentifier ) = execute(DeleteChatPhoto(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteChatPhoto( chat: PublicChat ) = deleteChatPhoto(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt index b64f748a50..7733b54308 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/PinChatMessage.kt @@ -25,18 +25,21 @@ data class PinChatMessage ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.pinChatMessage( chatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false ) = execute(PinChatMessage(chatId, messageId, disableNotification)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.pinChatMessage( chat: PublicChat, messageId: MessageIdentifier, disableNotification: Boolean = false ) = pinChatMessage(chat.id, messageId, disableNotification) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.pinChatMessage( message: Message, disableNotification: Boolean = false diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt index 183b8881d0..f62656f2cc 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatDescription.kt @@ -28,11 +28,13 @@ data class SetChatDescription ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatDescription( chatId: ChatIdentifier, description: String ) = execute(SetChatDescription(chatId, description)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatDescription( chat: PublicChat, description: String diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPermissions.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPermissions.kt index b365d7fae9..6909f1426f 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPermissions.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPermissions.kt @@ -23,11 +23,13 @@ data class SetChatPermissions ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setDefaultChatMembersPermissions( chatId: ChatIdentifier, permissions: ChatPermissions ) = execute(SetChatPermissions(chatId, permissions)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setDefaultChatMembersPermissions( chat: PublicChat, permissions: ChatPermissions diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt index 0f8f50a36f..7d4ef9b408 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatPhoto.kt @@ -24,11 +24,13 @@ data class SetChatPhoto ( override val paramsJson: JsonObject = toJson(serializer()) } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatPhoto( chatId: ChatIdentifier, photo: MultipartFile ) = execute(SetChatPhoto(chatId, photo)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatPhoto( chat: PublicChat, photo: MultipartFile diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt index ad7546e0e1..d0117a6686 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/SetChatTitle.kt @@ -28,11 +28,13 @@ data class SetChatTitle ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatTitle( chatId: ChatIdentifier, title: String ) = execute(SetChatTitle(chatId, title)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatTitle( chat: PublicChat, title: String diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt index 9838fbb35a..c0cdbc7f5c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/modify/UnpinChatMessage.kt @@ -21,10 +21,12 @@ data class UnpinChatMessage( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unpinChatMessage( chatId: ChatIdentifier ) = execute(UnpinChatMessage(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.unpinChatMessage( chat: PublicChat ) = unpinChatMessage(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt index 3eaa41a211..1df3e03e47 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/DeleteChatStickerSet.kt @@ -21,10 +21,12 @@ data class DeleteChatStickerSet( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteChatStickerSet( chatId: ChatIdentifier ) = execute(DeleteChatStickerSet(chatId)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteChatStickerSet( chat: SupergroupChat ) = deleteChatStickerSet(chat.id) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt index 020c6d34f2..748b930a6f 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/stickers/SetChatStickerSet.kt @@ -22,11 +22,13 @@ data class SetChatStickerSet( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatStickerSet( chatId: ChatIdentifier, stickerSetName: StickerSetName ) = execute(SetChatStickerSet(chatId, stickerSetName)) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setChatStickerSet( chat: SupergroupChat, stickerSetName: StickerSetName diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt index 3be1fe7c8d..1608304333 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditChatMessageLiveLocation.kt @@ -32,6 +32,7 @@ data class EditChatMessageLiveLocation( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -44,6 +45,7 @@ suspend fun RequestsExecutor.editLiveLocation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( chat: Chat, messageId: MessageIdentifier, @@ -52,6 +54,7 @@ suspend fun RequestsExecutor.editLiveLocation( replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(chat.id, messageId, latitude, longitude, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( message: ContentMessage, latitude: Double, @@ -59,6 +62,7 @@ suspend fun RequestsExecutor.editLiveLocation( replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(message.chat, message.messageId, latitude, longitude, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -70,6 +74,7 @@ suspend fun RequestsExecutor.editLiveLocation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( chat: Chat, messageId: MessageIdentifier, @@ -77,6 +82,7 @@ suspend fun RequestsExecutor.editLiveLocation( replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( message: ContentMessage, location: Location, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt index 5388254674..b6bbdcb261 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/EditInlineMessageLiveLocation.kt @@ -22,6 +22,7 @@ data class EditInlineMessageLiveLocation( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( inlineMessageId: InlineMessageIdentifier, latitude: Double, @@ -32,6 +33,7 @@ suspend fun RequestsExecutor.editLiveLocation( inlineMessageId, latitude, longitude, replyMarkup ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editLiveLocation( inlineMessageId: InlineMessageIdentifier, location: Location, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt index 4b6243b941..2e0c77a80f 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopChatMessageLiveLocation.kt @@ -30,6 +30,7 @@ data class StopChatMessageLiveLocation( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -40,12 +41,14 @@ suspend fun RequestsExecutor.stopLiveLocation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopLiveLocation( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = stopLiveLocation(chat.id, messageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopLiveLocation( message: ContentMessage, replyMarkup: InlineKeyboardMarkup? = null diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt index 1e4ed274ec..e1003999cd 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/LiveLocation/StopInlineMessageLiveLocation.kt @@ -19,6 +19,7 @@ data class StopInlineMessageLiveLocation( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.stopLiveLocation( inlineMessageId: InlineMessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt index 9344e4432d..ebeb494fd4 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditChatMessageReplyMarkup.kt @@ -31,6 +31,7 @@ data class EditChatMessageReplyMarkup( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageReplyMarkup( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -39,12 +40,14 @@ suspend fun RequestsExecutor.editMessageReplyMarkup( EditChatMessageReplyMarkup(chatId, messageId, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageReplyMarkup( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = editMessageReplyMarkup(chat.id, messageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageReplyMarkup( message: Message, replyMarkup: InlineKeyboardMarkup? = null diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt index d02af7694d..5995a36c7e 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/ReplyMarkup/EditInlineMessageReplyMarkup.kt @@ -19,6 +19,7 @@ data class EditInlineMessageReplyMarkup( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageReplyMarkup( inlineMessageId: InlineMessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditChatMessageCaption.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditChatMessageCaption.kt index d3b95625bf..e818a68484 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditChatMessageCaption.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditChatMessageCaption.kt @@ -36,6 +36,7 @@ data class EditChatMessageCaption( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageCaption( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -46,6 +47,7 @@ suspend fun RequestsExecutor.editMessageCaption( EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageCaption( chat: Chat, messageId: MessageIdentifier, @@ -54,6 +56,7 @@ suspend fun RequestsExecutor.editMessageCaption( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageCaption( message: ContentMessage, text: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt index 5e14a6979c..59688e9763 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/caption/EditInlineMessageCaption.kt @@ -24,6 +24,7 @@ data class EditInlineMessageCaption( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageCaption( inlineMessageId: InlineMessageIdentifier, text: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditChatMessageMedia.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditChatMessageMedia.kt index fb836f0da3..ef7b97dede 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditChatMessageMedia.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditChatMessageMedia.kt @@ -41,6 +41,7 @@ data class EditChatMessageMedia( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageMedia( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -50,6 +51,7 @@ suspend fun RequestsExecutor.editMessageMedia( EditChatMessageMedia(chatId, messageId, media, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageMedia( chat: Chat, messageId: MessageIdentifier, @@ -57,6 +59,7 @@ suspend fun RequestsExecutor.editMessageMedia( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageMedia(chat.id, messageId, media, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageMedia( message: ContentMessage, media: InputMedia, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt index 428e7d960a..5d90e71ecb 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/media/EditInlineMessageMedia.kt @@ -29,6 +29,7 @@ data class EditInlineMessageMedia( override fun method(): String = editMessageMediaMethod } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageCaption( inlineMessageId: InlineMessageIdentifier, media: InputMedia, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditChatMessageText.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditChatMessageText.kt index 5cd1f304b0..416e75742b 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditChatMessageText.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditChatMessageText.kt @@ -37,6 +37,7 @@ data class EditChatMessageText( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageText( chatId: ChatIdentifier, messageId: MessageIdentifier, @@ -48,6 +49,7 @@ suspend fun RequestsExecutor.editMessageText( EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageText( chat: Chat, messageId: MessageIdentifier, @@ -57,6 +59,7 @@ suspend fun RequestsExecutor.editMessageText( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageText( message: ContentMessage, text: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt index fb09e55d3a..6446baff02 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/edit/text/EditInlineMessageText.kt @@ -27,6 +27,7 @@ data class EditInlineMessageText( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.editMessageText( inlineMessageId: InlineMessageIdentifier, text: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt index ca2f1256ec..26418f9c47 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByChat.kt @@ -23,6 +23,7 @@ data class GetGameHighScoresByChat ( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( userId: UserId, chatId: ChatId, @@ -31,6 +32,7 @@ suspend fun RequestsExecutor.getGameScore( GetGameHighScoresByChat(userId, chatId, messageId) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( user: CommonUser, chatId: ChatId, @@ -39,6 +41,7 @@ suspend fun RequestsExecutor.getGameScore( user.id, chatId, messageId ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( userId: UserId, chat: Chat, @@ -47,6 +50,7 @@ suspend fun RequestsExecutor.getGameScore( userId, chat.id, messageId ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( user: CommonUser, chat: Chat, @@ -55,6 +59,7 @@ suspend fun RequestsExecutor.getGameScore( user.id, chat.id, messageId ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( userId: UserId, message: ContentMessage @@ -62,6 +67,7 @@ suspend fun RequestsExecutor.getGameScore( userId, message.chat.id, message.messageId ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( user: CommonUser, message: ContentMessage diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt index c7938b5347..5ad5b14f36 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/GetGameHighScoresByInlineMessageId.kt @@ -17,6 +17,7 @@ data class GetGameHighScoresByInlineMessageId ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( userId: UserId, inlineMessageId: InlineMessageIdentifier @@ -26,6 +27,7 @@ suspend fun RequestsExecutor.getGameScore( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getGameScore( user: CommonUser, inlineMessageId: InlineMessageIdentifier diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt index 36c157a8ec..e31090cb09 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByChatId.kt @@ -29,6 +29,7 @@ data class SetGameScoreByChatId ( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( userId: UserId, score: Long, @@ -40,6 +41,7 @@ suspend fun RequestsExecutor.setGameScore( SetGameScoreByChatId(userId, score, chatId, messageId, force, disableEditMessage) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( user: CommonUser, score: Long, @@ -51,6 +53,7 @@ suspend fun RequestsExecutor.setGameScore( user.id, score, chatId, messageId, force, disableEditMessage ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( userId: UserId, score: Long, @@ -62,6 +65,7 @@ suspend fun RequestsExecutor.setGameScore( userId, score, chat.id, messageId, force, disableEditMessage ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( user: CommonUser, score: Long, @@ -73,6 +77,7 @@ suspend fun RequestsExecutor.setGameScore( user.id, score, chat.id, messageId, force, disableEditMessage ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( userId: UserId, score: Long, @@ -83,6 +88,7 @@ suspend fun RequestsExecutor.setGameScore( userId, score, message.chat.id, message.messageId, force, disableEditMessage ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( user: CommonUser, score: Long, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt index 9a6794c826..87f74dae91 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/games/SetGameScoreByInlineMessageId.kt @@ -23,6 +23,7 @@ data class SetGameScoreByInlineMessageId ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( userId: UserId, score: Long, @@ -35,6 +36,7 @@ suspend fun RequestsExecutor.setGameScore( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setGameScore( user: CommonUser, score: Long, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetFile.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetFile.kt index 7cdc4b0791..74c689a05c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetFile.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetFile.kt @@ -20,12 +20,14 @@ data class GetFile( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getFileAdditionalInfo( fileId: FileId ) = execute( GetFile(fileId) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getFileAdditionalInfo( file: TelegramMediaFile ) = getFileAdditionalInfo(file.fileId) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetStickerSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetStickerSet.kt index 51da528a29..ccc410e957 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetStickerSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetStickerSet.kt @@ -19,12 +19,14 @@ data class GetStickerSet( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getStickerSet( name: String ) = execute( GetStickerSet(name) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getStickerSet( sticker: Sticker ) = getStickerSet( diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetUserProfilePhotos.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetUserProfilePhotos.kt index 3aba2e74fc..84b12ec02c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetUserProfilePhotos.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/get/GetUserProfilePhotos.kt @@ -30,6 +30,7 @@ data class GetUserProfilePhotos( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getUserProfilePhotos( userId: UserId, offset: Int? = null, @@ -40,6 +41,7 @@ suspend fun RequestsExecutor.getUserProfilePhotos( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getUserProfilePhotos( user: CommonUser, offset: Int? = null, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendAction.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendAction.kt index 95de49a2ed..f6b4185dc0 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendAction.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendAction.kt @@ -26,6 +26,7 @@ data class SendAction( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendBotAction( chatId: ChatIdentifier, action: BotAction @@ -33,89 +34,110 @@ suspend fun RequestsExecutor.sendBotAction( SendAction(chatId, action) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendBotAction( chat: Chat, action: BotAction ) = sendBotAction(chat.id, action) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionTyping( chatId: ChatIdentifier ) = sendBotAction(chatId, TypingAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadPhoto( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadPhotoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordVideo( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordVideoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadVideo( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadVideoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordAudio( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordAudioAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadAudio( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadAudioAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadDocument( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadDocumentAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionFindLocation( chatId: ChatIdentifier ) = sendBotAction(chatId, FindLocationAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordVideoNote( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordVideoNoteAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadVideoNote( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadVideoNoteAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionTyping( chat: Chat ) = sendBotAction(chat, TypingAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadPhoto( chat: Chat ) = sendBotAction(chat, UploadPhotoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordVideo( chat: Chat ) = sendBotAction(chat, RecordVideoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadVideo( chat: Chat ) = sendBotAction(chat, UploadVideoAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordAudio( chat: Chat ) = sendBotAction(chat, RecordAudioAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadAudio( chat: Chat ) = sendBotAction(chat, UploadAudioAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadDocument( chat: Chat ) = sendBotAction(chat, UploadDocumentAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionFindLocation( chat: Chat ) = sendBotAction(chat, FindLocationAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionRecordVideoNote( chat: Chat ) = sendBotAction(chat, RecordVideoNoteAction) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendActionUploadVideoNote( chat: Chat ) = sendBotAction(chat, UploadVideoNoteAction) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendContact.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendContact.kt index 054ddc68a9..b98fc8f936 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendContact.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendContact.kt @@ -69,6 +69,7 @@ fun Contact.toRequest( replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendContact( chatId: ChatIdentifier, phoneNumber: String, @@ -83,6 +84,7 @@ suspend fun RequestsExecutor.sendContact( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendContact( chatId: ChatIdentifier, contact: Contact, @@ -95,6 +97,7 @@ suspend fun RequestsExecutor.sendContact( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendContact( chat: Chat, phoneNumber: String, @@ -107,6 +110,7 @@ suspend fun RequestsExecutor.sendContact( chat.id, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendContact( chat: Chat, contact: Contact, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendLocation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendLocation.kt index ecb4d8d60f..7367654f96 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendLocation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendLocation.kt @@ -50,6 +50,7 @@ data class SendLocation( } } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendLocation( chatId: ChatIdentifier, latitude: Double, @@ -68,6 +69,7 @@ suspend fun RequestsExecutor.sendLocation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendLocation( chatId: ChatIdentifier, location: Location, @@ -83,6 +85,7 @@ suspend fun RequestsExecutor.sendLocation( replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendLocation( chat: Chat, latitude: Double, @@ -99,6 +102,7 @@ suspend fun RequestsExecutor.sendLocation( replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendLocation( chat: Chat, location: Location, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt index 8594d7400d..99f7c7b7b0 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendMessage.kt @@ -58,6 +58,7 @@ data class SendTextMessage( ) typealias SendMessage = SendTextMessage +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendMessage( chatId: ChatIdentifier, text: String, @@ -70,6 +71,7 @@ suspend fun RequestsExecutor.sendMessage( SendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendTextMessage( chatId: ChatIdentifier, text: String, @@ -82,6 +84,7 @@ suspend fun RequestsExecutor.sendTextMessage( chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendMessage( chat: Chat, text: String, @@ -93,6 +96,7 @@ suspend fun RequestsExecutor.sendMessage( ) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendTextMessage( chat: Chat, text: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendVenue.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendVenue.kt index d675b6d394..0bb20b9c4d 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendVenue.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/SendVenue.kt @@ -76,6 +76,7 @@ fun Venue.toRequest( replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVenue( chatId: ChatIdentifier, latitude: Double, @@ -92,6 +93,7 @@ suspend fun RequestsExecutor.sendVenue( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVenue( chat: Chat, latitude: Double, @@ -106,6 +108,7 @@ suspend fun RequestsExecutor.sendVenue( chat.id, latitude, longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVenue( chatId: ChatIdentifier, venue: Venue, @@ -118,6 +121,7 @@ suspend fun RequestsExecutor.sendVenue( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVenue( chat: Chat, venue: Venue, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt index d254bc29ba..bf06621d67 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/games/SendGame.kt @@ -36,6 +36,7 @@ data class SendGame ( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendGame( chatId: ChatIdentifier, gameShortName: String, @@ -48,6 +49,7 @@ suspend fun RequestsExecutor.sendGame( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendGame( chat: Chat, gameShortName: String, @@ -58,6 +60,7 @@ suspend fun RequestsExecutor.sendGame( chat.id, gameShortName, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendGame( chatId: ChatIdentifier, game: Game, @@ -68,6 +71,7 @@ suspend fun RequestsExecutor.sendGame( chatId, game.title, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendGame( chat: Chat, game: Game, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAnimation.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAnimation.kt index e8be272d5d..08140cec76 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAnimation.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAnimation.kt @@ -116,6 +116,7 @@ data class SendAnimationFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: FileId, @@ -144,6 +145,7 @@ suspend fun RequestsExecutor.sendAnimation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: AnimationFile, @@ -157,6 +159,7 @@ suspend fun RequestsExecutor.sendAnimation( chatId, animation.fileId, thumb ?.fileId, text, parseMode, animation.duration, animation.width, animation.height, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: MultipartFile, @@ -178,6 +181,7 @@ suspend fun RequestsExecutor.sendAnimation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: MultipartFile, @@ -199,6 +203,7 @@ suspend fun RequestsExecutor.sendAnimation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: FileId, @@ -220,6 +225,7 @@ suspend fun RequestsExecutor.sendAnimation( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: MultipartFile, @@ -236,6 +242,7 @@ suspend fun RequestsExecutor.sendAnimation( chatId, animation, thumb ?.fileId , text, parseMode, duration, width, height, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAnimation( chatId: ChatIdentifier, animation: AnimationFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt index 19bf99e4df..030377b127 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendAudio.kt @@ -118,6 +118,7 @@ data class SendAudioFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: FileId, @@ -146,6 +147,7 @@ suspend fun RequestsExecutor.sendAudio( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: AudioFile, @@ -160,6 +162,7 @@ suspend fun RequestsExecutor.sendAudio( chatId, audio.fileId, thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: MultipartFile, @@ -181,6 +184,7 @@ suspend fun RequestsExecutor.sendAudio( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: MultipartFile, @@ -202,6 +206,7 @@ suspend fun RequestsExecutor.sendAudio( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: FileId, @@ -223,6 +228,7 @@ suspend fun RequestsExecutor.sendAudio( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: MultipartFile, @@ -239,6 +245,7 @@ suspend fun RequestsExecutor.sendAudio( chatId, audio, thumb ?.fileId , text, parseMode, duration, performer, title, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendAudio( chatId: ChatIdentifier, audio: AudioFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendDocument.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendDocument.kt index e770bc6f4e..78e11e7167 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendDocument.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendDocument.kt @@ -102,6 +102,7 @@ data class SendDocumentFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: FileId, @@ -124,6 +125,7 @@ suspend fun RequestsExecutor.sendDocument( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: DocumentFile, @@ -137,6 +139,7 @@ suspend fun RequestsExecutor.sendDocument( chatId, document.fileId, thumb ?.fileId, text, parseMode, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: MultipartFile, @@ -155,6 +158,7 @@ suspend fun RequestsExecutor.sendDocument( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: MultipartFile, @@ -173,6 +177,7 @@ suspend fun RequestsExecutor.sendDocument( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: FileId, @@ -191,6 +196,7 @@ suspend fun RequestsExecutor.sendDocument( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: MultipartFile, @@ -204,6 +210,7 @@ suspend fun RequestsExecutor.sendDocument( chatId, document, thumb ?.fileId , text, parseMode, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendDocument( chatId: ChatIdentifier, document: DocumentFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendMediaGroup.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendMediaGroup.kt index 3a1f6ce296..63bae97836 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendMediaGroup.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendMediaGroup.kt @@ -88,6 +88,7 @@ data class SendMediaGroupFiles internal constructor( val files: List ) : Files by (files.map { it.fileId to it }.toMap()) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendMediaGroup( chatId: ChatIdentifier, media: List, @@ -99,6 +100,7 @@ suspend fun RequestsExecutor.sendMediaGroup( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendMediaGroup( chat: Chat, media: List, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendPhoto.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendPhoto.kt index 8edecd4053..289985641c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendPhoto.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendPhoto.kt @@ -86,6 +86,7 @@ data class SendPhotoFiles internal constructor( photoField to photo ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chatId: ChatIdentifier, fileId: FileId, @@ -106,6 +107,7 @@ suspend fun RequestsExecutor.sendPhoto( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chatId: ChatIdentifier, file: PhotoSize, @@ -118,6 +120,7 @@ suspend fun RequestsExecutor.sendPhoto( chatId, file.fileId, caption, parseMode, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chatId: ChatIdentifier, photo: Photo, @@ -130,6 +133,7 @@ suspend fun RequestsExecutor.sendPhoto( chatId, photo.biggest() ?: throw IllegalArgumentException("Photo $photo is empty"), caption, parseMode, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chat: Chat, fileId: FileId, @@ -148,6 +152,7 @@ suspend fun RequestsExecutor.sendPhoto( replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chat: Chat, file: PhotoSize, @@ -160,6 +165,7 @@ suspend fun RequestsExecutor.sendPhoto( chat.id, file.fileId, caption, parseMode, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendPhoto( chat: Chat, photo: Photo, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendSticker.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendSticker.kt index b40049e547..3fbfd21974 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendSticker.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendSticker.kt @@ -67,6 +67,7 @@ data class SendStickerByFile internal constructor( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chatId: ChatIdentifier, sticker: FileId, @@ -77,6 +78,7 @@ suspend fun RequestsExecutor.sendSticker( SendStickerByFileId(chatId, sticker, disableNotification, replyToMessageId, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chatId: ChatIdentifier, sticker: MultipartFile, @@ -90,6 +92,7 @@ suspend fun RequestsExecutor.sendSticker( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chat: Chat, sticker: FileId, @@ -98,6 +101,7 @@ suspend fun RequestsExecutor.sendSticker( replyMarkup: KeyboardMarkup? = null ) = sendSticker(chat.id, sticker, disableNotification, replyToMessageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chat: Chat, sticker: MultipartFile, @@ -106,6 +110,7 @@ suspend fun RequestsExecutor.sendSticker( replyMarkup: KeyboardMarkup? = null ) = sendSticker(chat.id, sticker, disableNotification, replyToMessageId, replyMarkup) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chatId: ChatIdentifier, sticker: Sticker, @@ -116,6 +121,7 @@ suspend fun RequestsExecutor.sendSticker( chatId, sticker.fileId, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendSticker( chat: Chat, sticker: Sticker, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideo.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideo.kt index b14c50ee16..0ff86d9ab0 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideo.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideo.kt @@ -120,6 +120,7 @@ data class SendVideoFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: FileId, @@ -149,6 +150,7 @@ suspend fun RequestsExecutor.sendVideo( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: VideoFile, @@ -162,6 +164,7 @@ suspend fun RequestsExecutor.sendVideo( chatId, video.fileId, thumb ?.fileId, text, parseMode, video.duration, video.width, video.height, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: MultipartFile, @@ -184,6 +187,7 @@ suspend fun RequestsExecutor.sendVideo( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: MultipartFile, @@ -206,6 +210,7 @@ suspend fun RequestsExecutor.sendVideo( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: FileId, @@ -227,6 +232,7 @@ suspend fun RequestsExecutor.sendVideo( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: MultipartFile, @@ -244,6 +250,7 @@ suspend fun RequestsExecutor.sendVideo( chatId, video, thumb ?.fileId , text, parseMode, duration, width, height, supportStreaming, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideo( chatId: ChatIdentifier, video: VideoFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideoNote.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideoNote.kt index 0062f8c6bd..6f711dba41 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideoNote.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVideoNote.kt @@ -115,6 +115,7 @@ data class SendVideoNoteFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: FileId, @@ -141,6 +142,7 @@ suspend fun RequestsExecutor.sendVideoNote( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: VideoFile, @@ -154,6 +156,7 @@ suspend fun RequestsExecutor.sendVideoNote( chatId, videoNote.fileId, thumb ?.fileId, text, parseMode, videoNote.duration, videoNote.width, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: MultipartFile, @@ -174,6 +177,7 @@ suspend fun RequestsExecutor.sendVideoNote( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: MultipartFile, @@ -194,6 +198,7 @@ suspend fun RequestsExecutor.sendVideoNote( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: FileId, @@ -214,6 +219,7 @@ suspend fun RequestsExecutor.sendVideoNote( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: MultipartFile, @@ -229,6 +235,7 @@ suspend fun RequestsExecutor.sendVideoNote( chatId, videoNote, thumb ?.fileId , text, parseMode, duration, size, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVideoNote( chatId: ChatIdentifier, videoNote: VideoFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVoice.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVoice.kt index 6f87306573..46b6e3c499 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVoice.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/SendVoice.kt @@ -107,6 +107,7 @@ data class SendVoiceFiles internal constructor( thumbField to thumb ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: FileId, @@ -131,6 +132,7 @@ suspend fun RequestsExecutor.sendVoice( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: AudioFile, @@ -144,6 +146,7 @@ suspend fun RequestsExecutor.sendVoice( chatId, voice.fileId, thumb ?.fileId, text, parseMode, voice.duration, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: MultipartFile, @@ -163,6 +166,7 @@ suspend fun RequestsExecutor.sendVoice( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: MultipartFile, @@ -182,6 +186,7 @@ suspend fun RequestsExecutor.sendVoice( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: FileId, @@ -201,6 +206,7 @@ suspend fun RequestsExecutor.sendVoice( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: MultipartFile, @@ -215,6 +221,7 @@ suspend fun RequestsExecutor.sendVoice( chatId, voice, thumb ?.fileId , text, parseMode, duration, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendVoice( chatId: ChatIdentifier, voice: AudioFile, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt index 841948d174..74579a267c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/payments/SendInvoice.kt @@ -107,6 +107,7 @@ data class SendInvoice( } } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendInvoice( chatId: ChatId, title: String, @@ -131,6 +132,7 @@ suspend fun RequestsExecutor.sendInvoice( SendInvoice(chatId, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, replyMarkup) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendInvoice( user: CommonUser, title: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt index 40795135fd..1298576c65 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt @@ -187,6 +187,7 @@ data class SendQuizPoll( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendRegularPoll( chatId: ChatIdentifier, question: String, @@ -202,6 +203,7 @@ suspend fun RequestsExecutor.sendRegularPoll( chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendRegularPoll( chatId: ChatIdentifier, poll: RegularPoll, @@ -219,6 +221,7 @@ suspend fun RequestsExecutor.sendRegularPoll( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendRegularPoll( chat: Chat, question: String, @@ -233,6 +236,7 @@ suspend fun RequestsExecutor.sendRegularPoll( chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendRegularPoll( chat: Chat, poll: RegularPoll, @@ -249,6 +253,7 @@ suspend fun RequestsExecutor.sendRegularPoll( ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendQuizPoll( chatId: ChatIdentifier, question: String, @@ -265,6 +270,7 @@ suspend fun RequestsExecutor.sendQuizPoll( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendQuizPoll( chat: Chat, question: String, @@ -279,6 +285,7 @@ suspend fun RequestsExecutor.sendQuizPoll( chat.id, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendQuizPoll( chatId: ChatIdentifier, isClosed: Boolean = false, @@ -296,6 +303,7 @@ suspend fun RequestsExecutor.sendQuizPoll( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.sendQuizPoll( chat: Chat, isClosed: Boolean = false, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/AddStickerToSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/AddStickerToSet.kt index ac09f673fd..4069488cc5 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/AddStickerToSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/AddStickerToSet.kt @@ -51,6 +51,7 @@ data class AddStickerToSet internal constructor( override fun method(): String = "addStickerToSet" } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( userId: UserId, stickerSetName: String, @@ -63,6 +64,7 @@ suspend fun RequestsExecutor.addStickerToSet( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( userId: UserId, stickerSetName: String, @@ -78,6 +80,7 @@ suspend fun RequestsExecutor.addStickerToSet( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( user: CommonUser, stickerSetName: String, @@ -88,6 +91,7 @@ suspend fun RequestsExecutor.addStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( user: CommonUser, stickerSetName: String, @@ -98,6 +102,7 @@ suspend fun RequestsExecutor.addStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( userId: UserId, stickerSet: StickerSet, @@ -108,6 +113,7 @@ suspend fun RequestsExecutor.addStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( userId: UserId, stickerSet: StickerSet, @@ -118,6 +124,7 @@ suspend fun RequestsExecutor.addStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( user: CommonUser, stickerSet: StickerSet, @@ -128,6 +135,7 @@ suspend fun RequestsExecutor.addStickerToSet( user.id, stickerSet.name, sticker, emojis, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.addStickerToSet( user: CommonUser, stickerSet: StickerSet, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/CreateNewStickerSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/CreateNewStickerSet.kt index 9b1ba21a0d..dc808522b7 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/CreateNewStickerSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/CreateNewStickerSet.kt @@ -54,6 +54,7 @@ data class CreateNewStickerSet internal constructor( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.createNewStickerSet( userId: UserId, name: String, @@ -65,6 +66,7 @@ suspend fun RequestsExecutor.createNewStickerSet( CreateNewStickerSet(userId, name, emojis, sticker, containsMasks, maskPosition) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.createNewStickerSet( userId: UserId, name: String, @@ -80,6 +82,7 @@ suspend fun RequestsExecutor.createNewStickerSet( ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.createNewStickerSet( user: CommonUser, name: String, @@ -91,6 +94,7 @@ suspend fun RequestsExecutor.createNewStickerSet( user.id, name, sticker, emojis, containsMasks, maskPosition ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.createNewStickerSet( user: CommonUser, name: String, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/DeleteStickerFromSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/DeleteStickerFromSet.kt index daea8cbf4e..ce667ab7e7 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/DeleteStickerFromSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/DeleteStickerFromSet.kt @@ -22,6 +22,7 @@ data class DeleteStickerFromSet( +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteStickerFromSet( sticker: FileId ) = execute( @@ -30,6 +31,7 @@ suspend fun RequestsExecutor.deleteStickerFromSet( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.deleteStickerFromSet( sticker: Sticker ) = deleteStickerFromSet( diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/SetStickerPositionInSet.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/SetStickerPositionInSet.kt index 90484177cf..5f6e5f3890 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/SetStickerPositionInSet.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/SetStickerPositionInSet.kt @@ -29,6 +29,7 @@ data class SetStickerPositionInSet( get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setStickerPositionInSet( sticker: FileId, position: Int @@ -39,6 +40,7 @@ suspend fun RequestsExecutor.setStickerPositionInSet( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setStickerPositionInSet( sticker: Sticker, position: Int diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/UploadStickerFile.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/UploadStickerFile.kt index 43fc8b5f5a..68c39c8a9d 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/UploadStickerFile.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/stickers/UploadStickerFile.kt @@ -30,6 +30,7 @@ data class UploadStickerFile( } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.uploadStickerFile( userId: UserId, sticker: MultipartFile @@ -37,6 +38,7 @@ suspend fun RequestsExecutor.uploadStickerFile( UploadStickerFile(userId, sticker) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.uploadStickerFile( user: CommonUser, sticker: MultipartFile diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/GetWebhookInfo.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/GetWebhookInfo.kt index b7c462b355..1d3332f4a6 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/GetWebhookInfo.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/GetWebhookInfo.kt @@ -15,4 +15,5 @@ class GetWebhookInfo : SimpleRequest { get() = serializer() } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.getWebhookInfo() = execute(GetWebhookInfo()) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/SetWebhook.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/SetWebhook.kt index 78a68c72b5..71fe700ae8 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/SetWebhook.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/webhook/SetWebhook.kt @@ -66,6 +66,7 @@ data class SetWebhook internal constructor( } } +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setWebhookInfo( url: String, certificate: FileId, @@ -77,6 +78,7 @@ suspend fun RequestsExecutor.setWebhookInfo( ) ) +@Deprecated("Deprecated due to extracting into separated library") suspend fun RequestsExecutor.setWebhookInfo( url: String, certificate: MultipartFile,