diff --git a/tgbotapi.api/build.gradle b/tgbotapi.api/build.gradle index 20b3969dc6..1e1e2a6a8f 100644 --- a/tgbotapi.api/build.gradle +++ b/tgbotapi.api/build.gradle @@ -20,5 +20,5 @@ kotlin { languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi") } } + explicitApi() } - diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerCallbackQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerCallbackQuery.kt index 3eedd99183..39a06c36f5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerCallbackQuery.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerCallbackQuery.kt @@ -5,26 +5,26 @@ import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery import dev.inmo.tgbotapi.types.CallbackQueryId -suspend fun TelegramBot.answerCallbackQuery( +public suspend fun TelegramBot.answerCallbackQuery( callbackQueryId: CallbackQueryId, text: String? = null, showAlert: Boolean? = null, url: String? = null, cachedTimeSeconds: Int? = null -) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds)) +): Boolean = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds)) -suspend fun TelegramBot.answerCallbackQuery( +public suspend fun TelegramBot.answerCallbackQuery( callbackQuery: CallbackQuery, text: String? = null, showAlert: Boolean? = null, url: String? = null, cachedTimeSeconds: Int? = null -) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds) +): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds) -suspend fun TelegramBot.answer( +public suspend fun TelegramBot.answer( callbackQuery: CallbackQuery, text: String? = null, showAlert: Boolean? = null, url: String? = null, cachedTimeSeconds: Int? = null -) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds) +): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerInlineQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerInlineQuery.kt index ece3fc6721..9253c664a1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerInlineQuery.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerInlineQuery.kt @@ -7,36 +7,36 @@ import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQ import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery import dev.inmo.tgbotapi.types.InlineQueryId -suspend fun TelegramBot.answerInlineQuery( +public suspend fun TelegramBot.answerInlineQuery( inlineQueryID: InlineQueryId, results: List = emptyList(), cachedTime: Int? = null, isPersonal: Boolean? = null, nextOffset: String? = null, button: InlineQueryResultsButton? = null -) = execute( +): Boolean = execute( AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, button) ) -suspend fun TelegramBot.answerInlineQuery( +public suspend fun TelegramBot.answerInlineQuery( inlineQuery: InlineQuery, results: List = emptyList(), cachedTime: Int? = null, isPersonal: Boolean? = null, nextOffset: String? = null, button: InlineQueryResultsButton? = null -) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button) +): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button) -suspend fun TelegramBot.answer( +public suspend fun TelegramBot.answer( inlineQuery: InlineQuery, results: List = emptyList(), cachedTime: Int? = null, isPersonal: Boolean? = null, nextOffset: String? = null, button: InlineQueryResultsButton? = null -) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button) +): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button) -suspend fun TelegramBot.answerInlineQuery( +public suspend fun TelegramBot.answerInlineQuery( inlineQueryID: InlineQueryId, results: List = emptyList(), cachedTime: Int? = null, @@ -44,11 +44,11 @@ suspend fun TelegramBot.answerInlineQuery( nextOffset: String? = null, switchPmText: String?, switchPmParameter: String? -) = execute( +): Boolean = execute( AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) ) -suspend fun TelegramBot.answerInlineQuery( +public suspend fun TelegramBot.answerInlineQuery( inlineQuery: InlineQuery, results: List = emptyList(), cachedTime: Int? = null, @@ -56,9 +56,9 @@ suspend fun TelegramBot.answerInlineQuery( nextOffset: String? = null, switchPmText: String?, switchPmParameter: String? -) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) +): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) -suspend fun TelegramBot.answer( +public suspend fun TelegramBot.answer( inlineQuery: InlineQuery, results: List = emptyList(), cachedTime: Int? = null, @@ -66,4 +66,4 @@ suspend fun TelegramBot.answer( nextOffset: String? = null, switchPmText: String?, switchPmParameter: String? -) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) +): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerWebAppQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerWebAppQuery.kt index edd92b0089..6702354f82 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerWebAppQuery.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/AnswerWebAppQuery.kt @@ -4,13 +4,14 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.answers.AnswerWebAppQuery import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult import dev.inmo.tgbotapi.types.WebAppQueryId +import dev.inmo.tgbotapi.types.webapps.query.SentWebAppMessage -suspend fun TelegramBot.answerWebAppQuery( +public suspend fun TelegramBot.answerWebAppQuery( webAppQueryId: WebAppQueryId, result: InlineQueryResult -) = execute(AnswerWebAppQuery(webAppQueryId, result)) +): SentWebAppMessage = execute(AnswerWebAppQuery(webAppQueryId, result)) -suspend fun TelegramBot.answer( +public suspend fun TelegramBot.answer( webAppQueryId: WebAppQueryId, result: InlineQueryResult -) = execute(AnswerWebAppQuery(webAppQueryId, result)) +): SentWebAppMessage = execute(AnswerWebAppQuery(webAppQueryId, result)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt index fccfb36358..aa30f82cef 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerPreCheckoutQuery.kt @@ -6,18 +6,18 @@ import dev.inmo.tgbotapi.requests.answers.payments.AnswerPreCheckoutQueryOk import dev.inmo.tgbotapi.types.PreCheckoutQueryId import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery -suspend fun TelegramBot.answerPreCheckoutQueryOk( +public suspend fun TelegramBot.answerPreCheckoutQueryOk( id: PreCheckoutQueryId -) = execute(AnswerPreCheckoutQueryOk(id)) -suspend fun TelegramBot.answerPreCheckoutQueryOk( +): Boolean = execute(AnswerPreCheckoutQueryOk(id)) +public suspend fun TelegramBot.answerPreCheckoutQueryOk( preCheckoutQuery: PreCheckoutQuery -) = answerPreCheckoutQueryOk(preCheckoutQuery.id) +): Boolean = answerPreCheckoutQueryOk(preCheckoutQuery.id) -suspend fun TelegramBot.answerPreCheckoutQueryError( +public suspend fun TelegramBot.answerPreCheckoutQueryError( id: PreCheckoutQueryId, error: String -) = execute(AnswerPreCheckoutQueryError(id, error)) -suspend fun TelegramBot.answerPreCheckoutQueryError( +): Boolean = execute(AnswerPreCheckoutQueryError(id, error)) +public suspend fun TelegramBot.answerPreCheckoutQueryError( preCheckoutQuery: PreCheckoutQuery, error: String -) = answerPreCheckoutQueryError(preCheckoutQuery.id, error) +): Boolean = answerPreCheckoutQueryError(preCheckoutQuery.id, error) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerShippingQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerShippingQuery.kt index 2290b007e1..44517c1090 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerShippingQuery.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/answers/payments/AnswerShippingQuery.kt @@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ShippingQueryId import dev.inmo.tgbotapi.types.payments.ShippingOption import dev.inmo.tgbotapi.types.payments.ShippingQuery -suspend fun TelegramBot.answerShippingQueryOk( +public suspend fun TelegramBot.answerShippingQueryOk( id: ShippingQueryId, shippingOptions: List -) = execute(AnswerShippingQueryOk(id, shippingOptions)) -suspend fun TelegramBot.answerShippingQueryOk( +): Boolean = execute(AnswerShippingQueryOk(id, shippingOptions)) +public suspend fun TelegramBot.answerShippingQueryOk( shippingQuery: ShippingQuery, shippingOptions: List -) = answerShippingQueryOk(shippingQuery.id, shippingOptions) +): Boolean = answerShippingQueryOk(shippingQuery.id, shippingOptions) -suspend fun TelegramBot.answerShippingQueryError( +public suspend fun TelegramBot.answerShippingQueryError( id: ShippingQueryId, error: String -) = execute(AnswerShippingQueryError(id, error)) -suspend fun TelegramBot.answerShippingQueryError( +): Boolean = execute(AnswerShippingQueryError(id, error)) +public suspend fun TelegramBot.answerShippingQueryError( shippingQuery: ShippingQuery, error: String -) = answerShippingQueryError(shippingQuery.id, error) +): Boolean = answerShippingQueryError(shippingQuery.id, error) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/ClearMyDefaultAdministratorRights.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/ClearMyDefaultAdministratorRights.kt index f07fad22c1..b8bd08e5e3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/ClearMyDefaultAdministratorRights.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/ClearMyDefaultAdministratorRights.kt @@ -3,10 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.ClearMyDefaultAdministratorRights -suspend fun TelegramBot.clearMyDefaultAdministratorRights( +public suspend fun TelegramBot.clearMyDefaultAdministratorRights( forChannels: Boolean? = null -) = execute(ClearMyDefaultAdministratorRights(forChannels)) +): Boolean = execute(ClearMyDefaultAdministratorRights(forChannels)) -suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels() = clearMyDefaultAdministratorRights(forChannels = true) +public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels(): Boolean = clearMyDefaultAdministratorRights(forChannels = true) -suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups() = clearMyDefaultAdministratorRights(forChannels = false) +public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups(): Boolean = clearMyDefaultAdministratorRights(forChannels = false) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/DeleteMyCommands.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/DeleteMyCommands.kt index c7a447c65b..3c948aef24 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/DeleteMyCommands.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/DeleteMyCommands.kt @@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.deleteMyCommands( +public suspend fun TelegramBot.deleteMyCommands( scope: BotCommandScope = BotCommandScopeDefault, languageCode: IetfLang? -) = execute(DeleteMyCommands(scope, languageCode)) +): Boolean = execute(DeleteMyCommands(scope, languageCode)) -suspend fun TelegramBot.deleteMyCommands( +public suspend fun TelegramBot.deleteMyCommands( scope: BotCommandScope = BotCommandScopeDefault, languageCode: String? = null -) = deleteMyCommands(scope, languageCode ?.let(::IetfLang)) +): Boolean = deleteMyCommands(scope, languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMe.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMe.kt index 0ff52dfdf7..3cf44813e5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMe.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMe.kt @@ -2,5 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMe +import dev.inmo.tgbotapi.types.chat.ExtendedBot -suspend fun TelegramBot.getMe() = execute(GetMe) +public suspend fun TelegramBot.getMe(): ExtendedBot = execute(GetMe) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyCommands.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyCommands.kt index cbb4283076..24b956520b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyCommands.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyCommands.kt @@ -3,15 +3,16 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.micro_utils.language_codes.IetfLang import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMyCommands +import dev.inmo.tgbotapi.types.BotCommand import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.getMyCommands( +public suspend fun TelegramBot.getMyCommands( scope: BotCommandScope = BotCommandScopeDefault, languageCode: IetfLang? = null -) = execute(GetMyCommands(scope, languageCode)) +): List = execute(GetMyCommands(scope, languageCode)) -suspend fun TelegramBot.getMyCommands( +public suspend fun TelegramBot.getMyCommands( scope: BotCommandScope = BotCommandScopeDefault, languageCode: String? -) = getMyCommands(scope, languageCode ?.let(::IetfLang)) +): List = getMyCommands(scope, languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDefaultAdministratorRights.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDefaultAdministratorRights.kt index 74eae1d136..d9fb16efc8 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDefaultAdministratorRights.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDefaultAdministratorRights.kt @@ -2,11 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMyDefaultAdministratorRights +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -suspend fun TelegramBot.getMyDefaultAdministratorRights( +public suspend fun TelegramBot.getMyDefaultAdministratorRights( forChannels: Boolean? = null -) = execute(GetMyDefaultAdministratorRights(forChannels)) +): AdministratorChatMember = execute(GetMyDefaultAdministratorRights(forChannels)) -suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels() = getMyDefaultAdministratorRights(forChannels = true) +public suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = true) -suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups() = getMyDefaultAdministratorRights(forChannels = false) +public suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = false) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDescription.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDescription.kt index cf551df0d2..1873e01b77 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDescription.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyDescription.kt @@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.micro_utils.language_codes.IetfLang import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMyDescription +import dev.inmo.tgbotapi.types.BotDescription -suspend fun TelegramBot.getMyDescription( +public suspend fun TelegramBot.getMyDescription( languageCode: IetfLang? = null -) = execute(GetMyDescription(languageCode)) +): BotDescription = execute(GetMyDescription(languageCode)) -suspend fun TelegramBot.getMyDescription( +public suspend fun TelegramBot.getMyDescription( languageCode: String? -) = getMyDescription(languageCode ?.let(::IetfLang)) +): BotDescription = getMyDescription(languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyName.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyName.kt index 4783234dd9..aab09cb44c 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyName.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyName.kt @@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.bot import dev.inmo.micro_utils.language_codes.IetfLang import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMyName +import dev.inmo.tgbotapi.types.BotName -suspend fun TelegramBot.getMyName( +public suspend fun TelegramBot.getMyName( languageCode: IetfLang? = null -) = execute(GetMyName(languageCode)) +): BotName = execute(GetMyName(languageCode)) -suspend fun TelegramBot.getMyName( +public suspend fun TelegramBot.getMyName( languageCode: String? -) = getMyName(languageCode ?.let(::IetfLang)) +): BotName = getMyName(languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescription.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescription.kt index 32dc212ec3..3831525b7a 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescription.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescription.kt @@ -4,13 +4,14 @@ import dev.inmo.micro_utils.language_codes.IetfLang import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.GetMyCommands import dev.inmo.tgbotapi.requests.bot.GetMyShortDescription +import dev.inmo.tgbotapi.types.BotShortDescription import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.getMyShortDescription( +public suspend fun TelegramBot.getMyShortDescription( languageCode: IetfLang? = null -) = execute(GetMyShortDescription(languageCode)) +): BotShortDescription = execute(GetMyShortDescription(languageCode)) -suspend fun TelegramBot.getMyShortDescription( +public suspend fun TelegramBot.getMyShortDescription( languageCode: String? -) = getMyShortDescription(languageCode ?.let(::IetfLang)) +): BotShortDescription = getMyShortDescription(languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyCommands.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyCommands.kt index ec67a624c8..0c1ed0712f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyCommands.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyCommands.kt @@ -7,26 +7,26 @@ import dev.inmo.tgbotapi.types.BotCommand import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.setMyCommands( +public suspend fun TelegramBot.setMyCommands( commands: List, scope: BotCommandScope = BotCommandScopeDefault, languageCode: IetfLang? -) = execute(SetMyCommands(commands, scope, languageCode)) +): Boolean = execute(SetMyCommands(commands, scope, languageCode)) -suspend fun TelegramBot.setMyCommands( +public suspend fun TelegramBot.setMyCommands( vararg commands: BotCommand, scope: BotCommandScope = BotCommandScopeDefault, languageCode: IetfLang? -) = setMyCommands(commands.toList(), scope, languageCode) +): Boolean = setMyCommands(commands.toList(), scope, languageCode) -suspend fun TelegramBot.setMyCommands( +public suspend fun TelegramBot.setMyCommands( commands: List, scope: BotCommandScope = BotCommandScopeDefault, languageCode: String? = null -) = setMyCommands(commands, scope, languageCode ?.let(::IetfLang)) +): Boolean = setMyCommands(commands, scope, languageCode ?.let(::IetfLang)) -suspend fun TelegramBot.setMyCommands( +public suspend fun TelegramBot.setMyCommands( vararg commands: BotCommand, scope: BotCommandScope = BotCommandScopeDefault, languageCode: String? = null -) = setMyCommands(commands.toList(), scope, languageCode) +): Boolean = setMyCommands(commands.toList(), scope, languageCode) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDefaultAdministratorRights.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDefaultAdministratorRights.kt index cf73ed006f..33095af1a3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDefaultAdministratorRights.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDefaultAdministratorRights.kt @@ -4,15 +4,15 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights -suspend fun TelegramBot.setMyDefaultAdministratorRights( +public suspend fun TelegramBot.setMyDefaultAdministratorRights( rights: ChatCommonAdministratorRights, forChannels: Boolean? = null -) = execute(SetMyDefaultAdministratorRights(rights, forChannels)) +): Boolean = execute(SetMyDefaultAdministratorRights(rights, forChannels)) -suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels( +public suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels( rights: ChatCommonAdministratorRights -) = setMyDefaultAdministratorRights(rights, forChannels = true) +): Boolean = setMyDefaultAdministratorRights(rights, forChannels = true) -suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups( +public suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups( rights: ChatCommonAdministratorRights -) = setMyDefaultAdministratorRights(rights, forChannels = false) +): Boolean = setMyDefaultAdministratorRights(rights, forChannels = false) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDescription.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDescription.kt index 11f23cb34c..7f406f06cf 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDescription.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyDescription.kt @@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.requests.bot.SetMyDescription import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.setMyDescription( +public suspend fun TelegramBot.setMyDescription( description: String? = null, languageCode: IetfLang? = null -) = execute(SetMyDescription(description, languageCode)) +): Boolean = execute(SetMyDescription(description, languageCode)) -suspend fun TelegramBot.setMyDescription( +public suspend fun TelegramBot.setMyDescription( description: String?, languageCode: String? -) = setMyDescription(description, languageCode ?.let(::IetfLang)) +): Boolean = setMyDescription(description, languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyName.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyName.kt index 7e727c1fc4..0855de2b94 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyName.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyName.kt @@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.requests.bot.SetMyName import dev.inmo.tgbotapi.types.commands.BotCommandScope import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault -suspend fun TelegramBot.setMyName( +public suspend fun TelegramBot.setMyName( name: String? = null, languageCode: IetfLang? = null -) = execute(SetMyName(name, languageCode)) +): Boolean = execute(SetMyName(name, languageCode)) -suspend fun TelegramBot.setMyName( +public suspend fun TelegramBot.setMyName( name: String?, languageCode: String? -) = setMyName(name, languageCode ?.let(::IetfLang)) +): Boolean = setMyName(name, languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyShortDescription.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyShortDescription.kt index 9431090b54..2c71019a7f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyShortDescription.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyShortDescription.kt @@ -4,12 +4,12 @@ import dev.inmo.micro_utils.language_codes.IetfLang import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription -suspend fun TelegramBot.setMyShortDescription( +public suspend fun TelegramBot.setMyShortDescription( shortDescription: String? = null, languageCode: IetfLang? = null -) = execute(SetMyShortDescription(shortDescription, languageCode)) +): Boolean = execute(SetMyShortDescription(shortDescription, languageCode)) -suspend fun TelegramBot.setMyShortDescription( +public suspend fun TelegramBot.setMyShortDescription( shortDescription: String?, languageCode: String? -) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang)) +): Boolean = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/ExportChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/ExportChatInviteLink.kt index 0db9f42685..0f2da7bfa7 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/ExportChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/ExportChatInviteLink.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.ExportChatInviteLink import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.exportChatInviteLink( +public suspend fun TelegramBot.exportChatInviteLink( chatId: ChatIdentifier -) = execute(ExportChatInviteLink(chatId)) +): String = execute(ExportChatInviteLink(chatId)) -suspend fun TelegramBot.exportChatInviteLink( +public suspend fun TelegramBot.exportChatInviteLink( chat: PublicChat -) = exportChatInviteLink(chat.id) +): String = exportChatInviteLink(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/LeaveChat.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/LeaveChat.kt index 607cd27c90..3408c0c4f6 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/LeaveChat.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/LeaveChat.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.LeaveChat import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.leaveChat( +public suspend fun TelegramBot.leaveChat( chatId: ChatIdentifier -) = execute(LeaveChat(chatId)) +): Boolean = execute(LeaveChat(chatId)) -suspend fun TelegramBot.leaveChat( +public suspend fun TelegramBot.leaveChat( chat: PublicChat -) = leaveChat(chat.id) +): Boolean = leaveChat(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseForumTopic.kt index 778fc29129..6c6d8ebeac 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseForumTopic.kt @@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.closeForumTopic( +public suspend fun TelegramBot.closeForumTopic( chatId: ChatIdentifier, messageThreadId: MessageThreadId -) = execute( +): Boolean = execute( CloseForumTopic( chatId, messageThreadId ) ) -suspend fun TelegramBot.closeForumTopic( +public suspend fun TelegramBot.closeForumTopic( chat: Chat, messageThreadId: MessageThreadId -) = closeForumTopic(chat.id, messageThreadId) +): Boolean = closeForumTopic(chat.id, messageThreadId) -suspend fun TelegramBot.closeForumTopic( +public suspend fun TelegramBot.closeForumTopic( chat: Chat, forumTopic: ForumTopic -) = closeForumTopic(chat.id, forumTopic.messageThreadId) +): Boolean = closeForumTopic(chat.id, forumTopic.messageThreadId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseGeneralForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseGeneralForumTopic.kt index f472ed6ecd..4f5639aba0 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseGeneralForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CloseGeneralForumTopic.kt @@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.closeGeneralForumTopic( +public suspend fun TelegramBot.closeGeneralForumTopic( chatId: ChatIdentifier -) = execute( +): Boolean = execute( CloseGeneralForumTopic(chatId) ) -suspend fun TelegramBot.closeGeneralForumTopic( +public suspend fun TelegramBot.closeGeneralForumTopic( chat: Chat -) = closeGeneralForumTopic(chat.id) +): Boolean = closeGeneralForumTopic(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CreateForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CreateForumTopic.kt index 016917a45d..6e8cf1637d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CreateForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/CreateForumTopic.kt @@ -4,15 +4,16 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.forum.CreateForumTopic import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.utils.RGBColor -suspend fun TelegramBot.createForumTopic( +public suspend fun TelegramBot.createForumTopic( chatId: ChatIdentifier, name: String, color: RGBColor, iconEmojiId: CustomEmojiId? = null -) = execute( +): ForumTopic = execute( CreateForumTopic( chatId, name, @@ -21,9 +22,9 @@ suspend fun TelegramBot.createForumTopic( ) ) -suspend fun TelegramBot.createForumTopic( +public suspend fun TelegramBot.createForumTopic( chat: Chat, name: String, color: RGBColor, iconEmojiId: CustomEmojiId? = null -) = createForumTopic(chat.id, name, color, iconEmojiId) +): ForumTopic = createForumTopic(chat.id, name, color, iconEmojiId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/DeleteForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/DeleteForumTopic.kt index 6de481c828..a703ed3ecc 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/DeleteForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/DeleteForumTopic.kt @@ -7,27 +7,27 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.deleteForumTopic( +public suspend fun TelegramBot.deleteForumTopic( chatId: ChatIdentifier, messageThreadId: MessageThreadId -) = execute( +): Boolean = execute( DeleteForumTopic( chatId, messageThreadId ) ) -suspend fun TelegramBot.deleteForumTopic( +public suspend fun TelegramBot.deleteForumTopic( chatId: ChatIdentifier, forumTopic: ForumTopic -) = deleteForumTopic(chatId, forumTopic.messageThreadId) +): Boolean = deleteForumTopic(chatId, forumTopic.messageThreadId) -suspend fun TelegramBot.deleteForumTopic( +public suspend fun TelegramBot.deleteForumTopic( chat: Chat, messageThreadId: MessageThreadId -) = deleteForumTopic(chat.id, messageThreadId) +): Boolean = deleteForumTopic(chat.id, messageThreadId) -suspend fun TelegramBot.deleteForumTopic( +public suspend fun TelegramBot.deleteForumTopic( chat: Chat, forumTopic: ForumTopic -) = deleteForumTopic(chat.id, forumTopic.messageThreadId) +): Boolean = deleteForumTopic(chat.id, forumTopic.messageThreadId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditForumTopic.kt index 7676246e31..e1cf4b09a3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditForumTopic.kt @@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.editForumTopic( +public suspend fun TelegramBot.editForumTopic( chatId: ChatIdentifier, messageThreadId: MessageThreadId, name: String? = null, iconEmojiId: CustomEmojiId? = null -) = execute( +): Boolean = execute( EditForumTopic( chatId, messageThreadId, @@ -22,15 +22,15 @@ suspend fun TelegramBot.editForumTopic( ) ) -suspend fun TelegramBot.editForumTopic( +public suspend fun TelegramBot.editForumTopic( chat: Chat, messageThreadId: MessageThreadId, name: String? = null, iconEmojiId: CustomEmojiId? = null -) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId) +): Boolean = editForumTopic(chat.id, messageThreadId, name, iconEmojiId) -suspend fun TelegramBot.editForumTopic( +public suspend fun TelegramBot.editForumTopic( chatIdentifier: ChatIdentifier, forumTopic: ForumTopic, iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId -) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId) +): Boolean = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditGeneralForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditGeneralForumTopic.kt index 0f71e50e2b..78b66b9505 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditGeneralForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/EditGeneralForumTopic.kt @@ -9,22 +9,22 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.editGeneralForumTopic( +public suspend fun TelegramBot.editGeneralForumTopic( chatId: ChatIdentifier, name: String -) = execute( +): Boolean = execute( EditGeneralForumTopic( chatId, name ) ) -suspend fun TelegramBot.editGeneralForumTopic( +public suspend fun TelegramBot.editGeneralForumTopic( chat: Chat, name: String -) = editGeneralForumTopic(chat.id, name) +): Boolean = editGeneralForumTopic(chat.id, name) -suspend fun TelegramBot.editGeneralForumTopic( +public suspend fun TelegramBot.editGeneralForumTopic( chatIdentifier: ChatIdentifier, forumTopic: ForumTopic, -) = editGeneralForumTopic(chatIdentifier, forumTopic.name) +): Boolean = editGeneralForumTopic(chatIdentifier, forumTopic.name) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/HideGeneralForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/HideGeneralForumTopic.kt index 3bd76b8b7d..a85e601009 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/HideGeneralForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/HideGeneralForumTopic.kt @@ -9,12 +9,12 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.hideGeneralForumTopic( +public suspend fun TelegramBot.hideGeneralForumTopic( chatId: ChatIdentifier -) = execute( +): Boolean = execute( HideGeneralForumTopic(chatId) ) -suspend fun TelegramBot.hideGeneralForumTopic( +public suspend fun TelegramBot.hideGeneralForumTopic( chat: Chat -) = hideGeneralForumTopic(chat.id) +): Boolean = hideGeneralForumTopic(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenForumTopic.kt index 35bbd9cf6b..b6dbe88bf9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenForumTopic.kt @@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.reopenForumTopic( +public suspend fun TelegramBot.reopenForumTopic( chatId: ChatIdentifier, messageThreadId: MessageThreadId -) = execute( +): Boolean = execute( ReopenForumTopic( chatId, messageThreadId ) ) -suspend fun TelegramBot.reopenForumTopic( +public suspend fun TelegramBot.reopenForumTopic( chat: Chat, messageThreadId: MessageThreadId -) = reopenForumTopic(chat.id, messageThreadId) +): Boolean = reopenForumTopic(chat.id, messageThreadId) -suspend fun TelegramBot.reopenForumTopic( +public suspend fun TelegramBot.reopenForumTopic( chat: Chat, forumTopic: ForumTopic -) = reopenForumTopic(chat.id, forumTopic.messageThreadId) +): Boolean = reopenForumTopic(chat.id, forumTopic.messageThreadId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenGeneralForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenGeneralForumTopic.kt index 4492c5b599..1f87671d97 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenGeneralForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/ReopenGeneralForumTopic.kt @@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.reopenGeneralForumTopic( +public suspend fun TelegramBot.reopenGeneralForumTopic( chatId: ChatIdentifier -) = execute( +): Boolean = execute( ReopenGeneralForumTopic(chatId) ) -suspend fun TelegramBot.reopenGeneralForumTopic( +public suspend fun TelegramBot.reopenGeneralForumTopic( chat: Chat -) = reopenGeneralForumTopic(chat.id) +): Boolean = reopenGeneralForumTopic(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnhideGeneralForumTopic.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnhideGeneralForumTopic.kt index 1f6ef3c5cb..2e40e5e730 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnhideGeneralForumTopic.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnhideGeneralForumTopic.kt @@ -10,12 +10,12 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.unhideGeneralForumTopic( +public suspend fun TelegramBot.unhideGeneralForumTopic( chatId: ChatIdentifier -) = execute( +): Boolean = execute( UnhideGeneralForumTopic(chatId) ) -suspend fun TelegramBot.unhideGeneralForumTopic( +public suspend fun TelegramBot.unhideGeneralForumTopic( chat: Chat -) = unhideGeneralForumTopic(chat.id) +): Boolean = unhideGeneralForumTopic(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllForumTopicMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllForumTopicMessages.kt index 9f8ed3f2a7..8ca83be003 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllForumTopicMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllForumTopicMessages.kt @@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.unpinAllForumTopicMessages( +public suspend fun TelegramBot.unpinAllForumTopicMessages( chatId: ChatIdentifier, messageThreadId: MessageThreadId -) = execute( +): Boolean = execute( UnpinAllForumTopicMessages( chatId, messageThreadId ) ) -suspend fun TelegramBot.unpinAllForumTopicMessages( +public suspend fun TelegramBot.unpinAllForumTopicMessages( chat: Chat, messageThreadId: MessageThreadId -) = unpinAllForumTopicMessages(chat.id, messageThreadId) +): Boolean = unpinAllForumTopicMessages(chat.id, messageThreadId) -suspend fun TelegramBot.unpinAllForumTopicMessages( +public suspend fun TelegramBot.unpinAllForumTopicMessages( chat: Chat, forumTopic: ForumTopic -) = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId) +): Boolean = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllGeneralForumTopicMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllGeneralForumTopicMessages.kt index 39afb4b290..a77ebb73a3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllGeneralForumTopicMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/forum/UnpinAllGeneralForumTopicMessages.kt @@ -8,14 +8,14 @@ import dev.inmo.tgbotapi.types.ForumTopic import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.unpinAllGeneralForumTopicMessages( +public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages( chatId: ChatIdentifier -) = execute( +): Boolean = execute( UnpinAllGeneralForumTopicMessages( chatId ) ) -suspend fun TelegramBot.unpinAllGeneralForumTopicMessages( +public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages( chat: Chat -) = unpinAllGeneralForumTopicMessages(chat.id) +): Boolean = unpinAllGeneralForumTopicMessages(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChat.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChat.kt index 6cfd50972a..762a378cb5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChat.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChat.kt @@ -3,36 +3,16 @@ package dev.inmo.tgbotapi.extensions.api.chat.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.get.GetChat import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.chat.ChannelChat -import dev.inmo.tgbotapi.types.chat.ChannelChatImpl -import dev.inmo.tgbotapi.types.chat.Chat -import dev.inmo.tgbotapi.types.chat.CommonUser -import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat -import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat -import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat -import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat -import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat -import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedUser -import dev.inmo.tgbotapi.types.chat.GroupChat -import dev.inmo.tgbotapi.types.chat.GroupChatImpl -import dev.inmo.tgbotapi.types.chat.PrivateChat -import dev.inmo.tgbotapi.types.chat.PrivateChatImpl -import dev.inmo.tgbotapi.types.chat.PublicChat -import dev.inmo.tgbotapi.types.chat.SupergroupChat -import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl +import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.utils.PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chatId: ChatIdentifier -) = execute(GetChat(chatId)) +): ExtendedChat = execute(GetChat(chatId)) -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: Chat -) = getChat(chat.id) +): ExtendedChat = getChat(chat.id) /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -41,9 +21,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: PublicChat -) = getChat(chat.id) as ExtendedPublicChat +): ExtendedPublicChat = getChat(chat.id) as ExtendedPublicChat /** @@ -53,9 +33,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: ChannelChat -) = getChat(chat.id) as ExtendedChannelChat +): ExtendedChannelChat = getChat(chat.id) as ExtendedChannelChat /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -64,9 +44,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: ChannelChatImpl -) = getChat(chat.id) as ExtendedChannelChatImpl +): ExtendedChannelChatImpl = getChat(chat.id) as ExtendedChannelChatImpl /** @@ -76,9 +56,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: GroupChat -) = getChat(chat.id) as ExtendedGroupChat +): ExtendedGroupChat = getChat(chat.id) as ExtendedGroupChat /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -87,9 +67,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: GroupChatImpl -) = getChat(chat.id) as ExtendedGroupChatImpl +): ExtendedGroupChatImpl = getChat(chat.id) as ExtendedGroupChatImpl /** @@ -99,9 +79,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: SupergroupChat -) = getChat(chat.id) as ExtendedSupergroupChat +): ExtendedSupergroupChat = getChat(chat.id) as ExtendedSupergroupChat /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -110,9 +90,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: SupergroupChatImpl -) = getChat(chat.id) as ExtendedSupergroupChatImpl +): ExtendedSupergroupChatImpl = getChat(chat.id) as ExtendedSupergroupChatImpl /** @@ -122,9 +102,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: PrivateChat -) = getChat(chat.id) as ExtendedPrivateChat +): ExtendedPrivateChat = getChat(chat.id) as ExtendedPrivateChat /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -133,9 +113,9 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: PrivateChatImpl -) = getChat(chat.id) as ExtendedPrivateChatImpl +): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl /** * Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a @@ -144,6 +124,6 @@ suspend fun TelegramBot.getChat( * @throws ClassCastException */ @PreviewFeature -suspend fun TelegramBot.getChat( +public suspend fun TelegramBot.getChat( chat: CommonUser -) = getChat(chat.id) as ExtendedUser +): ExtendedUser = getChat(chat.id) as ExtendedUser diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatAdministrators.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatAdministrators.kt index ff272ecbd7..867dee0358 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatAdministrators.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatAdministrators.kt @@ -4,11 +4,12 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.get.GetChatAdministrators import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -suspend fun TelegramBot.getChatAdministrators( +public suspend fun TelegramBot.getChatAdministrators( chatId: ChatIdentifier -) = execute(GetChatAdministrators(chatId)) +): List = execute(GetChatAdministrators(chatId)) -suspend fun TelegramBot.getChatAdministrators( +public suspend fun TelegramBot.getChatAdministrators( chat: PublicChat -) = getChatAdministrators(chat.id) +): List = getChatAdministrators(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt index 0caa2258db..c1bdd84bdf 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.getChatMemberCount( +public suspend fun TelegramBot.getChatMemberCount( chatId: ChatIdentifier -) = execute(GetChatMemberCount(chatId)) +): Int = execute(GetChatMemberCount(chatId)) -suspend fun TelegramBot.getChatMemberCount( +public suspend fun TelegramBot.getChatMemberCount( chat: PublicChat -) = getChatMemberCount(chat.id) +): Int = getChatMemberCount(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMenuButton.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMenuButton.kt index e75c0aa02d..03f8a2b839 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMenuButton.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMenuButton.kt @@ -3,12 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.chat.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton import dev.inmo.tgbotapi.types.IdChatIdentifier +import dev.inmo.tgbotapi.types.MenuButton import dev.inmo.tgbotapi.types.chat.PrivateChat -suspend fun TelegramBot.getChatMenuButton( +public suspend fun TelegramBot.getChatMenuButton( chatId: IdChatIdentifier -) = execute(GetChatMenuButton(chatId)) +): MenuButton = execute(GetChatMenuButton(chatId)) -suspend fun TelegramBot.getChatMenuButton( +public suspend fun TelegramBot.getChatMenuButton( chat: PrivateChat -) = getChatMenuButton(chat.id) +): MenuButton = getChatMenuButton(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetDefaultChatMenuButton.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetDefaultChatMenuButton.kt index 441317bd11..ec79ed4d20 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetDefaultChatMenuButton.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetDefaultChatMenuButton.kt @@ -2,5 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.chat.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton +import dev.inmo.tgbotapi.types.MenuButton -suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton) +public suspend fun TelegramBot.getDefaultChatMenuButton(): MenuButton = execute(GetDefaultChatMenuButton) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetForumTopicIconStickers.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetForumTopicIconStickers.kt index bdaccb143f..e38afda2c3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetForumTopicIconStickers.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetForumTopicIconStickers.kt @@ -2,5 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.chat.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.get.GetForumTopicIconStickers +import dev.inmo.tgbotapi.types.files.Sticker -suspend fun TelegramBot.getForumTopicIconStickers() = execute(GetForumTopicIconStickers) +public suspend fun TelegramBot.getForumTopicIconStickers(): List = execute(GetForumTopicIconStickers) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/ApproveChatJoinRequest.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/ApproveChatJoinRequest.kt index 81add7d304..f49c013b48 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/ApproveChatJoinRequest.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/ApproveChatJoinRequest.kt @@ -9,34 +9,34 @@ import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chatId: ChatIdentifier, userId: UserId -) = execute(ApproveChatJoinRequest(chatId, userId)) +): Boolean = execute(ApproveChatJoinRequest(chatId, userId)) -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chat: PublicChat, userId: UserId -) = approveChatJoinRequest(chat.id, userId) +): Boolean = approveChatJoinRequest(chat.id, userId) -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chatId: ChatIdentifier, user: User -) = approveChatJoinRequest(chatId, user.id) +): Boolean = approveChatJoinRequest(chatId, user.id) -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chat: PublicChat, user: User -) = approveChatJoinRequest(chat.id, user.id) +): Boolean = approveChatJoinRequest(chat.id, user.id) -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chatJoinRequest: ChatJoinRequest -) = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user) +): Boolean = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user) -suspend fun TelegramBot.approve( +public suspend fun TelegramBot.approve( chatJoinRequest: ChatJoinRequest -) = approveChatJoinRequest(chatJoinRequest) +): Boolean = approveChatJoinRequest(chatJoinRequest) -suspend fun TelegramBot.approveChatJoinRequest( +public suspend fun TelegramBot.approveChatJoinRequest( chatJoinRequestUpdate: ChatJoinRequestUpdate -) = approveChatJoinRequest(chatJoinRequestUpdate.data) +): Boolean = approveChatJoinRequest(chatJoinRequestUpdate.data) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt index 524adce2ca..9cd4c510cd 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt @@ -3,84 +3,81 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links import korlibs.time.DateTime import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MembersLimit -import dev.inmo.tgbotapi.types.TelegramDate +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.PublicChat -import dev.inmo.tgbotapi.types.toTelegramDate -suspend fun TelegramBot.createChatInviteLinkUnlimited( +public suspend fun TelegramBot.createChatInviteLinkUnlimited( chatId: ChatIdentifier, name: String? = null, expiration: TelegramDate? = null -) = execute(CreateChatInviteLink.unlimited(chatId, name, expiration)) +): ChatInviteLinkUnlimited = execute(CreateChatInviteLink.unlimited(chatId, name, expiration)) -suspend fun TelegramBot.createChatInviteLinkUnlimited( +public suspend fun TelegramBot.createChatInviteLinkUnlimited( chat: PublicChat, name: String? = null, expiration: TelegramDate? = null, -) = createChatInviteLinkUnlimited(chat.id, name, expiration) +): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration) -suspend fun TelegramBot.createChatInviteLinkUnlimited( +public suspend fun TelegramBot.createChatInviteLinkUnlimited( chatId: ChatIdentifier, expiration: DateTime, name: String? = null, -) = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate()) -suspend fun TelegramBot.createChatInviteLinkUnlimited( +public suspend fun TelegramBot.createChatInviteLinkUnlimited( chat: PublicChat, expiration: DateTime, name: String? = null -) = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate()) -suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null -) = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration)) +): ChatInviteLinkWithLimitedMembers = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration)) -suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( chat: PublicChat, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null, -) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration) +): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration) -suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate()) -suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers( chat: PublicChat, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate()) -suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, name: String? = null, expiration: TelegramDate? = null -) = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration)) +): ChatInviteLinkWithJoinRequest = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration)) -suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( chat: PublicChat, name: String? = null, expiration: TelegramDate? = null, -) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration) +): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration) -suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, expiration: DateTime, name: String? = null, -) = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate()) -suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( chat: PublicChat, expiration: DateTime, name: String? = null, -) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate()) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/DeclineChatJoinRequest.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/DeclineChatJoinRequest.kt index 9dac02ccfb..c49f731c1e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/DeclineChatJoinRequest.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/DeclineChatJoinRequest.kt @@ -9,34 +9,34 @@ import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chatId: ChatIdentifier, userId: UserId -) = execute(DeclineChatJoinRequest(chatId, userId)) +): Boolean = execute(DeclineChatJoinRequest(chatId, userId)) -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chat: PublicChat, userId: UserId -) = declineChatJoinRequest(chat.id, userId) +): Boolean = declineChatJoinRequest(chat.id, userId) -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chatId: ChatIdentifier, user: User -) = declineChatJoinRequest(chatId, user.id) +): Boolean = declineChatJoinRequest(chatId, user.id) -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chat: PublicChat, user: User -) = declineChatJoinRequest(chat.id, user.id) +): Boolean = declineChatJoinRequest(chat.id, user.id) -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chatJoinRequest: ChatJoinRequest -) = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user) +): Boolean = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user) -suspend fun TelegramBot.decline( +public suspend fun TelegramBot.decline( chatJoinRequest: ChatJoinRequest -) = declineChatJoinRequest(chatJoinRequest) +): Boolean = declineChatJoinRequest(chatJoinRequest) -suspend fun TelegramBot.declineChatJoinRequest( +public suspend fun TelegramBot.declineChatJoinRequest( chatJoinRequestUpdate: ChatJoinRequestUpdate -) = declineChatJoinRequest(chatJoinRequestUpdate.data) +): Boolean = declineChatJoinRequest(chatJoinRequestUpdate.data) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt index ecbafed90d..f4f9585d76 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt @@ -3,185 +3,181 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links import korlibs.time.DateTime import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.ChatInviteLink -import dev.inmo.tgbotapi.types.MembersLimit -import dev.inmo.tgbotapi.types.TelegramDate +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.PublicChat -import dev.inmo.tgbotapi.types.toTelegramDate -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chatId: ChatIdentifier, previousLink: String, name: String? = null, expiration: TelegramDate? = null -) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration)) +): ChatInviteLinkUnlimited = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration)) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chat: PublicChat, previousLink: String, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chatId: ChatIdentifier, previousLink: String, expiration: DateTime, name: String? = null, -) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chat: PublicChat, previousLink: String, expiration: DateTime, name: String? = null, -) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, previousLink: String, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null -) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration)) +): ChatInviteLinkWithLimitedMembers = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration)) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chat: PublicChat, previousLink: String, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, previousLink: String, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chat: PublicChat, previousLink: String, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, previousLink: String, name: String? = null, expiration: TelegramDate? = null -) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration)) +): ChatInviteLinkWithJoinRequest = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration)) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chat: PublicChat, previousLink: String, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, previousLink: String, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chat: PublicChat, previousLink: String, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chatId: ChatIdentifier, previousLink: ChatInviteLink, name: String? = null, expiration: TelegramDate? = null -) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chat: PublicChat, previousLink: ChatInviteLink, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chatId: ChatIdentifier, previousLink: ChatInviteLink, expiration: DateTime, name: String? = null, -) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkUnlimited( +public suspend fun TelegramBot.editChatInviteLinkUnlimited( chat: PublicChat, previousLink: ChatInviteLink, expiration: DateTime, name: String? = null, -) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, previousLink: ChatInviteLink, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null -) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chat: PublicChat, previousLink: ChatInviteLink, membersLimit: MembersLimit, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chatId: ChatIdentifier, previousLink: ChatInviteLink, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( +public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers( chat: PublicChat, previousLink: ChatInviteLink, membersLimit: MembersLimit, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate()) +): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, previousLink: ChatInviteLink, name: String? = null, expiration: TelegramDate? = null -) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chat: PublicChat, previousLink: ChatInviteLink, name: String? = null, expiration: TelegramDate? = null, -) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chatId: ChatIdentifier, previousLink: ChatInviteLink, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate()) -suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( +public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( chat: PublicChat, previousLink: ChatInviteLink, expiration: DateTime, name: String? = null, -) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate()) +): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate()) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChatInviteLink.kt index 145d4a2d81..28798c29f1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChatInviteLink.kt @@ -4,24 +4,25 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.invite_links.RevokeChatInviteLink import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatInviteLink +import dev.inmo.tgbotapi.types.SecondaryChatInviteLink import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.revokeChatInviteLink( +public suspend fun TelegramBot.revokeChatInviteLink( chatId: ChatIdentifier, previousLink: String -) = execute(RevokeChatInviteLink(chatId, previousLink)) +): SecondaryChatInviteLink = execute(RevokeChatInviteLink(chatId, previousLink)) -suspend fun TelegramBot.revokeChatInviteLink( +public suspend fun TelegramBot.revokeChatInviteLink( chat: PublicChat, previousLink: String -) = revokeChatInviteLink(chat.id, previousLink) +): SecondaryChatInviteLink = revokeChatInviteLink(chat.id, previousLink) -suspend fun TelegramBot.revokeChatInviteLink( +public suspend fun TelegramBot.revokeChatInviteLink( chatId: ChatIdentifier, previousLink: ChatInviteLink -) = revokeChatInviteLink(chatId, previousLink.inviteLink) +): SecondaryChatInviteLink = revokeChatInviteLink(chatId, previousLink.inviteLink) -suspend fun TelegramBot.revokeChatInviteLink( +public suspend fun TelegramBot.revokeChatInviteLink( chat: PublicChat, previousLink: ChatInviteLink -) = revokeChatInviteLink(chat, previousLink.inviteLink) +): SecondaryChatInviteLink = revokeChatInviteLink(chat, previousLink.inviteLink) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt index 36126639da..c5922acd09 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt @@ -9,30 +9,30 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.banChatMember( +public suspend fun TelegramBot.banChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, revokeMessages: Boolean? = null -) = execute(BanChatMember(chatId, userId, untilDate, revokeMessages)) +): Boolean = execute(BanChatMember(chatId, userId, untilDate, revokeMessages)) -suspend fun TelegramBot.banChatMember( +public suspend fun TelegramBot.banChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, revokeMessages: Boolean? = null -) = banChatMember(chat.id, userId, untilDate, revokeMessages) +): Boolean = banChatMember(chat.id, userId, untilDate, revokeMessages) -suspend fun TelegramBot.banChatMember( +public suspend fun TelegramBot.banChatMember( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, revokeMessages: Boolean? = null -) = banChatMember(chatId, user.id, untilDate, revokeMessages) +): Boolean = banChatMember(chatId, user.id, untilDate, revokeMessages) -suspend fun TelegramBot.banChatMember( +public suspend fun TelegramBot.banChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null, revokeMessages: Boolean? = null -) = banChatMember(chat.id, user.id, untilDate, revokeMessages) +): Boolean = banChatMember(chat.id, user.id, untilDate, revokeMessages) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatSenderChat.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatSenderChat.kt index f7ae9f6dba..ce84f0b1fd 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatSenderChat.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatSenderChat.kt @@ -6,22 +6,22 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.banChatSenderChat( +public suspend fun TelegramBot.banChatSenderChat( chatId: ChatIdentifier, senderChatId: IdChatIdentifier -) = execute(BanChatSenderChat(chatId, senderChatId)) +): Boolean = execute(BanChatSenderChat(chatId, senderChatId)) -suspend fun TelegramBot.banChatSenderChat( +public suspend fun TelegramBot.banChatSenderChat( chat: PublicChat, senderChatId: IdChatIdentifier -) = banChatSenderChat(chat.id, senderChatId) +): Boolean = banChatSenderChat(chat.id, senderChatId) -suspend fun TelegramBot.banChatSenderChat( +public suspend fun TelegramBot.banChatSenderChat( chatId: IdChatIdentifier, senderChat: PublicChat -) = banChatSenderChat(chatId, senderChat.id) +): Boolean = banChatSenderChat(chatId, senderChat.id) -suspend fun TelegramBot.banChatSenderChat( +public suspend fun TelegramBot.banChatSenderChat( chat: PublicChat, senderChat: PublicChat, -) = banChatSenderChat(chat.id, senderChat) +): Boolean = banChatSenderChat(chat.id, senderChat) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/GetChatMember.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/GetChatMember.kt index ea407e6674..00a62b682b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/GetChatMember.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/GetChatMember.kt @@ -7,23 +7,24 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.chat.member.ChatMember -suspend fun TelegramBot.getChatMember( +public suspend fun TelegramBot.getChatMember( chatId: ChatIdentifier, userId: UserId -) = execute(GetChatMember(chatId, userId)) +): ChatMember = execute(GetChatMember(chatId, userId)) -suspend fun TelegramBot.getChatMember( +public suspend fun TelegramBot.getChatMember( chat: PublicChat, userId: UserId -) = getChatMember(chat.id, userId) +): ChatMember = getChatMember(chat.id, userId) -suspend fun TelegramBot.getChatMember( +public suspend fun TelegramBot.getChatMember( chatId: IdChatIdentifier, user: User -) = getChatMember(chatId, user.id) +): ChatMember = getChatMember(chatId, user.id) -suspend fun TelegramBot.getChatMember( +public suspend fun TelegramBot.getChatMember( chat: PublicChat, user: User -) = getChatMember(chat.id, user.id) +): ChatMember = getChatMember(chat.id, user.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChannelAdministrator.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChannelAdministrator.kt index f6e3259a82..34ae5606a4 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChannelAdministrator.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChannelAdministrator.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.promoteChannelAdministrator( +public suspend fun TelegramBot.promoteChannelAdministrator( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, @@ -27,7 +27,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = execute( +): Boolean = execute( PromoteChannelAdministrator( chatId = chatId, userId = userId, @@ -48,7 +48,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( ) ) -suspend fun TelegramBot.promoteChannelAdministrator( +public suspend fun TelegramBot.promoteChannelAdministrator( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, @@ -65,7 +65,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChannelAdministrator( +): Boolean = promoteChannelAdministrator( chat.id, userId, untilDate = untilDate, @@ -84,7 +84,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canDeleteStories = canDeleteStories ) -suspend fun TelegramBot.promoteChannelAdministrator( +public suspend fun TelegramBot.promoteChannelAdministrator( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, @@ -101,7 +101,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChannelAdministrator( +): Boolean = promoteChannelAdministrator( chatId, user.id, untilDate = untilDate, @@ -120,7 +120,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canDeleteStories = canDeleteStories ) -suspend fun TelegramBot.promoteChannelAdministrator( +public suspend fun TelegramBot.promoteChannelAdministrator( chat: PublicChat, user: User, untilDate: TelegramDate? = null, @@ -137,7 +137,7 @@ suspend fun TelegramBot.promoteChannelAdministrator( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChannelAdministrator( +): Boolean = promoteChannelAdministrator( chat.id, user.id, untilDate = untilDate, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatAdministrator.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatAdministrator.kt index f25dc9b093..b728a9190c 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatAdministrator.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatAdministrator.kt @@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.promoteChatAdministrator( +public suspend fun TelegramBot.promoteChatAdministrator( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, @@ -21,7 +21,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canPromoteMembers: Boolean? = null, canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, -) = execute( +): Boolean = execute( PromoteChatMember( chatId, userId, @@ -37,7 +37,7 @@ suspend fun TelegramBot.promoteChatAdministrator( ) ) -suspend fun TelegramBot.promoteChatAdministrator( +public suspend fun TelegramBot.promoteChatAdministrator( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, @@ -49,7 +49,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canPromoteMembers: Boolean? = null, canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, -) = promoteChatAdministrator( +): Boolean = promoteChatAdministrator( chat.id, userId, untilDate, @@ -63,7 +63,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canManageChat ) -suspend fun TelegramBot.promoteChatAdministrator( +public suspend fun TelegramBot.promoteChatAdministrator( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, @@ -75,7 +75,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canPromoteMembers: Boolean? = null, canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, -) = promoteChatAdministrator( +): Boolean = promoteChatAdministrator( chatId, user.id, untilDate, @@ -89,7 +89,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canManageChat ) -suspend fun TelegramBot.promoteChatAdministrator( +public suspend fun TelegramBot.promoteChatAdministrator( chat: PublicChat, user: User, untilDate: TelegramDate? = null, @@ -101,7 +101,7 @@ suspend fun TelegramBot.promoteChatAdministrator( canPromoteMembers: Boolean? = null, canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, -) = promoteChatAdministrator( +): Boolean = promoteChatAdministrator( chat.id, user.id, untilDate, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatMember.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatMember.kt index 0614012612..6c8a62f57b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatMember.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteChatMember.kt @@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User @Warning("This method is too common. Use it with caution") -suspend fun TelegramBot.promoteChatMember( +public suspend fun TelegramBot.promoteChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, @@ -27,7 +27,7 @@ suspend fun TelegramBot.promoteChatMember( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = execute( +): Boolean = execute( PromoteChatMember( chatId = chatId, userId = userId, @@ -51,7 +51,7 @@ suspend fun TelegramBot.promoteChatMember( ) @Warning("This method is too common. Use it with caution") -suspend fun TelegramBot.promoteChatMember( +public suspend fun TelegramBot.promoteChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, @@ -70,7 +70,7 @@ suspend fun TelegramBot.promoteChatMember( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChatMember( +): Boolean = promoteChatMember( chat.id, userId, untilDate = untilDate, @@ -92,7 +92,7 @@ suspend fun TelegramBot.promoteChatMember( ) @Warning("This method is too common. Use it with caution") -suspend fun TelegramBot.promoteChatMember( +public suspend fun TelegramBot.promoteChatMember( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, @@ -111,7 +111,7 @@ suspend fun TelegramBot.promoteChatMember( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChatMember( +): Boolean = promoteChatMember( chatId, user.id, untilDate = untilDate, @@ -133,7 +133,7 @@ suspend fun TelegramBot.promoteChatMember( ) @Warning("This method is too common. Use it with caution") -suspend fun TelegramBot.promoteChatMember( +public suspend fun TelegramBot.promoteChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null, @@ -152,7 +152,7 @@ suspend fun TelegramBot.promoteChatMember( canPostStories: Boolean? = null, canEditStories: Boolean? = null, canDeleteStories: Boolean? = null -) = promoteChatMember( +): Boolean = promoteChatMember( chat.id, user.id, untilDate = untilDate, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteSupergroupAdministrator.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteSupergroupAdministrator.kt index eab5a01575..64a498b45e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteSupergroupAdministrator.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/PromoteSupergroupAdministrator.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.promoteSupergroupAdministrator( +public suspend fun TelegramBot.promoteSupergroupAdministrator( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, @@ -24,7 +24,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, canManageTopics: Boolean? = null, -) = execute( +): Boolean = execute( PromoteSupergroupAdministrator( chatId = chatId, userId = userId, @@ -42,7 +42,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( ) ) -suspend fun TelegramBot.promoteSupergroupAdministrator( +public suspend fun TelegramBot.promoteSupergroupAdministrator( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, @@ -56,7 +56,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, canManageTopics: Boolean? = null, -) = promoteSupergroupAdministrator( +): Boolean = promoteSupergroupAdministrator( chat.id, userId, untilDate = untilDate, @@ -72,7 +72,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageTopics = canManageTopics ) -suspend fun TelegramBot.promoteSupergroupAdministrator( +public suspend fun TelegramBot.promoteSupergroupAdministrator( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, @@ -86,7 +86,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, canManageTopics: Boolean? = null, -) = promoteSupergroupAdministrator( +): Boolean = promoteSupergroupAdministrator( chatId, user.id, untilDate = untilDate, @@ -102,7 +102,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageTopics = canManageTopics ) -suspend fun TelegramBot.promoteSupergroupAdministrator( +public suspend fun TelegramBot.promoteSupergroupAdministrator( chat: PublicChat, user: User, untilDate: TelegramDate? = null, @@ -116,7 +116,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator( canManageVideoChats: Boolean? = null, canManageChat: Boolean? = null, canManageTopics: Boolean? = null, -) = promoteSupergroupAdministrator( +): Boolean = promoteSupergroupAdministrator( chat.id, user.id, untilDate = untilDate, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/RestrictChatMember.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/RestrictChatMember.kt index 2ebf2e47b5..85b3c02fa0 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/RestrictChatMember.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/RestrictChatMember.kt @@ -10,35 +10,35 @@ import dev.inmo.tgbotapi.types.chat.ChatPermissions import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.restrictChatMember( +public suspend fun TelegramBot.restrictChatMember( chatId: ChatIdentifier, userId: UserId, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions(), useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions)) +): Boolean = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions)) -suspend fun TelegramBot.restrictChatMember( +public suspend fun TelegramBot.restrictChatMember( chat: PublicChat, userId: UserId, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions(), useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions) +): Boolean = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions) -suspend fun TelegramBot.restrictChatMember( +public suspend fun TelegramBot.restrictChatMember( chatId: IdChatIdentifier, user: User, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions(), useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions) +): Boolean = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions) -suspend fun TelegramBot.restrictChatMember( +public suspend fun TelegramBot.restrictChatMember( chat: PublicChat, user: User, untilDate: TelegramDate? = null, permissions: ChatPermissions = ChatPermissions(), useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions) +): Boolean = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt index 424fa346af..579066300f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/SetChatAdministratorCustomTitle.kt @@ -7,26 +7,26 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.setChatAdministratorCustomTitle( +public suspend fun TelegramBot.setChatAdministratorCustomTitle( chatId: IdChatIdentifier, userId: UserId, customTitle: String -) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) +): Boolean = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) -suspend fun TelegramBot.setChatAdministratorCustomTitle( +public suspend fun TelegramBot.setChatAdministratorCustomTitle( chat: PublicChat, userId: UserId, customTitle: String -) = setChatAdministratorCustomTitle(chat.id, userId, customTitle) +): Boolean = setChatAdministratorCustomTitle(chat.id, userId, customTitle) -suspend fun TelegramBot.setChatAdministratorCustomTitle( +public suspend fun TelegramBot.setChatAdministratorCustomTitle( chatId: IdChatIdentifier, user: User, customTitle: String -) = setChatAdministratorCustomTitle(chatId, user.id, customTitle) +): Boolean = setChatAdministratorCustomTitle(chatId, user.id, customTitle) -suspend fun TelegramBot.setChatAdministratorCustomTitle( +public suspend fun TelegramBot.setChatAdministratorCustomTitle( chat: PublicChat, user: User, customTitle: String -) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle) +): Boolean = setChatAdministratorCustomTitle(chat.id, user.id, customTitle) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatMember.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatMember.kt index 2806a3ab50..8ccb507fc6 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatMember.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatMember.kt @@ -8,27 +8,27 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PublicChat import dev.inmo.tgbotapi.types.chat.User -suspend fun TelegramBot.unbanChatMember( +public suspend fun TelegramBot.unbanChatMember( chatId: ChatIdentifier, userId: UserId, onlyIfBanned: Boolean? = null -) = execute(UnbanChatMember(chatId, userId, onlyIfBanned)) +): Boolean = execute(UnbanChatMember(chatId, userId, onlyIfBanned)) -suspend fun TelegramBot.unbanChatMember( +public suspend fun TelegramBot.unbanChatMember( chat: PublicChat, userId: UserId, onlyIfBanned: Boolean? = null -) = unbanChatMember(chat.id, userId, onlyIfBanned) +): Boolean = unbanChatMember(chat.id, userId, onlyIfBanned) -suspend fun TelegramBot.unbanChatMember( +public suspend fun TelegramBot.unbanChatMember( chatId: IdChatIdentifier, user: User, onlyIfBanned: Boolean? = null -) = unbanChatMember(chatId, user.id, onlyIfBanned) +): Boolean = unbanChatMember(chatId, user.id, onlyIfBanned) -suspend fun TelegramBot.unbanChatMember( +public suspend fun TelegramBot.unbanChatMember( chat: PublicChat, user: User, onlyIfBanned: Boolean? = null -) = unbanChatMember(chat.id, user.id, onlyIfBanned) +): Boolean = unbanChatMember(chat.id, user.id, onlyIfBanned) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatSenderChat.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatSenderChat.kt index cc3975e38f..683a407a37 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatSenderChat.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/UnbanChatSenderChat.kt @@ -6,22 +6,22 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.unbanChatSenderChat( +public suspend fun TelegramBot.unbanChatSenderChat( chatId: ChatIdentifier, senderChatId: IdChatIdentifier -) = execute(UnbanChatSenderChat(chatId, senderChatId)) +): Boolean = execute(UnbanChatSenderChat(chatId, senderChatId)) -suspend fun TelegramBot.unbanChatSenderChat( +public suspend fun TelegramBot.unbanChatSenderChat( chat: PublicChat, senderChatId: IdChatIdentifier -) = unbanChatSenderChat(chat.id, senderChatId) +): Boolean = unbanChatSenderChat(chat.id, senderChatId) -suspend fun TelegramBot.unbanChatSenderChat( +public suspend fun TelegramBot.unbanChatSenderChat( chatId: IdChatIdentifier, senderChat: PublicChat -) = unbanChatSenderChat(chatId, senderChat.id) +): Boolean = unbanChatSenderChat(chatId, senderChat.id) -suspend fun TelegramBot.unbanChatSenderChat( +public suspend fun TelegramBot.unbanChatSenderChat( chat: PublicChat, senderChat: PublicChat, -) = unbanChatSenderChat(chat.id, senderChat) +): Boolean = unbanChatSenderChat(chat.id, senderChat) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/DeleteChatPhoto.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/DeleteChatPhoto.kt index 1bc6112d98..b737b98158 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/DeleteChatPhoto.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/DeleteChatPhoto.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.modify.DeleteChatPhoto import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.deleteChatPhoto( +public suspend fun TelegramBot.deleteChatPhoto( chatId: ChatIdentifier -) = execute(DeleteChatPhoto(chatId)) +): Boolean = execute(DeleteChatPhoto(chatId)) -suspend fun TelegramBot.deleteChatPhoto( +public suspend fun TelegramBot.deleteChatPhoto( chat: PublicChat -) = deleteChatPhoto(chat.id) +): Boolean = deleteChatPhoto(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/PinChatMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/PinChatMessage.kt index 01a66130c5..b08f55f5a7 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/PinChatMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/PinChatMessage.kt @@ -7,19 +7,19 @@ import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage -suspend fun TelegramBot.pinChatMessage( +public suspend fun TelegramBot.pinChatMessage( chatId: ChatIdentifier, messageId: MessageId, disableNotification: Boolean = false -) = execute(PinChatMessage(chatId, messageId, disableNotification)) +): Boolean = execute(PinChatMessage(chatId, messageId, disableNotification)) -suspend fun TelegramBot.pinChatMessage( +public suspend fun TelegramBot.pinChatMessage( chat: Chat, messageId: MessageId, disableNotification: Boolean = false -) = pinChatMessage(chat.id, messageId, disableNotification) +): Boolean = pinChatMessage(chat.id, messageId, disableNotification) -suspend fun TelegramBot.pinChatMessage( +public suspend fun TelegramBot.pinChatMessage( message: AccessibleMessage, disableNotification: Boolean = false -) = pinChatMessage(message.chat.id, message.messageId, disableNotification) +): Boolean = pinChatMessage(message.chat.id, message.messageId, disableNotification) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatDescription.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatDescription.kt index caf744254b..e75f38a8a1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatDescription.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatDescription.kt @@ -5,12 +5,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatDescription import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.setChatDescription( +public suspend fun TelegramBot.setChatDescription( chatId: ChatIdentifier, description: String -) = execute(SetChatDescription(chatId, description)) +): Boolean = execute(SetChatDescription(chatId, description)) -suspend fun TelegramBot.setChatDescription( +public suspend fun TelegramBot.setChatDescription( chat: PublicChat, description: String -) = setChatDescription(chat.id, description) +): Boolean = setChatDescription(chat.id, description) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatMenuButton.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatMenuButton.kt index 81cddf247e..cda5dec7ac 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatMenuButton.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatMenuButton.kt @@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier import dev.inmo.tgbotapi.types.MenuButton import dev.inmo.tgbotapi.types.chat.PrivateChat -suspend fun TelegramBot.setChatMenuButton( +public suspend fun TelegramBot.setChatMenuButton( chatId: IdChatIdentifier, menuButton: MenuButton -) = execute(SetChatMenuButton(chatId, menuButton)) +): Boolean = execute(SetChatMenuButton(chatId, menuButton)) -suspend fun TelegramBot.setChatMenuButton( +public suspend fun TelegramBot.setChatMenuButton( chat: PrivateChat, menuButton: MenuButton -) = setChatMenuButton(chat.id, menuButton) +): Boolean = setChatMenuButton(chat.id, menuButton) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPermissions.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPermissions.kt index 1efc595e20..5ba8278cb6 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPermissions.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPermissions.kt @@ -6,14 +6,14 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.ChatPermissions import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.setDefaultChatMembersPermissions( +public suspend fun TelegramBot.setDefaultChatMembersPermissions( chatId: ChatIdentifier, permissions: ChatPermissions, useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = execute(SetChatPermissions(chatId, permissions, useIndependentChatPermissions)) +): Boolean = execute(SetChatPermissions(chatId, permissions, useIndependentChatPermissions)) -suspend fun TelegramBot.setDefaultChatMembersPermissions( +public suspend fun TelegramBot.setDefaultChatMembersPermissions( chat: PublicChat, permissions: ChatPermissions, useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it } -) = setDefaultChatMembersPermissions(chat.id, permissions, useIndependentChatPermissions) +): Boolean = setDefaultChatMembersPermissions(chat.id, permissions, useIndependentChatPermissions) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPhoto.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPhoto.kt index 89c332f571..ca9ea519ce 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPhoto.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatPhoto.kt @@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatPhoto import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.setChatPhoto( +public suspend fun TelegramBot.setChatPhoto( chatId: ChatIdentifier, photo: MultipartFile -) = execute(SetChatPhoto(chatId, photo)) +): Boolean = execute(SetChatPhoto(chatId, photo)) -suspend fun TelegramBot.setChatPhoto( +public suspend fun TelegramBot.setChatPhoto( chat: PublicChat, photo: MultipartFile -) = setChatPhoto(chat.id, photo) +): Boolean = setChatPhoto(chat.id, photo) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatTitle.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatTitle.kt index 0866f7f7b8..46348d5d1f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatTitle.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatTitle.kt @@ -5,12 +5,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatTitle import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.PublicChat -suspend fun TelegramBot.setChatTitle( +public suspend fun TelegramBot.setChatTitle( chatId: ChatIdentifier, title: String -) = execute(SetChatTitle(chatId, title)) +): Boolean = execute(SetChatTitle(chatId, title)) -suspend fun TelegramBot.setChatTitle( +public suspend fun TelegramBot.setChatTitle( chat: PublicChat, title: String -) = setChatTitle(chat.id, title) +): Boolean = setChatTitle(chat.id, title) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetDefaultChatMenuButton.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetDefaultChatMenuButton.kt index 1239825d00..d99c2ed22f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetDefaultChatMenuButton.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/SetDefaultChatMenuButton.kt @@ -4,6 +4,6 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.modify.SetDefaultChatMenuButton import dev.inmo.tgbotapi.types.MenuButton -suspend fun TelegramBot.setDefaultChatMenuButton( +public suspend fun TelegramBot.setDefaultChatMenuButton( menuButton: MenuButton -) = execute(SetDefaultChatMenuButton(menuButton)) +): Boolean = execute(SetDefaultChatMenuButton(menuButton)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinAllChatMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinAllChatMessages.kt index 98e2b963cc..2129a5cb8c 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinAllChatMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinAllChatMessages.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.modify.UnpinAllChatMessages import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.unpinAllChatMessages( +public suspend fun TelegramBot.unpinAllChatMessages( chatId: ChatIdentifier -) = execute(UnpinAllChatMessages(chatId)) +): Boolean = execute(UnpinAllChatMessages(chatId)) -suspend fun TelegramBot.unpinAllChatMessages( +public suspend fun TelegramBot.unpinAllChatMessages( chat: Chat -) = unpinAllChatMessages(chat.id) +): Boolean = unpinAllChatMessages(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt index 2d9c5cc53c..35da0909cd 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt @@ -7,16 +7,16 @@ import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage -suspend fun TelegramBot.unpinChatMessage( +public suspend fun TelegramBot.unpinChatMessage( chatId: ChatIdentifier, messageId: MessageId? = null -) = execute(UnpinChatMessage(chatId, messageId)) +): Boolean = execute(UnpinChatMessage(chatId, messageId)) -suspend fun TelegramBot.unpinChatMessage( +public suspend fun TelegramBot.unpinChatMessage( chat: Chat, messageId: MessageId? = null -) = unpinChatMessage(chat.id, messageId) +): Boolean = unpinChatMessage(chat.id, messageId) -suspend fun TelegramBot.unpinChatMessage( +public suspend fun TelegramBot.unpinChatMessage( message: AccessibleMessage -) = unpinChatMessage(message.chat.id, message.messageId) +): Boolean = unpinChatMessage(message.chat.id, message.messageId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/DeleteChatStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/DeleteChatStickerSet.kt index 966d283629..c0d268b31d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/DeleteChatStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/DeleteChatStickerSet.kt @@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.stickers.DeleteChatStickerSet import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.chat.SupergroupChat -suspend fun TelegramBot.deleteChatStickerSet( +public suspend fun TelegramBot.deleteChatStickerSet( chatId: ChatIdentifier -) = execute(DeleteChatStickerSet(chatId)) +): Boolean = execute(DeleteChatStickerSet(chatId)) -suspend fun TelegramBot.deleteChatStickerSet( +public suspend fun TelegramBot.deleteChatStickerSet( chat: SupergroupChat -) = deleteChatStickerSet(chat.id) +): Boolean = deleteChatStickerSet(chat.id) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/SetChatStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/SetChatStickerSet.kt index 6ce570f010..4a4d75a31a 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/SetChatStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/stickers/SetChatStickerSet.kt @@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.chat.SupergroupChat -suspend fun TelegramBot.setChatStickerSet( +public suspend fun TelegramBot.setChatStickerSet( chatId: ChatIdentifier, stickerSetName: StickerSetName -) = execute(SetChatStickerSet(chatId, stickerSetName)) +): Boolean = execute(SetChatStickerSet(chatId, stickerSetName)) -suspend fun TelegramBot.setChatStickerSet( +public suspend fun TelegramBot.setChatStickerSet( chat: SupergroupChat, stickerSetName: StickerSetName -) = setChatStickerSet(chat.id, stickerSetName) +): Boolean = setChatStickerSet(chat.id, stickerSetName) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt index 09666ed92c..a0934c868b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/Edits.kt @@ -26,7 +26,7 @@ import dev.inmo.tgbotapi.utils.buildEntities * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, text: String, parseMode: ParseMode? = null, @@ -41,7 +41,7 @@ suspend fun TelegramBot.edit( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, entities: List, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, @@ -55,7 +55,7 @@ suspend fun TelegramBot.edit( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, latitude: Double, @@ -66,13 +66,13 @@ suspend fun TelegramBot.edit( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chat: Chat, messageId: MessageId, latitude: Double, @@ -83,13 +83,13 @@ suspend fun TelegramBot.edit( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, latitude: Double, longitude: Double, @@ -99,19 +99,19 @@ suspend fun TelegramBot.edit( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, location: LiveLocation, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation( +): ContentMessage = editLiveLocation( chatId, messageId, location, businessConnectionId, replyMarkup ) @@ -119,97 +119,97 @@ suspend fun TelegramBot.edit( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chat: Chat, messageId: MessageId, location: LiveLocation, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, location: LiveLocation, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(message, location, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(message, location, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup) +): ContentMessage = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chat: Chat, messageId: MessageId, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup) +): ContentMessage = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(message, media, businessConnectionId, replyMarkup) +): ContentMessage = editMessageMedia(message, media, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup) +): ContentMessage = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chat: Chat, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup) +): ContentMessage = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: AccessibleMessage, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(message, businessConnectionId, replyMarkup) +): ContentMessage = editMessageReplyMarkup(message, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, text: String, @@ -217,26 +217,26 @@ suspend fun TelegramBot.edit( businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, separator: TextSource? = null, @@ -244,13 +244,13 @@ suspend fun TelegramBot.edit( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( chatId: ChatIdentifier, messageId: MessageId, separator: String, @@ -258,81 +258,81 @@ suspend fun TelegramBot.edit( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, text: String, parseMode: ParseMode? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, separator: TextSource? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( message: ContentMessage, separator: String, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, separator: TextSource? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, separator: String, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/InlineEdits.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/InlineEdits.kt index 70429696e9..05fc34439e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/InlineEdits.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/InlineEdits.kt @@ -19,7 +19,7 @@ import dev.inmo.tgbotapi.utils.buildEntities * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, latitude: Double, longitude: Double, @@ -27,17 +27,17 @@ suspend fun TelegramBot.edit( heading: Degrees? = null, proximityAlertRadius: Meters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) +): Boolean = editLiveLocation(messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, location: LiveLocation, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation( +): Boolean = editLiveLocation( messageId, location, replyMarkup ) @@ -45,68 +45,68 @@ suspend fun TelegramBot.edit( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, media: TelegramFreeMedia, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(messageId, media, replyMarkup) +): Boolean = editMessageMedia(messageId, media, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(messageId, replyMarkup) +): Boolean = editMessageReplyMarkup(messageId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, text: String, parseMode: ParseMode? = null, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, entities: TextSourcesList, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, showCaptionAboveMedia: Boolean = false, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.edit( +public suspend fun TelegramBot.edit( messageId: InlineMessageId, separator: String, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt index ef124b8531..27860429ec 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditChatMessageCaption.kt @@ -21,7 +21,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( chatId: ChatIdentifier, messageId: MessageId, text: String, @@ -29,7 +29,7 @@ suspend fun TelegramBot.editMessageCaption( businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, showCaptionAboveMedia: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageCaption(chatId, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) ) @@ -37,7 +37,7 @@ suspend fun TelegramBot.editMessageCaption( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( chat: Chat, messageId: MessageId, text: String, @@ -45,13 +45,13 @@ suspend fun TelegramBot.editMessageCaption( businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, showCaptionAboveMedia: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageCaption(chat.id, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) +): ContentMessage = editMessageCaption(chat.id, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( message: ContentMessage, text: String, parseMode: ParseMode? = null, @@ -67,14 +67,14 @@ suspend fun TelegramBot.editMessageCaption( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( chatId: ChatIdentifier, messageId: MessageId, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, showCaptionAboveMedia: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageCaption(chatId, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) ) @@ -82,20 +82,20 @@ suspend fun TelegramBot.editMessageCaption( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( chat: Chat, messageId: MessageId, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, showCaptionAboveMedia: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageCaption(chat.id, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) +): ContentMessage = editMessageCaption(chat.id, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( message: ContentMessage, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, @@ -111,7 +111,7 @@ suspend fun TelegramBot.editMessageCaption( * as a builder for that */ @RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception") -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( message: AccessibleMessage, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditInlineMessageCaption.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditInlineMessageCaption.kt index d8bc51f467..8a07904a63 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditInlineMessageCaption.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/caption/EditInlineMessageCaption.kt @@ -11,19 +11,19 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( inlineMessageId: InlineMessageId, text: String, parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup)) +): Boolean = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup)) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageCaption( +public suspend fun TelegramBot.editMessageCaption( inlineMessageId: InlineMessageId, entities: TextSourcesList, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup)) +): Boolean = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditChatMessageLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditChatMessageLiveLocation.kt index b562480d51..b4ef83dcb4 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditChatMessageLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditChatMessageLiveLocation.kt @@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( chatId: ChatIdentifier, messageId: MessageId, latitude: Double, @@ -25,7 +25,7 @@ suspend fun TelegramBot.editLiveLocation( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageLiveLocation( chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup ) @@ -35,7 +35,7 @@ suspend fun TelegramBot.editLiveLocation( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( chat: Chat, messageId: MessageId, latitude: Double, @@ -46,13 +46,13 @@ suspend fun TelegramBot.editLiveLocation( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( message: ContentMessage, latitude: Double, longitude: Double, @@ -62,19 +62,19 @@ suspend fun TelegramBot.editLiveLocation( proximityAlertRadius: Meters? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( chatId: ChatIdentifier, messageId: MessageId, location: LiveLocation, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageLiveLocation( chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup ) @@ -84,21 +84,21 @@ suspend fun TelegramBot.editLiveLocation( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( chat: Chat, messageId: MessageId, location: LiveLocation, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( message: ContentMessage, location: LiveLocation, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup) +): ContentMessage = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditInlineMessageLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditInlineMessageLiveLocation.kt index 5644a2ce61..34ea3e744e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditInlineMessageLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/EditInlineMessageLiveLocation.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.location.LiveLocation -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( inlineMessageId: InlineMessageId, latitude: Double, longitude: Double, @@ -14,13 +14,13 @@ suspend fun TelegramBot.editLiveLocation( heading: Degrees? = null, proximityAlertRadius: Meters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): Boolean = execute( EditInlineMessageLiveLocation( inlineMessageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup ) ) -suspend fun TelegramBot.editLiveLocation( +public suspend fun TelegramBot.editLiveLocation( inlineMessageId: InlineMessageId, location: LiveLocation, replyMarkup: InlineKeyboardMarkup? = null -) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup) +): Boolean = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopChatMessageLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopChatMessageLiveLocation.kt index bab544e606..4c9932d135 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopChatMessageLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopChatMessageLiveLocation.kt @@ -15,12 +15,12 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopLiveLocation( +public suspend fun TelegramBot.stopLiveLocation( chatId: ChatIdentifier, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( StopChatMessageLiveLocation( chatId, messageId, businessConnectionId, replyMarkup ) @@ -30,19 +30,19 @@ suspend fun TelegramBot.stopLiveLocation( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopLiveLocation( +public suspend fun TelegramBot.stopLiveLocation( chat: Chat, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup) +): ContentMessage = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopLiveLocation( +public suspend fun TelegramBot.stopLiveLocation( message: ContentMessage, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup) +): ContentMessage = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopInlineMessageLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopInlineMessageLiveLocation.kt index 531f1f1aec..9473783fbd 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopInlineMessageLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/location/live/StopInlineMessageLiveLocation.kt @@ -9,10 +9,10 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopLiveLocation( +public suspend fun TelegramBot.stopLiveLocation( inlineMessageId: InlineMessageId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): Boolean = execute( StopInlineMessageLiveLocation( inlineMessageId, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditChatMessageMedia.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditChatMessageMedia.kt index 8611e6e6c5..6a1b51e785 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditChatMessageMedia.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditChatMessageMedia.kt @@ -16,13 +16,13 @@ import dev.inmo.tgbotapi.types.message.content.MediaContent * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageMedia( +public suspend fun TelegramBot.editMessageMedia( chatId: ChatIdentifier, messageId: MessageId, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup) ) @@ -30,21 +30,21 @@ suspend fun TelegramBot.editMessageMedia( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageMedia( +public suspend fun TelegramBot.editMessageMedia( chat: Chat, messageId: MessageId, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(chat.id, messageId, media, businessConnectionId, replyMarkup) +): ContentMessage = editMessageMedia(chat.id, messageId, media, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageMedia( +public suspend fun TelegramBot.editMessageMedia( message: ContentMessage, media: TelegramFreeMedia, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup) +): ContentMessage = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt index 3272f78db6..abd5161387 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt @@ -10,8 +10,8 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageMedia( +public suspend fun TelegramBot.editMessageMedia( inlineMessageId: InlineMessageId, media: TelegramFreeMedia, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup)) +): Boolean = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditChatMessageReplyMarkup.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditChatMessageReplyMarkup.kt index 23701d9579..efcf630d73 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditChatMessageReplyMarkup.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditChatMessageReplyMarkup.kt @@ -9,17 +9,19 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.MessageContent /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageReplyMarkup( +public suspend fun TelegramBot.editMessageReplyMarkup( chatId: ChatIdentifier, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup) ) @@ -27,20 +29,20 @@ suspend fun TelegramBot.editMessageReplyMarkup( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageReplyMarkup( +public suspend fun TelegramBot.editMessageReplyMarkup( chat: Chat, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(chat.id, messageId, businessConnectionId, replyMarkup) +): ContentMessage = editMessageReplyMarkup(chat.id, messageId, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageReplyMarkup( +public suspend fun TelegramBot.editMessageReplyMarkup( message: AccessibleMessage, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageReplyMarkup(message.chat.id, message.messageId, businessConnectionId, replyMarkup) +): ContentMessage = editMessageReplyMarkup(message.chat.id, message.messageId, businessConnectionId, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditInlineMessageReplyMarkup.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditInlineMessageReplyMarkup.kt index b141a778c2..a767c6f7a0 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditInlineMessageReplyMarkup.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditInlineMessageReplyMarkup.kt @@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageReplyMarkup( +public suspend fun TelegramBot.editMessageReplyMarkup( inlineMessageId: InlineMessageId, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup)) +): Boolean = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditChatMessageText.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditChatMessageText.kt index 2c600c85cb..dc56f34db5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditChatMessageText.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditChatMessageText.kt @@ -21,7 +21,7 @@ import dev.inmo.tgbotapi.utils.* * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chatId: ChatIdentifier, messageId: MessageId, text: String, @@ -29,7 +29,7 @@ suspend fun TelegramBot.editMessageText( businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) ) @@ -37,7 +37,7 @@ suspend fun TelegramBot.editMessageText( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chat: Chat, messageId: MessageId, text: String, @@ -45,33 +45,33 @@ suspend fun TelegramBot.editMessageText( businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(chat.id, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chat.id, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, text: String, parseMode: ParseMode? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chatId: ChatIdentifier, messageId: MessageId, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( EditChatMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) ) @@ -79,7 +79,7 @@ suspend fun TelegramBot.editMessageText( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chatId: ChatIdentifier, messageId: MessageId, separator: TextSource? = null, @@ -87,13 +87,13 @@ suspend fun TelegramBot.editMessageText( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chatId: ChatIdentifier, messageId: MessageId, separator: String, @@ -101,26 +101,26 @@ suspend fun TelegramBot.editMessageText( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chat: Chat, messageId: MessageId, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(chat.id, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chat.id, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chat: Chat, messageId: MessageId, separator: TextSource? = null, @@ -128,13 +128,13 @@ suspend fun TelegramBot.editMessageText( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( chat: Chat, messageId: MessageId, separator: String, @@ -142,83 +142,83 @@ suspend fun TelegramBot.editMessageText( linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, separator: TextSource? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: ContentMessage, separator: String, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ @RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception") -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: AccessibleMessage, entities: TextSourcesList, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ @RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception") -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: AccessibleMessage, separator: TextSource? = null, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ @RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception") -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( message: AccessibleMessage, separator: String, businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) +): ContentMessage = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditInlineMessageText.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditInlineMessageText.kt index 3401f5e352..9bba684e8b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditInlineMessageText.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/text/EditInlineMessageText.kt @@ -15,49 +15,49 @@ import dev.inmo.tgbotapi.utils.buildEntities * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( inlineMessageId: InlineMessageId, text: String, parseMode: ParseMode? = null, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)) +): Boolean = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( inlineMessageId: InlineMessageId, entities: TextSourcesList, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)) +): Boolean = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( inlineMessageId: InlineMessageId, separator: TextSource? = null, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.editMessageText( +public suspend fun TelegramBot.editMessageText( inlineMessageId: InlineMessageId, separator: String, showCaptionAboveMedia: Boolean = false, linkPreviewOptions: LinkPreviewOptions? = null, replyMarkup: InlineKeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) +): Boolean = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup) diff --git a/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToFile.kt b/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToFile.kt index 1174d1162d..05bb287fb9 100644 --- a/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToFile.kt +++ b/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToFile.kt @@ -15,7 +15,7 @@ import kotlinx.coroutines.job import java.io.File import kotlin.coroutines.coroutineContext -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( filePath: String, destFile: File ): File { @@ -32,23 +32,23 @@ suspend fun TelegramBot.downloadFile( return destFile } -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( pathedFile: PathedFile, destFile: File -) = downloadFile( +): File = downloadFile( pathedFile.filePath, destFile ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( fileId: FileId, destFile: File -) = downloadFile( +): File = downloadFile( getFileAdditionalInfo(fileId), destFile ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( file: TelegramMediaFile, destFile: File ): File = downloadFile( @@ -56,10 +56,10 @@ suspend fun TelegramBot.downloadFile( destFile ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( file: MediaContent, destFile: File -) = downloadFile( +): File = downloadFile( getFileAdditionalInfo(file.media), destFile ) diff --git a/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToTempFile.kt b/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToTempFile.kt index 5f8f6fd75f..c4c0201e17 100644 --- a/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToTempFile.kt +++ b/tgbotapi.api/src/jvmMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileToTempFile.kt @@ -17,7 +17,7 @@ import kotlinx.coroutines.job import java.io.File import kotlin.coroutines.coroutineContext -suspend fun TelegramBot.downloadFileToTemp( +public suspend fun TelegramBot.downloadFileToTemp( filePath: String ): File { return downloadFile( @@ -28,7 +28,7 @@ suspend fun TelegramBot.downloadFileToTemp( ) } -suspend fun TelegramBot.downloadFileToTemp( +public suspend fun TelegramBot.downloadFileToTemp( pathedFile: PathedFile ): File = downloadFileToTemp( pathedFile.filePath @@ -44,20 +44,20 @@ suspend fun TelegramBot.downloadFileToTemp( } } -suspend fun TelegramBot.downloadFileToTemp( +public suspend fun TelegramBot.downloadFileToTemp( fileId: FileId -) = downloadFileToTemp( +): File = downloadFileToTemp( getFileAdditionalInfo(fileId) ) -suspend fun TelegramBot.downloadFileToTemp( +public suspend fun TelegramBot.downloadFileToTemp( file: TelegramMediaFile ): File = downloadFileToTemp( getFileAdditionalInfo(file) ) -suspend fun TelegramBot.downloadFileToTemp( +public suspend fun TelegramBot.downloadFileToTemp( file: MediaContent -) = downloadFileToTemp( +): File = downloadFileToTemp( getFileAdditionalInfo(file.media) )