From bec1255d672e809129d6d88f245560abbc16b632 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 4 Oct 2020 13:18:24 +0600 Subject: [PATCH] replaces of RequestsExecutor by TelegramBot typealias in TelegramBotAPI-extensions-api --- CHANGELOG.md | 3 +- .../extensions/api/BotBuilder.kt | 6 +-- .../extensions/api/BotExtensions.kt | 16 +++---- .../extensions/api/DeleteMessage.kt | 10 ++-- .../extensions/api/ForwardMessage.kt | 14 +++--- .../extensions/api/GetUpdates.kt | 6 +-- .../extensions/api/LiveLocation.kt | 12 ++--- .../TelegramBotAPI/extensions/api/StopPoll.kt | 10 ++-- .../api/answers/AnswerCallbackQuery.kt | 6 +-- .../api/answers/AnswerInlineQuery.kt | 6 +-- .../payments/AnswerPreCheckoutQuery.kt | 10 ++-- .../answers/payments/AnswerShippingQuery.kt | 10 ++-- .../extensions/api/bot/GetMe.kt | 4 +- .../extensions/api/bot/GetMyCommands.kt | 4 +- .../extensions/api/bot/SetMyCommands.kt | 6 +-- .../api/chat/ExportChatInviteLink.kt | 6 +-- .../extensions/api/chat/LeaveChat.kt | 6 +-- .../extensions/api/chat/get/GetChat.kt | 26 +++++------ .../api/chat/get/GetChatAdministrators.kt | 6 +-- .../api/chat/get/GetChatMembersCount.kt | 6 +-- .../api/chat/members/GetChatMember.kt | 10 ++-- .../api/chat/members/KickChatMember.kt | 10 ++-- .../api/chat/members/PromoteChatMember.kt | 10 ++-- .../api/chat/members/RestrictChatMember.kt | 10 ++-- .../SetChatAdministratorCustomTitle.kt | 10 ++-- .../api/chat/members/UnbanChatMember.kt | 10 ++-- .../api/chat/modify/DeleteChatPhoto.kt | 6 +-- .../api/chat/modify/PinChatMessage.kt | 8 ++-- .../api/chat/modify/SetChatDescription.kt | 6 +-- .../api/chat/modify/SetChatPermissions.kt | 6 +-- .../api/chat/modify/SetChatPhoto.kt | 6 +-- .../api/chat/modify/SetChatTitle.kt | 6 +-- .../api/chat/modify/UnpinChatMessage.kt | 6 +-- .../api/chat/stickers/DeleteChatStickerSet.kt | 6 +-- .../api/chat/stickers/SetChatStickerSet.kt | 6 +-- .../EditChatMessageLiveLocation.kt | 14 +++--- .../EditInlineMessageLiveLocation.kt | 6 +-- .../StopChatMessageLiveLocation.kt | 8 ++-- .../StopInlineMessageLiveLocation.kt | 4 +- .../ReplyMarkup/EditChatMessageReplyMarkup.kt | 8 ++-- .../EditInlineMessageReplyMarkup.kt | 4 +- .../edit/caption/EditChatMessageCaption.kt | 8 ++-- .../edit/caption/EditInlineMessageCaption.kt | 4 +- .../api/edit/media/EditChatMessageMedia.kt | 8 ++-- .../api/edit/media/EditInlineMessageMedia.kt | 4 +- .../api/edit/text/EditChatMessageText.kt | 8 ++-- .../api/edit/text/EditInlineMessageText.kt | 4 +- .../api/games/GetGameHighScoresByChat.kt | 14 +++--- .../GetGameHighScoresByInlineMessageId.kt | 6 +-- .../api/games/SetGameScoreByChatId.kt | 14 +++--- .../games/SetGameScoreByInlineMessageId.kt | 6 +-- .../extensions/api/get/GetFile.kt | 6 +-- .../extensions/api/get/GetStickerSet.kt | 6 +-- .../api/get/GetUserProfilePhotos.kt | 6 +-- .../extensions/api/send/SendAction.kt | 46 +++++++++---------- .../extensions/api/send/SendContact.kt | 10 ++-- .../extensions/api/send/SendDice.kt | 6 +-- .../extensions/api/send/SendLocation.kt | 10 ++-- .../extensions/api/send/SendMessage.kt | 10 ++-- .../extensions/api/send/SendVenue.kt | 14 +++--- .../extensions/api/send/games/SendGame.kt | 10 ++-- .../api/send/media/SendAnimation.kt | 6 +-- .../extensions/api/send/media/SendAudio.kt | 6 +-- .../extensions/api/send/media/SendDocument.kt | 6 +-- .../api/send/media/SendMediaGroup.kt | 6 +-- .../extensions/api/send/media/SendPhoto.kt | 4 +- .../extensions/api/send/media/SendSticker.kt | 4 +- .../extensions/api/send/media/SendVideo.kt | 6 +-- .../api/send/media/SendVideoNote.kt | 6 +-- .../extensions/api/send/media/SendVoice.kt | 6 +-- .../api/send/payments/SendInvoice.kt | 6 +-- .../extensions/api/send/polls/SendPoll.kt | 18 ++++---- .../api/stickers/AddAnimatedStickerToSet.kt | 18 ++++---- .../api/stickers/AddStaticStickerToSet.kt | 18 ++++---- .../stickers/CreateNewAnimatedStickerSet.kt | 10 ++-- .../api/stickers/CreateNewStaticStickerSet.kt | 10 ++-- .../api/stickers/DeleteStickerFromSet.kt | 6 +-- .../api/stickers/SetStickerPositionInSet.kt | 6 +-- .../api/stickers/SetStickerSetThumb.kt | 18 ++++---- .../api/stickers/UploadStickerFile.kt | 6 +-- .../extensions/api/webhook/DeleteWebhook.kt | 4 +- .../extensions/api/webhook/GetWebhookInfo.kt | 4 +- .../extensions/api/webhook/SetWebhookInfo.kt | 8 ++-- 83 files changed, 358 insertions(+), 357 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccd97637d0..92eb881443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,8 @@ * `TelegramBotAPI-core`: * Now in forward info you can get `ForwardFromSupergroupInfo` - +* `TelegramBotAPI-extensions-api`: + * ALL REQUESTS EXECUTOR USAGES WERE REPLACED WITH `TelegramBot` TYPEALIAS. It should not bring any break changes ### 0.28.4 * `Common`: diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt index adc0c53648..c7692ff2f3 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.utils.TelegramAPIUrlsKeeper import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig @@ -33,13 +33,13 @@ data class BotBuilder internal constructor( } /** - * @return Created by [telegramBotWithCustomClientConfig] function [RequestsExecutor]. This executor will be preconfigured using [token] and + * @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and * [block] */ fun telegramBot( token: String, block: BotBuilder.() -> Unit -): RequestsExecutor = telegramBot( +): TelegramBot = telegramBot( TelegramAPIUrlsKeeper(token), BotBuilder().apply(block).createHttpClient() ) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt index 2342fac9f9..144b04f917 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.utils.TelegramAPIUrlsKeeper import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig @@ -13,7 +13,7 @@ import io.ktor.client.engine.HttpClientEngine fun telegramBot( urlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient = HttpClient() -): RequestsExecutor = KtorRequestsExecutor( +): TelegramBot = KtorRequestsExecutor( urlsKeeper, client ) @@ -26,7 +26,7 @@ fun telegramBotWithCustomClientConfig( urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {} -): RequestsExecutor = telegramBot( +): TelegramBot = telegramBot( urlsKeeper, HttpClient(clientEngine, clientConfig) ) @@ -37,7 +37,7 @@ fun telegramBotWithCustomClientConfig( fun telegramBotWithCustomClientConfig( urlsKeeper: TelegramAPIUrlsKeeper, clientConfig: HttpClientConfig<*>.() -> Unit = {} -): RequestsExecutor = telegramBot( +): TelegramBot = telegramBot( urlsKeeper, HttpClient(clientConfig) ) @@ -47,7 +47,7 @@ fun telegramBotWithCustomClientConfig( */ fun telegramBot( token: String -): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token)) +): TelegramBot = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token)) /** * Allows to create bot using bot [token] and already prepared [client] @@ -55,7 +55,7 @@ fun telegramBot( fun telegramBot( token: String, client: HttpClient -): RequestsExecutor = telegramBot(TelegramAPIUrlsKeeper(token), client) +): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token), client) /** * Allows to create bot using bot [token] and configure [HttpClient] using [clientConfig] @@ -63,7 +63,7 @@ fun telegramBot( fun telegramBotWithCustomClientConfig( token: String, clientConfig: HttpClientConfig<*>.() -> Unit -): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientConfig) +): TelegramBot = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientConfig) /** * Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally @@ -73,4 +73,4 @@ fun telegramBot( token: String, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {} -): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientEngine, clientConfig) +): TelegramBot = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientEngine, clientConfig) 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 index 70039acd22..b1ccb517a3 100644 --- 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 @@ -1,28 +1,28 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.deleteMessage( chatId: ChatIdentifier, messageId: MessageIdentifier ) = execute( DeleteMessage(chatId, messageId) ) -suspend fun RequestsExecutor.deleteMessage( +suspend fun TelegramBot.deleteMessage( chat: Chat, messageId: MessageIdentifier ) = deleteMessage(chat.id, messageId) -suspend fun RequestsExecutor.deleteMessage( +suspend fun TelegramBot.deleteMessage( message: Message ) = deleteMessage(message.chat, message.messageId) suspend fun Message.delete( - requestsExecutor: RequestsExecutor + requestsExecutor: TelegramBot ) = 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 index ea73e06de3..55c878591e 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.forwardMessage( fromChatId: ChatIdentifier, toChatId: ChatIdentifier, messageId: MessageIdentifier, @@ -16,34 +16,34 @@ suspend fun RequestsExecutor.forwardMessage( ForwardMessage(fromChatId, toChatId, messageId, disableNotification) ) -suspend fun RequestsExecutor.forwardMessage( +suspend fun TelegramBot.forwardMessage( fromChat: Chat, toChatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false ) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification) -suspend fun RequestsExecutor.forwardMessage( +suspend fun TelegramBot.forwardMessage( fromChatId: ChatIdentifier, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false ) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification) -suspend fun RequestsExecutor.forwardMessage( +suspend fun TelegramBot.forwardMessage( fromChat: Chat, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false ) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification) -suspend fun RequestsExecutor.forwardMessage( +suspend fun TelegramBot.forwardMessage( toChatId: ChatIdentifier, message: Message, disableNotification: Boolean = false ) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification) -suspend fun RequestsExecutor.forwardMessage( +suspend fun TelegramBot.forwardMessage( toChat: Chat, message: Message, disableNotification: Boolean = false 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 index 778ef5e983..4cf52833eb 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.GetUpdates import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update -suspend fun RequestsExecutor.getUpdates( +suspend fun TelegramBot.getUpdates( offset: UpdateIdentifier? = null, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, @@ -16,7 +16,7 @@ suspend fun RequestsExecutor.getUpdates( ) ) -suspend fun RequestsExecutor.getUpdates( +suspend fun TelegramBot.getUpdates( lastUpdate: Update, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, 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 index 144dc30d3c..b57ec1254e 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation.editLiveLocation import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation.stopLiveLocation import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendLocation @@ -19,7 +19,7 @@ import kotlin.math.ceil private val livePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L class LiveLocation internal constructor( - private val requestsExecutor: RequestsExecutor, + private val requestsExecutor: TelegramBot, scope: CoroutineScope, autoCloseTimeDelay: Double, initMessage: ContentMessage @@ -66,7 +66,7 @@ class LiveLocation internal constructor( } } -suspend fun RequestsExecutor.startLiveLocation( +suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chatId: ChatIdentifier, latitude: Double, @@ -97,7 +97,7 @@ suspend fun RequestsExecutor.startLiveLocation( ) } -suspend fun RequestsExecutor.startLiveLocation( +suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chat: Chat, latitude: Double, @@ -110,7 +110,7 @@ suspend fun RequestsExecutor.startLiveLocation( scope, chat.id, latitude, longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.startLiveLocation( +suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chatId: ChatId, location: Location, @@ -122,7 +122,7 @@ suspend fun RequestsExecutor.startLiveLocation( scope, chatId, location.latitude, location.longitude, liveTimeMillis, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.startLiveLocation( +suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chat: Chat, location: Location, 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 index 668f716b38..51b2b045cd 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.stopPoll( chatId: ChatIdentifier, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null @@ -15,19 +15,19 @@ suspend fun RequestsExecutor.stopPoll( StopPoll(chatId, messageId, replyMarkup) ) -suspend fun RequestsExecutor.stopPoll( +suspend fun TelegramBot.stopPoll( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = stopPoll(chat.id, messageId, replyMarkup) -suspend fun RequestsExecutor.stopPoll( +suspend fun TelegramBot.stopPoll( chatId: ChatId, message: Message, replyMarkup: InlineKeyboardMarkup? = null ) = stopPoll(chatId, message.messageId, replyMarkup) -suspend fun RequestsExecutor.stopPoll( +suspend fun TelegramBot.stopPoll( chat: Chat, message: Message, replyMarkup: InlineKeyboardMarkup? = null 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 index c3bc33741a..139239db0a 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.answerCallbackQuery( callbackQueryId: CallbackQueryIdentifier, text: String? = null, showAlert: Boolean? = null, @@ -13,7 +13,7 @@ suspend fun RequestsExecutor.answerCallbackQuery( cachedTimeSeconds: Int? = null ) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds)) -suspend fun RequestsExecutor.answerCallbackQuery( +suspend fun TelegramBot.answerCallbackQuery( callbackQuery: CallbackQuery, text: String? = null, showAlert: Boolean? = null, 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 index 7cc553212c..44245a0f79 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.answerInlineQuery( inlineQueryID: InlineQueryIdentifier, results: List = emptyList(), cachedTime: Int? = null, @@ -18,7 +18,7 @@ suspend fun RequestsExecutor.answerInlineQuery( AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) ) -suspend fun RequestsExecutor.answerInlineQuery( +suspend fun TelegramBot.answerInlineQuery( inlineQuery: InlineQuery, results: List = emptyList(), cachedTime: Int? = null, 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 index 0bdf7e3c30..8b1314d738 100644 --- 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 @@ -1,23 +1,23 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers.payments -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.answerPreCheckoutQueryOk( id: PreCheckoutQueryId ) = execute(AnswerPreCheckoutQueryOk(id)) -suspend fun RequestsExecutor.answerPreCheckoutQueryOk( +suspend fun TelegramBot.answerPreCheckoutQueryOk( preCheckoutQuery: PreCheckoutQuery ) = answerPreCheckoutQueryOk(preCheckoutQuery.id) -suspend fun RequestsExecutor.answerPreCheckoutQueryError( +suspend fun TelegramBot.answerPreCheckoutQueryError( id: PreCheckoutQueryId, error: String ) = execute(AnswerPreCheckoutQueryError(id, error)) -suspend fun RequestsExecutor.answerPreCheckoutQueryError( +suspend fun TelegramBot.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 index c154230a59..304891ccd4 100644 --- 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 @@ -1,26 +1,26 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.answers.payments -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.answerShippingQueryOk( id: ShippingQueryIdentifier, shippingOptions: List ) = execute(AnswerShippingQueryOk(id, shippingOptions)) -suspend fun RequestsExecutor.answerShippingQueryOk( +suspend fun TelegramBot.answerShippingQueryOk( shippingQuery: ShippingQuery, shippingOptions: List ) = answerShippingQueryOk(shippingQuery.id, shippingOptions) -suspend fun RequestsExecutor.answerShippingQueryError( +suspend fun TelegramBot.answerShippingQueryError( id: ShippingQueryIdentifier, error: String ) = execute(AnswerShippingQueryError(id, error)) -suspend fun RequestsExecutor.answerShippingQueryError( +suspend fun TelegramBot.answerShippingQueryError( shippingQuery: ShippingQuery, error: String ) = answerShippingQueryError(shippingQuery.id, error) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMe.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMe.kt index 66d9b4512d..0806075bd8 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMe.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMe.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.bot.GetMe -suspend fun RequestsExecutor.getMe() = execute(GetMe) +suspend fun TelegramBot.getMe() = execute(GetMe) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMyCommands.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMyCommands.kt index 41a9bef0f7..b44f8f6118 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMyCommands.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/GetMyCommands.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.bot.GetMyCommands -suspend fun RequestsExecutor.getMyCommands() = execute(GetMyCommands) +suspend fun TelegramBot.getMyCommands() = execute(GetMyCommands) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/SetMyCommands.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/SetMyCommands.kt index 860f0d8a3b..29a108f0bb 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/SetMyCommands.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/bot/SetMyCommands.kt @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.bot.SetMyCommands import com.github.insanusmokrassar.TelegramBotAPI.types.BotCommand -suspend fun RequestsExecutor.setMyCommands( +suspend fun TelegramBot.setMyCommands( commands: List ) = execute(SetMyCommands(commands)) -suspend fun RequestsExecutor.setMyCommands( +suspend fun TelegramBot.setMyCommands( vararg commands: BotCommand ) = setMyCommands(commands.toList()) 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 index a3051466f1..4e9eadfcde 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.exportChatInviteLink( chatId: ChatIdentifier ) = execute(ExportChatInviteLink(chatId)) -suspend fun RequestsExecutor.exportChatInviteLink( +suspend fun TelegramBot.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 index 2523ad5034..1bd4008ebc 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.leaveChat( chatId: ChatIdentifier ) = execute(LeaveChat(chatId)) -suspend fun RequestsExecutor.leaveChat( +suspend fun TelegramBot.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 index 528bedb4b3..ec8c518d9d 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChat import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.chat.* @@ -9,11 +9,11 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.extended. import com.github.insanusmokrassar.TelegramBotAPI.types.chat.extended.* import com.github.insanusmokrassar.TelegramBotAPI.utils.PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chatId: ChatIdentifier ) = execute(GetChat(chatId)) -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: Chat ) = getChat(chat.id) @@ -24,7 +24,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: PublicChat ) = getChat(chat.id) as ExtendedPublicChat @@ -36,7 +36,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: ChannelChat ) = getChat(chat.id) as ExtendedChannelChat @@ -47,7 +47,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: ChannelChatImpl ) = getChat(chat.id) as ExtendedChannelChatImpl @@ -59,7 +59,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: GroupChat ) = getChat(chat.id) as ExtendedGroupChat @@ -70,7 +70,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: GroupChatImpl ) = getChat(chat.id) as ExtendedGroupChatImpl @@ -82,7 +82,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: SupergroupChat ) = getChat(chat.id) as ExtendedSupergroupChat @@ -93,7 +93,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: SupergroupChatImpl ) = getChat(chat.id) as ExtendedSupergroupChatImpl @@ -105,7 +105,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: PrivateChat ) = getChat(chat.id) as ExtendedPrivateChat @@ -116,7 +116,7 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: PrivateChatImpl ) = getChat(chat.id) as ExtendedPrivateChatImpl @@ -127,6 +127,6 @@ suspend fun RequestsExecutor.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun RequestsExecutor.getChat( +suspend fun TelegramBot.getChat( chat: CommonUser ) = getChat(chat.id) as ExtendedUser 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 index 35b7197060..3f02e537c1 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getChatAdministrators( chatId: ChatIdentifier ) = execute(GetChatAdministrators(chatId)) -suspend fun RequestsExecutor.getChatAdministrators( +suspend fun TelegramBot.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 index 3c93f12c84..c741be04b3 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getChatMembersCount( chatId: ChatIdentifier ) = execute(GetChatMembersCount(chatId)) -suspend fun RequestsExecutor.getChatMembersCount( +suspend fun TelegramBot.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 index 0297d92d9c..ab5859374f 100644 --- 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 @@ -1,26 +1,26 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getChatMember( chatId: ChatIdentifier, userId: UserId ) = execute(GetChatMember(chatId, userId)) -suspend fun RequestsExecutor.getChatMember( +suspend fun TelegramBot.getChatMember( chat: PublicChat, userId: UserId ) = getChatMember(chat.id, userId) -suspend fun RequestsExecutor.getChatMember( +suspend fun TelegramBot.getChatMember( chatId: ChatId, user: User ) = getChatMember(chatId, user.id) -suspend fun RequestsExecutor.getChatMember( +suspend fun TelegramBot.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 index 1f0aa9c32e..2185f6d301 100644 --- 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 @@ -1,29 +1,29 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.kickChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null ) = execute(KickChatMember(chatId, userId, untilDate)) -suspend fun RequestsExecutor.kickChatMember( +suspend fun TelegramBot.kickChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null ) = kickChatMember(chat.id, userId, untilDate) -suspend fun RequestsExecutor.kickChatMember( +suspend fun TelegramBot.kickChatMember( chatId: ChatId, user: User, untilDate: TelegramDate? = null ) = kickChatMember(chatId, user.id, untilDate) -suspend fun RequestsExecutor.kickChatMember( +suspend fun TelegramBot.kickChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null 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 index 24c1205670..a6884128f8 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.promoteChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, @@ -33,7 +33,7 @@ suspend fun RequestsExecutor.promoteChatMember( ) ) -suspend fun RequestsExecutor.promoteChatMember( +suspend fun TelegramBot.promoteChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, @@ -59,7 +59,7 @@ suspend fun RequestsExecutor.promoteChatMember( canPromoteMembers ) -suspend fun RequestsExecutor.promoteChatMember( +suspend fun TelegramBot.promoteChatMember( chatId: ChatId, user: User, untilDate: TelegramDate? = null, @@ -85,7 +85,7 @@ suspend fun RequestsExecutor.promoteChatMember( canPromoteMembers ) -suspend fun RequestsExecutor.promoteChatMember( +suspend fun TelegramBot.promoteChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null, 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 index 6360aec348..6bcf3e7aa1 100644 --- 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 @@ -1,33 +1,33 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.restrictChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions() ) = execute(RestrictChatMember(chatId, userId, untilDate, permissions)) -suspend fun RequestsExecutor.restrictChatMember( +suspend fun TelegramBot.restrictChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions() ) = restrictChatMember(chat.id, userId, untilDate, permissions) -suspend fun RequestsExecutor.restrictChatMember( +suspend fun TelegramBot.restrictChatMember( chatId: ChatId, user: User, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions() ) = restrictChatMember(chatId, user.id, untilDate, permissions) -suspend fun RequestsExecutor.restrictChatMember( +suspend fun TelegramBot.restrictChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null, 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 index 2f545eeae7..2270643a3e 100644 --- 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 @@ -1,29 +1,29 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setChatAdministratorCustomTitle( chatId: ChatId, userId: UserId, customTitle: String ) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) -suspend fun RequestsExecutor.setChatAdministratorCustomTitle( +suspend fun TelegramBot.setChatAdministratorCustomTitle( chat: PublicChat, userId: UserId, customTitle: String ) = setChatAdministratorCustomTitle(chat.id, userId, customTitle) -suspend fun RequestsExecutor.setChatAdministratorCustomTitle( +suspend fun TelegramBot.setChatAdministratorCustomTitle( chatId: ChatId, user: User, customTitle: String ) = setChatAdministratorCustomTitle(chatId, user.id, customTitle) -suspend fun RequestsExecutor.setChatAdministratorCustomTitle( +suspend fun TelegramBot.setChatAdministratorCustomTitle( chat: PublicChat, user: User, customTitle: String 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 index 35c1f26f25..2f4337878f 100644 --- 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 @@ -1,26 +1,26 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.members -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.unbanChatMember( chatId: ChatIdentifier, userId: UserId ) = execute(UnbanChatMember(chatId, userId)) -suspend fun RequestsExecutor.unbanChatMember( +suspend fun TelegramBot.unbanChatMember( chat: PublicChat, userId: UserId ) = unbanChatMember(chat.id, userId) -suspend fun RequestsExecutor.unbanChatMember( +suspend fun TelegramBot.unbanChatMember( chatId: ChatId, user: User ) = unbanChatMember(chatId, user.id) -suspend fun RequestsExecutor.unbanChatMember( +suspend fun TelegramBot.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 index 919f91b3fb..1a58948c69 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.deleteChatPhoto( chatId: ChatIdentifier ) = execute(DeleteChatPhoto(chatId)) -suspend fun RequestsExecutor.deleteChatPhoto( +suspend fun TelegramBot.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 index d678a95c1d..9fcf45908a 100644 --- 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 @@ -1,25 +1,25 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.pinChatMessage( chatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false ) = execute(PinChatMessage(chatId, messageId, disableNotification)) -suspend fun RequestsExecutor.pinChatMessage( +suspend fun TelegramBot.pinChatMessage( chat: PublicChat, messageId: MessageIdentifier, disableNotification: Boolean = false ) = pinChatMessage(chat.id, messageId, disableNotification) -suspend fun RequestsExecutor.pinChatMessage( +suspend fun TelegramBot.pinChatMessage( message: Message, disableNotification: Boolean = false ) = if (message.chat is PublicChat) { 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 index c20234ceed..7b1bf373ba 100644 --- 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 @@ -1,16 +1,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setChatDescription( chatId: ChatIdentifier, description: String ) = execute(SetChatDescription(chatId, description)) -suspend fun RequestsExecutor.setChatDescription( +suspend fun TelegramBot.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 index b10f4bf27d..6c41904421 100644 --- 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 @@ -1,17 +1,17 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setDefaultChatMembersPermissions( chatId: ChatIdentifier, permissions: ChatPermissions ) = execute(SetChatPermissions(chatId, permissions)) -suspend fun RequestsExecutor.setDefaultChatMembersPermissions( +suspend fun TelegramBot.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 index 19f3ab0683..52026ffb8c 100644 --- 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 @@ -1,17 +1,17 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setChatPhoto( chatId: ChatIdentifier, photo: MultipartFile ) = execute(SetChatPhoto(chatId, photo)) -suspend fun RequestsExecutor.setChatPhoto( +suspend fun TelegramBot.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 index 130495aeaf..e8c559c0c6 100644 --- 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 @@ -1,16 +1,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setChatTitle( chatId: ChatIdentifier, title: String ) = execute(SetChatTitle(chatId, title)) -suspend fun RequestsExecutor.setChatTitle( +suspend fun TelegramBot.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 index dc542e9a21..c563bc9959 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.modify -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.unpinChatMessage( chatId: ChatIdentifier ) = execute(UnpinChatMessage(chatId)) -suspend fun RequestsExecutor.unpinChatMessage( +suspend fun TelegramBot.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 index 6fd6969b51..7b3c1be2ba 100644 --- 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 @@ -1,14 +1,14 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.deleteChatStickerSet( chatId: ChatIdentifier ) = execute(DeleteChatStickerSet(chatId)) -suspend fun RequestsExecutor.deleteChatStickerSet( +suspend fun TelegramBot.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 index c1ca61482f..c5aa17f3c0 100644 --- 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 @@ -1,17 +1,17 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.chat.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setChatStickerSet( chatId: ChatIdentifier, stickerSetName: StickerSetName ) = execute(SetChatStickerSet(chatId, stickerSetName)) -suspend fun RequestsExecutor.setChatStickerSet( +suspend fun TelegramBot.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 index 72ea23b52a..dbaf4a4cb8 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditChatMessageLiveLocation import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup @@ -8,7 +8,7 @@ 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( +suspend fun TelegramBot.editLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, latitude: Double, @@ -20,7 +20,7 @@ suspend fun RequestsExecutor.editLiveLocation( ) ) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( chat: Chat, messageId: MessageIdentifier, latitude: Double, @@ -28,14 +28,14 @@ suspend fun RequestsExecutor.editLiveLocation( replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(chat.id, messageId, latitude, longitude, replyMarkup) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( message: ContentMessage, latitude: Double, longitude: Double, replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(message.chat, message.messageId, latitude, longitude, replyMarkup) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, location: Location, @@ -46,14 +46,14 @@ suspend fun RequestsExecutor.editLiveLocation( ) ) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( chat: Chat, messageId: MessageIdentifier, location: Location, replyMarkup: InlineKeyboardMarkup? = null ) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, replyMarkup) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( message: ContentMessage, location: Location, replyMarkup: InlineKeyboardMarkup? = null 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 index c48fe51212..286ba3241a 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.editLiveLocation( inlineMessageId: InlineMessageIdentifier, latitude: Double, longitude: Double, @@ -16,7 +16,7 @@ suspend fun RequestsExecutor.editLiveLocation( inlineMessageId, latitude, longitude, replyMarkup ) ) -suspend fun RequestsExecutor.editLiveLocation( +suspend fun TelegramBot.editLiveLocation( inlineMessageId: InlineMessageIdentifier, location: Location, replyMarkup: InlineKeyboardMarkup? = null 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 index 0835dd90e1..867dbc521d 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.StopChatMessageLiveLocation import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -9,7 +9,7 @@ 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( +suspend fun TelegramBot.stopLiveLocation( chatId: ChatIdentifier, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null @@ -19,13 +19,13 @@ suspend fun RequestsExecutor.stopLiveLocation( ) ) -suspend fun RequestsExecutor.stopLiveLocation( +suspend fun TelegramBot.stopLiveLocation( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = stopLiveLocation(chat.id, messageId, replyMarkup) -suspend fun RequestsExecutor.stopLiveLocation( +suspend fun TelegramBot.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 index b1a25409ed..e59a33392a 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.LiveLocation -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.stopLiveLocation( inlineMessageId: InlineMessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = execute( 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 index d02884f5b1..3487264fa4 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.ReplyMarkup -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup.EditChatMessageReplyMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message -suspend fun RequestsExecutor.editMessageReplyMarkup( +suspend fun TelegramBot.editMessageReplyMarkup( chatId: ChatIdentifier, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null @@ -16,13 +16,13 @@ suspend fun RequestsExecutor.editMessageReplyMarkup( EditChatMessageReplyMarkup(chatId, messageId, replyMarkup) ) -suspend fun RequestsExecutor.editMessageReplyMarkup( +suspend fun TelegramBot.editMessageReplyMarkup( chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null ) = editMessageReplyMarkup(chat.id, messageId, replyMarkup) -suspend fun RequestsExecutor.editMessageReplyMarkup( +suspend fun TelegramBot.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 index 66f7df4730..943256bb28 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.ReplyMarkup -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.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 index e448ad2324..68413be7fe 100644 --- 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 @@ -1,7 +1,7 @@ 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.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption.EditChatMessageCaption import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -11,7 +11,7 @@ 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( +suspend fun TelegramBot.editMessageCaption( chatId: ChatIdentifier, messageId: MessageIdentifier, text: String, @@ -21,7 +21,7 @@ suspend fun RequestsExecutor.editMessageCaption( EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup) ) -suspend fun RequestsExecutor.editMessageCaption( +suspend fun TelegramBot.editMessageCaption( chat: Chat, messageId: MessageIdentifier, text: String, @@ -29,7 +29,7 @@ suspend fun RequestsExecutor.editMessageCaption( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup) -suspend fun RequestsExecutor.editMessageCaption( +suspend fun TelegramBot.editMessageCaption( message: ContentMessage, text: String, parseMode: ParseMode? = null, 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 index a561699e6e..62e3aa67df 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.caption -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.editMessageCaption( inlineMessageId: InlineMessageIdentifier, text: String, parseMode: ParseMode? = null, 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 index 5406985cbf..a4c8009ccc 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.EditChatMessageMedia import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia @@ -10,7 +10,7 @@ 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( +suspend fun TelegramBot.editMessageMedia( chatId: ChatIdentifier, messageId: MessageIdentifier, media: InputMedia, @@ -19,14 +19,14 @@ suspend fun RequestsExecutor.editMessageMedia( EditChatMessageMedia(chatId, messageId, media, replyMarkup) ) -suspend fun RequestsExecutor.editMessageMedia( +suspend fun TelegramBot.editMessageMedia( chat: Chat, messageId: MessageIdentifier, media: InputMedia, replyMarkup: InlineKeyboardMarkup? = null ) = editMessageMedia(chat.id, messageId, media, replyMarkup) -suspend fun RequestsExecutor.editMessageMedia( +suspend fun TelegramBot.editMessageMedia( message: ContentMessage, media: InputMedia, replyMarkup: InlineKeyboardMarkup? = null 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 index 1768ac1f15..2d3ae64056 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.editMessageCaption( inlineMessageId: InlineMessageIdentifier, media: InputMedia, replyMarkup: InlineKeyboardMarkup? = null 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 index 18320bc153..2dc9ed08d9 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.text -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text.EditChatMessageText import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -10,7 +10,7 @@ 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( +suspend fun TelegramBot.editMessageText( chatId: ChatIdentifier, messageId: MessageIdentifier, text: String, @@ -21,7 +21,7 @@ suspend fun RequestsExecutor.editMessageText( EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup) ) -suspend fun RequestsExecutor.editMessageText( +suspend fun TelegramBot.editMessageText( chat: Chat, messageId: MessageIdentifier, text: String, @@ -30,7 +30,7 @@ suspend fun RequestsExecutor.editMessageText( replyMarkup: InlineKeyboardMarkup? = null ) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup) -suspend fun RequestsExecutor.editMessageText( +suspend fun TelegramBot.editMessageText( message: ContentMessage, text: String, parseMode: ParseMode? = null, 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 index 2d0521d73a..7ca44847b7 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.edit.text -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.editMessageText( inlineMessageId: InlineMessageIdentifier, text: String, parseMode: ParseMode? = null, 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 index 9253f8d27c..f48581bf55 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getGameScore( userId: UserId, chatId: ChatId, messageId: MessageIdentifier @@ -15,7 +15,7 @@ suspend fun RequestsExecutor.getGameScore( GetGameHighScoresByChat(userId, chatId, messageId) ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( user: CommonUser, chatId: ChatId, messageId: MessageIdentifier @@ -23,7 +23,7 @@ suspend fun RequestsExecutor.getGameScore( user.id, chatId, messageId ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( userId: UserId, chat: Chat, messageId: MessageIdentifier @@ -31,7 +31,7 @@ suspend fun RequestsExecutor.getGameScore( userId, chat.id, messageId ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( user: CommonUser, chat: Chat, messageId: MessageIdentifier @@ -39,14 +39,14 @@ suspend fun RequestsExecutor.getGameScore( user.id, chat.id, messageId ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( userId: UserId, message: ContentMessage ) = getGameScore( userId, message.chat.id, message.messageId ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( user: CommonUser, message: ContentMessage ) = getGameScore( 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 index a1ea482a94..cd0fc279ce 100644 --- 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 @@ -1,10 +1,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.games.GetGameHighScoresByInlineMessageId import com.github.insanusmokrassar.TelegramBotAPI.types.* -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.getGameScore( userId: UserId, inlineMessageId: InlineMessageIdentifier ) = execute( @@ -13,7 +13,7 @@ suspend fun RequestsExecutor.getGameScore( ) ) -suspend fun RequestsExecutor.getGameScore( +suspend fun TelegramBot.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 index 789ca0af5e..3ef31afc4e 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, chatId: ChatId, @@ -18,7 +18,7 @@ suspend fun RequestsExecutor.setGameScore( SetGameScoreByChatId(userId, score, chatId, messageId, force, disableEditMessage) ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, chatId: ChatId, @@ -29,7 +29,7 @@ suspend fun RequestsExecutor.setGameScore( user.id, score, chatId, messageId, force, disableEditMessage ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, chat: Chat, @@ -40,7 +40,7 @@ suspend fun RequestsExecutor.setGameScore( userId, score, chat.id, messageId, force, disableEditMessage ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, chat: Chat, @@ -51,7 +51,7 @@ suspend fun RequestsExecutor.setGameScore( user.id, score, chat.id, messageId, force, disableEditMessage ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, message: ContentMessage, @@ -61,7 +61,7 @@ suspend fun RequestsExecutor.setGameScore( userId, score, message.chat.id, message.messageId, force, disableEditMessage ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, message: ContentMessage, 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 index ded6c96916..64dc26b869 100644 --- 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 @@ -1,10 +1,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.games -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.games.SetGameScoreByInlineMessageId import com.github.insanusmokrassar.TelegramBotAPI.types.* -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, inlineMessageId: InlineMessageIdentifier, @@ -16,7 +16,7 @@ suspend fun RequestsExecutor.setGameScore( ) ) -suspend fun RequestsExecutor.setGameScore( +suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, inlineMessageId: InlineMessageIdentifier, 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 index 1fde6e92ea..fffa8f0322 100644 --- 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 @@ -1,16 +1,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getFileAdditionalInfo( fileId: FileId ) = execute( GetFile(fileId) ) -suspend fun RequestsExecutor.getFileAdditionalInfo( +suspend fun TelegramBot.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 index 0fce1971cd..5a77494f3a 100644 --- 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 @@ -1,16 +1,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.get.GetStickerSet import com.github.insanusmokrassar.TelegramBotAPI.types.files.Sticker -suspend fun RequestsExecutor.getStickerSet( +suspend fun TelegramBot.getStickerSet( name: String ) = execute( GetStickerSet(name) ) -suspend fun RequestsExecutor.getStickerSet( +suspend fun TelegramBot.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 index a3f613e543..19a4233b10 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.get -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.getUserProfilePhotos( userId: UserId, offset: Int? = null, limit: Int? = null @@ -15,7 +15,7 @@ suspend fun RequestsExecutor.getUserProfilePhotos( ) ) -suspend fun RequestsExecutor.getUserProfilePhotos( +suspend fun TelegramBot.getUserProfilePhotos( user: CommonUser, offset: Int? = null, limit: Int? = null 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 index a2366ab56a..f0965b2dbb 100644 --- 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 @@ -1,102 +1,102 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.sendBotAction( chatId: ChatIdentifier, action: BotAction ) = execute( SendAction(chatId, action) ) -suspend fun RequestsExecutor.sendBotAction( +suspend fun TelegramBot.sendBotAction( chat: Chat, action: BotAction ) = sendBotAction(chat.id, action) -suspend fun RequestsExecutor.sendActionTyping( +suspend fun TelegramBot.sendActionTyping( chatId: ChatIdentifier ) = sendBotAction(chatId, TypingAction) -suspend fun RequestsExecutor.sendActionUploadPhoto( +suspend fun TelegramBot.sendActionUploadPhoto( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadPhotoAction) -suspend fun RequestsExecutor.sendActionRecordVideo( +suspend fun TelegramBot.sendActionRecordVideo( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordVideoAction) -suspend fun RequestsExecutor.sendActionUploadVideo( +suspend fun TelegramBot.sendActionUploadVideo( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadVideoAction) -suspend fun RequestsExecutor.sendActionRecordAudio( +suspend fun TelegramBot.sendActionRecordAudio( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordAudioAction) -suspend fun RequestsExecutor.sendActionUploadAudio( +suspend fun TelegramBot.sendActionUploadAudio( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadAudioAction) -suspend fun RequestsExecutor.sendActionUploadDocument( +suspend fun TelegramBot.sendActionUploadDocument( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadDocumentAction) -suspend fun RequestsExecutor.sendActionFindLocation( +suspend fun TelegramBot.sendActionFindLocation( chatId: ChatIdentifier ) = sendBotAction(chatId, FindLocationAction) -suspend fun RequestsExecutor.sendActionRecordVideoNote( +suspend fun TelegramBot.sendActionRecordVideoNote( chatId: ChatIdentifier ) = sendBotAction(chatId, RecordVideoNoteAction) -suspend fun RequestsExecutor.sendActionUploadVideoNote( +suspend fun TelegramBot.sendActionUploadVideoNote( chatId: ChatIdentifier ) = sendBotAction(chatId, UploadVideoNoteAction) -suspend fun RequestsExecutor.sendActionTyping( +suspend fun TelegramBot.sendActionTyping( chat: Chat ) = sendBotAction(chat, TypingAction) -suspend fun RequestsExecutor.sendActionUploadPhoto( +suspend fun TelegramBot.sendActionUploadPhoto( chat: Chat ) = sendBotAction(chat, UploadPhotoAction) -suspend fun RequestsExecutor.sendActionRecordVideo( +suspend fun TelegramBot.sendActionRecordVideo( chat: Chat ) = sendBotAction(chat, RecordVideoAction) -suspend fun RequestsExecutor.sendActionUploadVideo( +suspend fun TelegramBot.sendActionUploadVideo( chat: Chat ) = sendBotAction(chat, UploadVideoAction) -suspend fun RequestsExecutor.sendActionRecordAudio( +suspend fun TelegramBot.sendActionRecordAudio( chat: Chat ) = sendBotAction(chat, RecordAudioAction) -suspend fun RequestsExecutor.sendActionUploadAudio( +suspend fun TelegramBot.sendActionUploadAudio( chat: Chat ) = sendBotAction(chat, UploadAudioAction) -suspend fun RequestsExecutor.sendActionUploadDocument( +suspend fun TelegramBot.sendActionUploadDocument( chat: Chat ) = sendBotAction(chat, UploadDocumentAction) -suspend fun RequestsExecutor.sendActionFindLocation( +suspend fun TelegramBot.sendActionFindLocation( chat: Chat ) = sendBotAction(chat, FindLocationAction) -suspend fun RequestsExecutor.sendActionRecordVideoNote( +suspend fun TelegramBot.sendActionRecordVideoNote( chat: Chat ) = sendBotAction(chat, RecordVideoNoteAction) -suspend fun RequestsExecutor.sendActionUploadVideoNote( +suspend fun TelegramBot.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 index 6aa4a2cb94..17a8f48921 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.sendContact( chatId: ChatIdentifier, phoneNumber: String, firstName: String, @@ -20,7 +20,7 @@ suspend fun RequestsExecutor.sendContact( ) ) -suspend fun RequestsExecutor.sendContact( +suspend fun TelegramBot.sendContact( chatId: ChatIdentifier, contact: Contact, disableNotification: Boolean = false, @@ -32,7 +32,7 @@ suspend fun RequestsExecutor.sendContact( ) ) -suspend fun RequestsExecutor.sendContact( +suspend fun TelegramBot.sendContact( chat: Chat, phoneNumber: String, firstName: String, @@ -44,7 +44,7 @@ suspend fun RequestsExecutor.sendContact( chat.id, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendContact( +suspend fun TelegramBot.sendContact( chat: Chat, contact: Contact, disableNotification: Boolean = false, diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendDice.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendDice.kt index d82e1c6293..f29ba0a86a 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendDice.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/SendDice.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendDice import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.dice.DiceAnimationType -suspend fun RequestsExecutor.sendDice( +suspend fun TelegramBot.sendDice( chatId: ChatIdentifier, animationType: DiceAnimationType? = null, disableNotification: Boolean = false, @@ -18,7 +18,7 @@ suspend fun RequestsExecutor.sendDice( SendDice(chatId, animationType, disableNotification, replyToMessageId, replyMarkup) ) -suspend fun RequestsExecutor.sendDice( +suspend fun TelegramBot.sendDice( chat: Chat, animationType: DiceAnimationType? = null, disableNotification: Boolean = false, 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 index 2b0437f063..7b285b4154 100644 --- 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 @@ -1,12 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -24,7 +24,7 @@ suspend fun RequestsExecutor.sendLocation( ) ) -suspend fun RequestsExecutor.sendLocation( +suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, location: Location, disableNotification: Boolean = false, @@ -39,7 +39,7 @@ suspend fun RequestsExecutor.sendLocation( replyMarkup ) -suspend fun RequestsExecutor.sendLocation( +suspend fun TelegramBot.sendLocation( chat: Chat, latitude: Double, longitude: Double, @@ -55,7 +55,7 @@ suspend fun RequestsExecutor.sendLocation( replyMarkup ) -suspend fun RequestsExecutor.sendLocation( +suspend fun TelegramBot.sendLocation( chat: Chat, location: Location, disableNotification: Boolean = false, 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 index 0275e9916c..3167cd1023 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendTextMessage import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -8,7 +8,7 @@ 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( +suspend fun TelegramBot.sendMessage( chatId: ChatIdentifier, text: String, parseMode: ParseMode? = null, @@ -20,7 +20,7 @@ suspend fun RequestsExecutor.sendMessage( SendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) ) -suspend fun RequestsExecutor.sendTextMessage( +suspend fun TelegramBot.sendTextMessage( chatId: ChatIdentifier, text: String, parseMode: ParseMode? = null, @@ -32,7 +32,7 @@ suspend fun RequestsExecutor.sendTextMessage( chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendMessage( +suspend fun TelegramBot.sendMessage( chat: Chat, text: String, parseMode: ParseMode? = null, @@ -43,7 +43,7 @@ suspend fun RequestsExecutor.sendMessage( ) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, replyMarkup) -suspend fun RequestsExecutor.sendTextMessage( +suspend fun TelegramBot.sendTextMessage( chat: Chat, text: String, parseMode: ParseMode? = null, 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 index f29e72b7cf..931e788370 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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 import com.github.insanusmokrassar.TelegramBotAPI.types.venue.Venue -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -23,7 +23,7 @@ suspend fun RequestsExecutor.sendVenue( ) ) -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chat: Chat, latitude: Double, longitude: Double, @@ -37,7 +37,7 @@ suspend fun RequestsExecutor.sendVenue( chat.id, latitude, longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, location: Location, title: String, @@ -50,7 +50,7 @@ suspend fun RequestsExecutor.sendVenue( chatId, location.latitude, location.longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chat: Chat, location: Location, title: String, @@ -63,7 +63,7 @@ suspend fun RequestsExecutor.sendVenue( chat.id, location.latitude, location.longitude, title, address, foursquareId, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, venue: Venue, disableNotification: Boolean = false, @@ -75,7 +75,7 @@ suspend fun RequestsExecutor.sendVenue( ) ) -suspend fun RequestsExecutor.sendVenue( +suspend fun TelegramBot.sendVenue( chat: Chat, venue: Venue, disableNotification: Boolean = false, 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 index fc1bc641d6..709c02d955 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.games -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.send.games.SendGame import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier @@ -8,7 +8,7 @@ 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( +suspend fun TelegramBot.sendGame( chatId: ChatIdentifier, gameShortName: String, disableNotification: Boolean = false, @@ -20,7 +20,7 @@ suspend fun RequestsExecutor.sendGame( ) ) -suspend fun RequestsExecutor.sendGame( +suspend fun TelegramBot.sendGame( chat: Chat, gameShortName: String, disableNotification: Boolean = false, @@ -30,7 +30,7 @@ suspend fun RequestsExecutor.sendGame( chat.id, gameShortName, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendGame( +suspend fun TelegramBot.sendGame( chatId: ChatIdentifier, game: Game, disableNotification: Boolean = false, @@ -40,7 +40,7 @@ suspend fun RequestsExecutor.sendGame( chatId, game.title, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendGame( +suspend fun TelegramBot.sendGame( chat: Chat, game: Game, disableNotification: Boolean = false, 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 index 28a3471007..6f0b1e69a3 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendAnimation import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.AnimationFile -suspend fun RequestsExecutor.sendAnimation( +suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: InputFile, thumb: InputFile? = null, @@ -37,7 +37,7 @@ suspend fun RequestsExecutor.sendAnimation( ) ) -suspend fun RequestsExecutor.sendAnimation( +suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: AnimationFile, text: String? = null, 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 index afcbd0983d..8a3cbe82fa 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendAudio import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile -suspend fun RequestsExecutor.sendAudio( +suspend fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: InputFile, thumb: InputFile? = null, @@ -37,7 +37,7 @@ suspend fun RequestsExecutor.sendAudio( ) ) -suspend fun RequestsExecutor.sendAudio( +suspend fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: AudioFile, text: String? = null, 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 index 0e583adabc..c55b49997d 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendDocument import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.DocumentFile -suspend fun RequestsExecutor.sendDocument( +suspend fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: InputFile, thumb: InputFile? = null, @@ -31,7 +31,7 @@ suspend fun RequestsExecutor.sendDocument( ) ) -suspend fun RequestsExecutor.sendDocument( +suspend fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: DocumentFile, text: String? = null, 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 index 3c8448f445..5d13876d44 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.sendMediaGroup( chatId: ChatIdentifier, media: List, disableNotification: Boolean = false, @@ -18,7 +18,7 @@ suspend fun RequestsExecutor.sendMediaGroup( ) ) -suspend fun RequestsExecutor.sendMediaGroup( +suspend fun TelegramBot.sendMediaGroup( chat: Chat, media: List, disableNotification: Boolean = false, 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 index c42d4d8a0d..355930cfc2 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendPhoto import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup -suspend fun RequestsExecutor.sendPhoto( +suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, fileId: InputFile, caption: String? = null, 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 index 2235b2a960..8a3936231f 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile 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 -suspend fun RequestsExecutor.sendSticker( +suspend fun TelegramBot.sendSticker( chatId: ChatIdentifier, sticker: InputFile, disableNotification: Boolean = false, 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 index 38c9062991..eb2897ee17 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideo import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile -suspend fun RequestsExecutor.sendVideo( +suspend fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: InputFile, thumb: InputFile? = null, @@ -38,7 +38,7 @@ suspend fun RequestsExecutor.sendVideo( ) ) -suspend fun RequestsExecutor.sendVideo( +suspend fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: VideoFile, text: String? = null, 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 index 21b3060189..3bcf4ae43c 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideoNote import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile -suspend fun RequestsExecutor.sendVideoNote( +suspend fun TelegramBot.sendVideoNote( chatId: ChatIdentifier, videoNote: InputFile, thumb: InputFile? = null, @@ -35,7 +35,7 @@ suspend fun RequestsExecutor.sendVideoNote( ) ) -suspend fun RequestsExecutor.sendVideoNote( +suspend fun TelegramBot.sendVideoNote( chatId: ChatIdentifier, videoNote: VideoFile, text: String? = null, 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 index 91e8e70ed2..0eadf6c2ae 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVoice import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier @@ -9,7 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile -suspend fun RequestsExecutor.sendVoice( +suspend fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: InputFile, thumb: InputFile? = null, @@ -33,7 +33,7 @@ suspend fun RequestsExecutor.sendVoice( ) ) -suspend fun RequestsExecutor.sendVoice( +suspend fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: AudioFile, text: String? = null, 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 index 6f5b50f7c6..221cb013c5 100644 --- 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 @@ -1,13 +1,13 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.payments -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.sendInvoice( chatId: ChatId, title: String, description: String, @@ -31,7 +31,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) ) -suspend fun RequestsExecutor.sendInvoice( +suspend fun TelegramBot.sendInvoice( user: CommonUser, title: String, description: String, 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 index 218b960e6d..4e00309ee5 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.polls -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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 @@ -10,7 +10,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.polls.* -suspend fun RequestsExecutor.sendRegularPoll( +suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, question: String, options: List, @@ -26,7 +26,7 @@ suspend fun RequestsExecutor.sendRegularPoll( chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup ) ) -suspend fun RequestsExecutor.sendRegularPoll( +suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, poll: RegularPoll, isClosed: Boolean = false, @@ -44,7 +44,7 @@ suspend fun RequestsExecutor.sendRegularPoll( ) ) -suspend fun RequestsExecutor.sendRegularPoll( +suspend fun TelegramBot.sendRegularPoll( chat: Chat, question: String, options: List, @@ -59,7 +59,7 @@ suspend fun RequestsExecutor.sendRegularPoll( chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendRegularPoll( +suspend fun TelegramBot.sendRegularPoll( chat: Chat, poll: RegularPoll, isClosed: Boolean = false, @@ -76,7 +76,7 @@ suspend fun RequestsExecutor.sendRegularPoll( ) -suspend fun RequestsExecutor.sendQuizPoll( +suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, question: String, options: List, @@ -95,7 +95,7 @@ suspend fun RequestsExecutor.sendQuizPoll( ) ) -suspend fun RequestsExecutor.sendQuizPoll( +suspend fun TelegramBot.sendQuizPoll( chat: Chat, question: String, options: List, @@ -112,7 +112,7 @@ suspend fun RequestsExecutor.sendQuizPoll( chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, replyToMessageId, replyMarkup ) -suspend fun RequestsExecutor.sendQuizPoll( +suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -132,7 +132,7 @@ suspend fun RequestsExecutor.sendQuizPoll( ) ) -suspend fun RequestsExecutor.sendQuizPoll( +suspend fun TelegramBot.sendQuizPoll( chat: Chat, isClosed: Boolean = false, quizPoll: QuizPoll, diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddAnimatedStickerToSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddAnimatedStickerToSet.kt index f9d32b0727..325848925f 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddAnimatedStickerToSet.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddAnimatedStickerToSet.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.AddAnimatedStickerToSet @@ -9,7 +9,7 @@ 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.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( userId: UserId, stickerSetName: String, sticker: FileId, @@ -19,7 +19,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( AddAnimatedStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( userId: UserId, stickerSetName: String, sticker: MultipartFile, @@ -29,7 +29,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( AddAnimatedStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( user: CommonUser, stickerSetName: String, sticker: FileId, @@ -39,7 +39,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( user: CommonUser, stickerSetName: String, sticker: MultipartFile, @@ -49,7 +49,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: FileId, @@ -59,7 +59,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: MultipartFile, @@ -69,7 +69,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: FileId, @@ -79,7 +79,7 @@ suspend fun RequestsExecutor.addAnimatedStickerToSet( user.id, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addAnimatedStickerToSet( +suspend fun TelegramBot.addAnimatedStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: MultipartFile, diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStaticStickerToSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStaticStickerToSet.kt index 2d09222784..9ad20329b4 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStaticStickerToSet.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/AddStaticStickerToSet.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.AddStaticStickerToSet @@ -9,7 +9,7 @@ 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.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( userId: UserId, stickerSetName: String, sticker: FileId, @@ -19,7 +19,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( AddStaticStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( userId: UserId, stickerSetName: String, sticker: MultipartFile, @@ -29,7 +29,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( AddStaticStickerToSet(userId, stickerSetName, sticker, emojis, maskPosition) ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( user: CommonUser, stickerSetName: String, sticker: FileId, @@ -39,7 +39,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( user: CommonUser, stickerSetName: String, sticker: MultipartFile, @@ -49,7 +49,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( user.id, stickerSetName, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: FileId, @@ -59,7 +59,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: MultipartFile, @@ -69,7 +69,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( userId, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: FileId, @@ -79,7 +79,7 @@ suspend fun RequestsExecutor.addStaticStickerToSet( user.id, stickerSet.name, sticker, emojis, maskPosition ) -suspend fun RequestsExecutor.addStaticStickerToSet( +suspend fun TelegramBot.addStaticStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: MultipartFile, diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewAnimatedStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewAnimatedStickerSet.kt index f1d2e14de0..5b4747f8eb 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewAnimatedStickerSet.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewAnimatedStickerSet.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.CreateNewAnimatedStickerSet @@ -8,7 +8,7 @@ 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.createNewAnimatedStickerSet( +suspend fun TelegramBot.createNewAnimatedStickerSet( userId: UserId, name: String, sticker: FileId, @@ -19,7 +19,7 @@ suspend fun RequestsExecutor.createNewAnimatedStickerSet( CreateNewAnimatedStickerSet(userId, name, sticker, emojis, containsMasks, maskPosition) ) -suspend fun RequestsExecutor.createNewAnimatedStickerSet( +suspend fun TelegramBot.createNewAnimatedStickerSet( userId: UserId, name: String, sticker: MultipartFile, @@ -31,7 +31,7 @@ suspend fun RequestsExecutor.createNewAnimatedStickerSet( ) -suspend fun RequestsExecutor.createNewAnimatedStickerSet( +suspend fun TelegramBot.createNewAnimatedStickerSet( user: CommonUser, name: String, sticker: FileId, @@ -42,7 +42,7 @@ suspend fun RequestsExecutor.createNewAnimatedStickerSet( user.id, name, sticker, emojis, containsMasks, maskPosition ) -suspend fun RequestsExecutor.createNewAnimatedStickerSet( +suspend fun TelegramBot.createNewAnimatedStickerSet( user: CommonUser, name: String, sticker: MultipartFile, diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStaticStickerSet.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStaticStickerSet.kt index 9234137195..cd9de98787 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStaticStickerSet.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/CreateNewStaticStickerSet.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.CreateNewStaticStickerSet @@ -8,7 +8,7 @@ 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.createNewStaticStickerSet( +suspend fun TelegramBot.createNewStaticStickerSet( userId: UserId, name: String, sticker: FileId, @@ -19,7 +19,7 @@ suspend fun RequestsExecutor.createNewStaticStickerSet( CreateNewStaticStickerSet(userId, name, sticker, emojis, containsMasks, maskPosition) ) -suspend fun RequestsExecutor.createNewStaticStickerSet( +suspend fun TelegramBot.createNewStaticStickerSet( userId: UserId, name: String, sticker: MultipartFile, @@ -31,7 +31,7 @@ suspend fun RequestsExecutor.createNewStaticStickerSet( ) -suspend fun RequestsExecutor.createNewStaticStickerSet( +suspend fun TelegramBot.createNewStaticStickerSet( user: CommonUser, name: String, sticker: FileId, @@ -42,7 +42,7 @@ suspend fun RequestsExecutor.createNewStaticStickerSet( user.id, name, sticker, emojis, containsMasks, maskPosition ) -suspend fun RequestsExecutor.createNewStaticStickerSet( +suspend fun TelegramBot.createNewStaticStickerSet( user: CommonUser, name: String, sticker: MultipartFile, 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 index 3206463af1..19819423a2 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.deleteStickerFromSet( sticker: FileId ) = execute( DeleteStickerFromSet( @@ -13,7 +13,7 @@ suspend fun RequestsExecutor.deleteStickerFromSet( ) ) -suspend fun RequestsExecutor.deleteStickerFromSet( +suspend fun TelegramBot.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 index 553d131ab3..dd13dae582 100644 --- 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 @@ -1,11 +1,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.setStickerPositionInSet( sticker: FileId, position: Int ) = execute( @@ -15,7 +15,7 @@ suspend fun RequestsExecutor.setStickerPositionInSet( ) ) -suspend fun RequestsExecutor.setStickerPositionInSet( +suspend fun TelegramBot.setStickerPositionInSet( sticker: Sticker, position: Int ) = setStickerPositionInSet( diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerSetThumb.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerSetThumb.kt index 45fad6497a..69ffb7f3e3 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerSetThumb.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/stickers/SetStickerSetThumb.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.thumbs -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.stickers.SetStickerSetThumb @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.CommonUser import com.github.insanusmokrassar.TelegramBotAPI.types.UserId import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.StickerSet -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( userId: UserId, thumbSetName: String, thumb: FileId @@ -16,7 +16,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( SetStickerSetThumb(userId, thumbSetName, thumb) ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( userId: UserId, thumbSetName: String, thumb: MultipartFile @@ -24,7 +24,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( SetStickerSetThumb(userId, thumbSetName, thumb) ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( user: CommonUser, thumbSetName: String, thumb: FileId @@ -32,7 +32,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( user.id, thumbSetName, thumb ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( user: CommonUser, thumbSetName: String, thumb: MultipartFile @@ -40,7 +40,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( user.id, thumbSetName, thumb ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( userId: UserId, thumbSet: StickerSet, thumb: FileId @@ -48,7 +48,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( userId, thumbSet.name, thumb ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( userId: UserId, thumbSet: StickerSet, thumb: MultipartFile @@ -56,7 +56,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( userId, thumbSet.name, thumb ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( user: CommonUser, thumbSet: StickerSet, thumb: FileId @@ -64,7 +64,7 @@ suspend fun RequestsExecutor.setStickerSetThumb( user.id, thumbSet.name, thumb ) -suspend fun RequestsExecutor.setStickerSetThumb( +suspend fun TelegramBot.setStickerSetThumb( user: CommonUser, thumbSet: StickerSet, thumb: MultipartFile 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 index e61ace8cce..5e0ca8f8cc 100644 --- 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 @@ -1,19 +1,19 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot 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( +suspend fun TelegramBot.uploadStickerFile( userId: UserId, sticker: MultipartFile ) = execute( UploadStickerFile(userId, sticker) ) -suspend fun RequestsExecutor.uploadStickerFile( +suspend fun TelegramBot.uploadStickerFile( user: CommonUser, sticker: MultipartFile ) = execute( 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 index 24ae2bb00a..77a5b1a992 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.DeleteWebhook -suspend fun RequestsExecutor.deleteWebhook() = execute(DeleteWebhook()) +suspend fun TelegramBot.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 index e8547f44d6..64586e61f9 100644 --- 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 @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.GetWebhookInfo -suspend fun RequestsExecutor.getWebhookInfo() = execute(GetWebhookInfo()) +suspend fun TelegramBot.getWebhookInfo() = execute(GetWebhookInfo()) diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt index 5878a01717..43b0b9ff1f 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt @@ -1,6 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.webhook -import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor +import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook /** * Use this method to send information about webhook (like [url]) */ -suspend fun RequestsExecutor.setWebhookInfo( +suspend fun TelegramBot.setWebhookInfo( url: String, maxAllowedConnections: Int? = null, allowedUpdates: List? = null @@ -21,7 +21,7 @@ suspend fun RequestsExecutor.setWebhookInfo( /** * Use this method to send information about webhook (like [url] and [certificate]) */ -suspend fun RequestsExecutor.setWebhookInfo( +suspend fun TelegramBot.setWebhookInfo( url: String, certificate: FileId, maxAllowedConnections: Int? = null, @@ -35,7 +35,7 @@ suspend fun RequestsExecutor.setWebhookInfo( /** * Use this method to send information about webhook (like [url] and [certificate]) */ -suspend fun RequestsExecutor.setWebhookInfo( +suspend fun TelegramBot.setWebhookInfo( url: String, certificate: MultipartFile, maxAllowedConnections: Int? = null,