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/BotBuilder.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt index b83b9a9f01..11a7fc8647 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt @@ -12,7 +12,7 @@ import io.ktor.client.engine.* * @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO] * @param ktorClientConfig Config block for preconfiguring of bot [HttpClient] */ -data class BotBuilder internal constructor( +public data class BotBuilder internal constructor( var proxy: ProxyConfig? = null, var ktorClientEngineFactory: HttpClientEngineFactory? = null, var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null @@ -37,12 +37,12 @@ data class BotBuilder internal constructor( * @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and * [block] */ -fun buildBot( +public fun buildBot( token: String, apiUrl: String = telegramBotAPIDefaultUrl, testServer: Boolean = false, block: BotBuilder.() -> Unit -) = telegramBot( +): TelegramBot = telegramBot( TelegramAPIUrlsKeeper(token, testServer, apiUrl), BotBuilder().apply(block).createHttpClient() ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt index afb5ac8a2a..b53706d43b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt @@ -11,7 +11,7 @@ import io.ktor.client.engine.* /** * Allows to create bot using bot [urlsKeeper] and already prepared [client] */ -fun telegramBot( +public fun telegramBot( urlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient = HttpClient() ): TelegramBot = telegramBot(urlsKeeper) { @@ -23,11 +23,11 @@ fun telegramBot( * configure it with [clientConfig] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( urlsKeeper: TelegramAPIUrlsKeeper, clientFactory: HttpClientEngineFactory, noinline clientConfig: HttpClientConfig.() -> Unit = {} -) = telegramBot( +): TelegramBot = telegramBot( urlsKeeper, HttpClient(clientFactory, clientConfig) ) @@ -37,11 +37,11 @@ inline fun telegramBot( * configure [HttpClient] using [clientConfig] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, noinline clientConfig: HttpClientConfig<*>.() -> Unit = {} -) = telegramBot( +): TelegramBot = telegramBot( urlsKeeper, HttpClient(clientEngine, clientConfig) ) @@ -51,10 +51,10 @@ inline fun telegramBot( * [clientConfig] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( urlsKeeper: TelegramAPIUrlsKeeper, noinline clientConfig: HttpClientConfig<*>.() -> Unit -) = telegramBot( +): TelegramBot = telegramBot( urlsKeeper, HttpClient(clientConfig) ) @@ -63,7 +63,7 @@ inline fun telegramBot( * Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( token: String, apiUrl: String = telegramBotAPIDefaultUrl, testServer: Boolean = false, @@ -71,13 +71,13 @@ inline fun telegramBot( ): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client) @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( token: String, clientFactory: HttpClientEngineFactory, apiUrl: String = telegramBotAPIDefaultUrl, testServer: Boolean = false, noinline clientConfig: HttpClientConfig.() -> Unit = {} -) = telegramBot( +): TelegramBot = telegramBot( TelegramAPIUrlsKeeper(token, testServer, apiUrl), clientFactory, clientConfig @@ -88,13 +88,13 @@ inline fun telegramBot( * configure [HttpClient] using [clientConfig] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( token: String, clientEngine: HttpClientEngine, apiUrl: String = telegramBotAPIDefaultUrl, testServer: Boolean = false, noinline clientConfig: HttpClientConfig<*>.() -> Unit = {} -) = telegramBot( +): TelegramBot = telegramBot( TelegramAPIUrlsKeeper(token, testServer, apiUrl), clientEngine, clientConfig @@ -105,12 +105,12 @@ inline fun telegramBot( * [clientConfig] */ @Suppress("NOTHING_TO_INLINE") -inline fun telegramBot( +public inline fun telegramBot( token: String, apiUrl: String = telegramBotAPIDefaultUrl, testServer: Boolean = false, noinline clientConfig: HttpClientConfig<*>.() -> Unit -) = telegramBot( +): TelegramBot = telegramBot( TelegramAPIUrlsKeeper(token, testServer, apiUrl), clientConfig ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/Close.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/Close.kt index 14a613d890..53f29d2f4a 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/Close.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/Close.kt @@ -4,4 +4,4 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.local.Close @Suppress("unused") -suspend inline fun TelegramBot.close() = execute(Close) +public suspend inline fun TelegramBot.close(): Boolean = execute(Close) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt index ab2c648790..b74d92e822 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt @@ -9,19 +9,19 @@ import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent -suspend fun TelegramBot.deleteMessage( +public suspend fun TelegramBot.deleteMessage( chatId: ChatIdentifier, messageId: MessageId -) = execute( +): Boolean = execute( DeleteMessage(chatId, messageId) ) -suspend fun TelegramBot.deleteMessage( +public suspend fun TelegramBot.deleteMessage( chat: Chat, messageId: MessageId -) = deleteMessage(chat.id, messageId) +): Boolean = deleteMessage(chat.id, messageId) -suspend fun TelegramBot.deleteMessage( +public suspend fun TelegramBot.deleteMessage( message: AccessibleMessage ): Boolean { val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>) @@ -34,20 +34,20 @@ suspend fun TelegramBot.deleteMessage( } } -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( chatId: ChatIdentifier, messageId: MessageId -) = deleteMessage(chatId, messageId) +): Boolean = deleteMessage(chatId, messageId) -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( chat: Chat, messageId: MessageId -) = deleteMessage(chat, messageId) +): Boolean = deleteMessage(chat, messageId) -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( message: AccessibleMessage -) = deleteMessage(message) +): Boolean = deleteMessage(message) -suspend fun AccessibleMessage.delete( +public suspend fun AccessibleMessage.delete( requestsExecutor: TelegramBot -) = requestsExecutor.deleteMessage(this) +): Boolean = requestsExecutor.deleteMessage(this) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessages.kt index 85b0b2431e..c33187ab04 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessages.kt @@ -7,10 +7,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.Message import kotlin.jvm.JvmName -suspend fun TelegramBot.deleteMessages( +public suspend fun TelegramBot.deleteMessages( chatId: ChatIdentifier, messageIds: List -) = messageIds.chunked(deleteMessagesLimit.last).map { +): Boolean = messageIds.chunked(deleteMessagesLimit.last).map { execute( DeleteMessages( chatId = chatId, @@ -19,17 +19,17 @@ suspend fun TelegramBot.deleteMessages( ) }.all { it } -suspend fun TelegramBot.deleteMessages( +public suspend fun TelegramBot.deleteMessages( chatId: ChatIdentifier, messageIds: Array -) = deleteMessages( +): Boolean = deleteMessages( chatId = chatId, messageIds = messageIds.toList() ) -suspend fun TelegramBot.deleteMessages( +public suspend fun TelegramBot.deleteMessages( messagesMetas: List -) = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) -> +): Boolean = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) -> deleteMessages( chatId = chatId, messageIds = messages.map { it.messageId } @@ -37,25 +37,25 @@ suspend fun TelegramBot.deleteMessages( }.all { it } @JvmName("deleteMessagesWithMessages") -suspend fun TelegramBot.deleteMessages( +public suspend fun TelegramBot.deleteMessages( messages: List -) = deleteMessages(messages.map { it.metaInfo }) +): Boolean = deleteMessages(messages.map { it.metaInfo }) -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( chatId: ChatIdentifier, messageIds: List -) = deleteMessages(chatId = chatId, messageIds = messageIds) +): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds) -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( chatId: ChatIdentifier, messageIds: Array -) = deleteMessages(chatId = chatId, messageIds = messageIds) +): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds) -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( messagesMetas: List -) = deleteMessages(messagesMetas) +): Boolean = deleteMessages(messagesMetas) @JvmName("deleteWithMessages") -suspend fun TelegramBot.delete( +public suspend fun TelegramBot.delete( messages: List -) = deleteMessages(messages) +): Boolean = deleteMessages(messages) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessage.kt index 8bdde19ab8..d196a5123d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessage.kt @@ -7,58 +7,59 @@ import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage import dev.inmo.tgbotapi.types.threadId -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( fromChatId: ChatIdentifier, toChatId: ChatIdentifier, messageId: MessageId, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = execute( +): PossiblyForwardedMessage = execute( ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent) ) -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( fromChat: Chat, toChatId: ChatIdentifier, messageId: MessageId, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent) +): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent) -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( fromChatId: ChatIdentifier, toChat: Chat, messageId: MessageId, threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent) +): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent) -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( fromChat: Chat, toChat: Chat, messageId: MessageId, threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent) +): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent) -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( toChatId: ChatIdentifier, message: AccessibleMessage, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent) +): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent) -suspend fun TelegramBot.forwardMessage( +public suspend fun TelegramBot.forwardMessage( toChat: Chat, message: AccessibleMessage, threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false -) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent) +): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessages.kt index cf0775f0a5..aec91b3491 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/ForwardMessages.kt @@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.Message import kotlin.jvm.JvmName -suspend fun TelegramBot.forwardMessages( +public suspend fun TelegramBot.forwardMessages( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: List, @@ -16,7 +16,7 @@ suspend fun TelegramBot.forwardMessages( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = messageIds.chunked(forwardMessagesLimit.last).flatMap { +): List = messageIds.chunked(forwardMessagesLimit.last).flatMap { execute( ForwardMessages( toChatId = toChatId, @@ -30,7 +30,7 @@ suspend fun TelegramBot.forwardMessages( ) } -suspend fun TelegramBot.forwardMessages( +public suspend fun TelegramBot.forwardMessages( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: Array, @@ -38,7 +38,7 @@ suspend fun TelegramBot.forwardMessages( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds.toList(), @@ -48,14 +48,14 @@ suspend fun TelegramBot.forwardMessages( removeCaption = removeCaption ) -suspend fun TelegramBot.forwardMessages( +public suspend fun TelegramBot.forwardMessages( toChatId: ChatIdentifier, messagesMetas: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) -> +): List = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) -> forwardMessages( toChatId = toChatId, fromChatId = chatId, @@ -68,14 +68,14 @@ suspend fun TelegramBot.forwardMessages( } @JvmName("forwardMessagesWithMessages") -suspend fun TelegramBot.forwardMessages( +public suspend fun TelegramBot.forwardMessages( toChatId: ChatIdentifier, messages: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, messagesMetas = messages.map { it.metaInfo }, threadId = threadId, @@ -84,7 +84,7 @@ suspend fun TelegramBot.forwardMessages( removeCaption = removeCaption ) -suspend fun TelegramBot.forward( +public suspend fun TelegramBot.forward( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: List, @@ -92,7 +92,7 @@ suspend fun TelegramBot.forward( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds, @@ -102,7 +102,7 @@ suspend fun TelegramBot.forward( removeCaption = removeCaption ) -suspend fun TelegramBot.forward( +public suspend fun TelegramBot.forward( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: Array, @@ -110,7 +110,7 @@ suspend fun TelegramBot.forward( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds, @@ -120,14 +120,14 @@ suspend fun TelegramBot.forward( removeCaption = removeCaption ) -suspend fun TelegramBot.forward( +public suspend fun TelegramBot.forward( toChatId: ChatIdentifier, messagesMetas: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, messagesMetas = messagesMetas, threadId = threadId, @@ -137,14 +137,14 @@ suspend fun TelegramBot.forward( ) @JvmName("forwardWithMessages") -suspend fun TelegramBot.forward( +public suspend fun TelegramBot.forward( toChatId: ChatIdentifier, messages: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = forwardMessages( +): List = forwardMessages( toChatId = toChatId, messages = messages, threadId = threadId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdates.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdates.kt index 2d1f68998f..8ebfc122eb 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdates.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdates.kt @@ -5,22 +5,22 @@ import dev.inmo.tgbotapi.requests.GetUpdates import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.update.abstracts.Update -suspend fun TelegramBot.getUpdates( +public suspend fun TelegramBot.getUpdates( offset: UpdateId? = null, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List? = ALL_UPDATES_LIST -) = execute( +): List = execute( GetUpdates( offset, limit, timeout, allowed_updates ) ) -suspend fun TelegramBot.getUpdates( +public suspend fun TelegramBot.getUpdates( lastUpdate: Update, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List? = ALL_UPDATES_LIST -) = getUpdates( +): List = getUpdates( lastUpdate.updateId + 1, limit, timeout, allowed_updates ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdatesRaw.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdatesRaw.kt index 154c335f67..9d31f8aa77 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdatesRaw.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdatesRaw.kt @@ -4,23 +4,24 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.GetUpdatesRaw import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.update.abstracts.Update +import kotlinx.serialization.json.JsonArray -suspend fun TelegramBot.getRawUpdates( +public suspend fun TelegramBot.getRawUpdates( offset: UpdateId? = null, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List? = ALL_UPDATES_LIST -) = execute( +): JsonArray = execute( GetUpdatesRaw( offset, limit, timeout, allowed_updates ) ) -suspend fun TelegramBot.getRawUpdates( +public suspend fun TelegramBot.getRawUpdates( lastUpdate: Update, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List? = ALL_UPDATES_LIST -) = getRawUpdates( +): JsonArray = getRawUpdates( lastUpdate.updateId + 1, limit, timeout, allowed_updates ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt index 261d23379b..93852a49a0 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt @@ -1,9 +1,11 @@ package dev.inmo.tgbotapi.extensions.api -import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions -import dev.inmo.tgbotapi.abstracts.* +import dev.inmo.tgbotapi.abstracts.Headed +import dev.inmo.tgbotapi.abstracts.HorizontallyAccured +import dev.inmo.tgbotapi.abstracts.Locationed +import dev.inmo.tgbotapi.abstracts.ProximityAlertable import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.extensions.api.edit.edit @@ -16,17 +18,20 @@ import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.LocationContent -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineStart +import kotlinx.coroutines.currentCoroutineContext +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.FlowCollector import kotlinx.coroutines.flow.map +import kotlinx.coroutines.isActive import kotlinx.serialization.Serializable import kotlin.js.JsName import kotlin.jvm.JvmName import kotlin.math.ceil @Serializable -data class EditLiveLocationInfo( +public data class EditLiveLocationInfo( override val latitude: Double, override val longitude: Double, override val horizontalAccuracy: Meters? = null, @@ -39,7 +44,7 @@ data class EditLiveLocationInfo( * Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing, * the message will be sent again and new edits will be applied to the new message */ -suspend fun TelegramBot.handleLiveLocation( +public suspend fun TelegramBot.handleLiveLocation( chatId: ChatIdentifier, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, @@ -112,7 +117,7 @@ suspend fun TelegramBot.handleLiveLocation( */ @JvmName("handleLiveLocationWithLocation") @JsName("handleLiveLocationWithLocation") -suspend fun TelegramBot.handleLiveLocation( +public suspend fun TelegramBot.handleLiveLocation( chatId: ChatIdentifier, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, @@ -153,7 +158,7 @@ suspend fun TelegramBot.handleLiveLocation( */ @JvmName("handleLiveLocationWithLatLong") @JsName("handleLiveLocationWithLatLong") -suspend fun TelegramBot.handleLiveLocation( +public suspend fun TelegramBot.handleLiveLocation( chatId: ChatIdentifier, locationsFlow: Flow>, liveTimeMillis: Long = defaultLivePeriodDelayMillis, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt index ea67a21bd6..9963a09ed7 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt @@ -23,13 +23,13 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import kotlin.math.ceil -const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L -const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis +public const val indefiniteLivePeriodDelayMillis: Long = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L +public const val defaultLivePeriodDelayMillis: Long = indefiniteLivePeriodDelayMillis /** * @see startLiveLocation */ -class LiveLocationProvider internal constructor( +public class LiveLocationProvider internal constructor( private val requestsExecutor: TelegramBot, scope: CoroutineScope, autoCloseTimeDelay: Double, @@ -41,23 +41,23 @@ class LiveLocationProvider internal constructor( } } private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay) - val leftUntilCloseMillis: TimeSpan + public val leftUntilCloseMillis: TimeSpan get() = autoCloseTime - DateTime.now() - var isClosed: Boolean = false + public var isClosed: Boolean = false private set get() = field || leftUntilCloseMillis.millisecondsLong < 0L - var message: ContentMessage = initMessage + public var message: ContentMessage = initMessage private set - val lastLocation: LiveLocation + public val lastLocation: LiveLocation get() = message.content.location as LiveLocation /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ - suspend fun updateLocation( + public suspend fun updateLocation( location: LiveLocation, replyMarkup: InlineKeyboardMarkup? = null ): LiveLocation { @@ -86,7 +86,7 @@ class LiveLocationProvider internal constructor( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.startLiveLocation( +public suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chatId: ChatIdentifier, latitude: Double, @@ -135,7 +135,7 @@ suspend fun TelegramBot.startLiveLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.startLiveLocation( +public suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chat: Chat, latitude: Double, @@ -173,7 +173,7 @@ suspend fun TelegramBot.startLiveLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.startLiveLocation( +public suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chatId: IdChatIdentifier, location: StaticLocation, @@ -210,7 +210,7 @@ suspend fun TelegramBot.startLiveLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.startLiveLocation( +public suspend fun TelegramBot.startLiveLocation( scope: CoroutineScope, chat: Chat, location: StaticLocation, @@ -247,7 +247,7 @@ suspend fun TelegramBot.startLiveLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.replyWithLiveLocation( +public suspend inline fun TelegramBot.replyWithLiveLocation( to: AccessibleMessage, scope: CoroutineScope, latitude: Double, @@ -263,7 +263,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = startLiveLocation( +): LiveLocationProvider = startLiveLocation( scope, to.chat, latitude, @@ -285,7 +285,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.replyWithLiveLocation( +public suspend inline fun TelegramBot.replyWithLiveLocation( to: AccessibleMessage, scope: CoroutineScope, location: StaticLocation, @@ -300,7 +300,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = startLiveLocation( +): LiveLocationProvider = startLiveLocation( scope, to.chat, location, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LogOut.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LogOut.kt index 23d5c8daeb..34222e454f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LogOut.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LogOut.kt @@ -3,4 +3,4 @@ package dev.inmo.tgbotapi.extensions.api import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.local.LogOut -suspend inline fun TelegramBot.logOut() = execute(LogOut) +public suspend inline fun TelegramBot.logOut(): Boolean = execute(LogOut) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/StopPoll.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/StopPoll.kt index 4b799e4ecc..8d023a48ea 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/StopPoll.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/StopPoll.kt @@ -7,17 +7,18 @@ 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.polls.Poll /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopPoll( +public suspend fun TelegramBot.stopPoll( chatId: ChatIdentifier, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): Poll = execute( StopPoll(chatId, messageId, businessConnectionId, replyMarkup) ) @@ -25,31 +26,31 @@ suspend fun TelegramBot.stopPoll( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopPoll( +public suspend fun TelegramBot.stopPoll( chat: Chat, messageId: MessageId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = stopPoll(chat.id, messageId, businessConnectionId, replyMarkup) +): Poll = stopPoll(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.stopPoll( +public suspend fun TelegramBot.stopPoll( chatId: IdChatIdentifier, message: AccessibleMessage, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup) +): Poll = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.stopPoll( +public suspend fun TelegramBot.stopPoll( chat: Chat, message: AccessibleMessage, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, replyMarkup: InlineKeyboardMarkup? = null -) = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup) +): Poll = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup) 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/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFile.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFile.kt index 305abd5f38..d611aca3f2 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFile.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFile.kt @@ -8,31 +8,31 @@ import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.MediaContent -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( filePath: String ): ByteArray = execute( DownloadFile(filePath) ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( pathedFile: PathedFile ): ByteArray = downloadFile( pathedFile.filePath ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( fileId: FileId ): ByteArray = downloadFile( getFileAdditionalInfo(fileId) ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( file: TelegramMediaFile ): ByteArray = downloadFile( getFileAdditionalInfo(file) ) -suspend fun TelegramBot.downloadFile( +public suspend fun TelegramBot.downloadFile( file: MediaContent ): ByteArray = downloadFile( getFileAdditionalInfo(file.media) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStream.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStream.kt index 02abcc05fe..536ab66395 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStream.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStream.kt @@ -6,23 +6,24 @@ import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.MediaContent +import io.ktor.utils.io.* -suspend fun TelegramBot.downloadFileStream( +public suspend fun TelegramBot.downloadFileStream( filePath: String -) = downloadFileStreamAllocator(filePath).invoke() +): ByteReadChannel = downloadFileStreamAllocator(filePath).invoke() -suspend fun TelegramBot.downloadFileStream( +public suspend fun TelegramBot.downloadFileStream( pathedFile: PathedFile -) = downloadFileStream(pathedFile.filePath) +): ByteReadChannel = downloadFileStream(pathedFile.filePath) -suspend fun TelegramBot.downloadFileStream( +public suspend fun TelegramBot.downloadFileStream( fileId: FileId -) = downloadFileStream(getFileAdditionalInfo(fileId)) +): ByteReadChannel = downloadFileStream(getFileAdditionalInfo(fileId)) -suspend fun TelegramBot.downloadFileStream( +public suspend fun TelegramBot.downloadFileStream( file: TelegramMediaFile -) = downloadFileStream(getFileAdditionalInfo(file)) +): ByteReadChannel = downloadFileStream(getFileAdditionalInfo(file)) -suspend fun TelegramBot.downloadFileStream( +public suspend fun TelegramBot.downloadFileStream( file: MediaContent -) = downloadFileStream(getFileAdditionalInfo(file.media)) +): ByteReadChannel = downloadFileStream(getFileAdditionalInfo(file.media)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStreamAllocator.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStreamAllocator.kt index 187caba19d..88b6c02333 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStreamAllocator.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/files/DownloadFileStreamAllocator.kt @@ -7,23 +7,24 @@ import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.MediaContent +import dev.inmo.tgbotapi.utils.ByteReadChannelAllocator -suspend fun TelegramBot.downloadFileStreamAllocator( +public suspend fun TelegramBot.downloadFileStreamAllocator( filePath: String -) = execute(DownloadFileStream(filePath)) +): ByteReadChannelAllocator = execute(DownloadFileStream(filePath)) -suspend fun TelegramBot.downloadFileStreamAllocator( +public suspend fun TelegramBot.downloadFileStreamAllocator( pathedFile: PathedFile -) = downloadFileStreamAllocator(pathedFile.filePath) +): ByteReadChannelAllocator = downloadFileStreamAllocator(pathedFile.filePath) -suspend fun TelegramBot.downloadFileStreamAllocator( +public suspend fun TelegramBot.downloadFileStreamAllocator( fileId: FileId -) = downloadFileStreamAllocator(getFileAdditionalInfo(fileId)) +): ByteReadChannelAllocator = downloadFileStreamAllocator(getFileAdditionalInfo(fileId)) -suspend fun TelegramBot.downloadFileStreamAllocator( +public suspend fun TelegramBot.downloadFileStreamAllocator( file: TelegramMediaFile -) = downloadFileStreamAllocator(getFileAdditionalInfo(file)) +): ByteReadChannelAllocator = downloadFileStreamAllocator(getFileAdditionalInfo(file)) -suspend fun TelegramBot.downloadFileStreamAllocator( +public suspend fun TelegramBot.downloadFileStreamAllocator( file: MediaContent -) = downloadFileStreamAllocator(getFileAdditionalInfo(file.media)) +): ByteReadChannelAllocator = downloadFileStreamAllocator(getFileAdditionalInfo(file.media)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByChat.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByChat.kt index 8231aa89d0..7c5d133e14 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByChat.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByChat.kt @@ -5,51 +5,52 @@ import dev.inmo.tgbotapi.requests.games.GetGameHighScoresByChat import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.games.GameHighScore import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.GameContent -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( userId: UserId, chatId: IdChatIdentifier, messageId: MessageId -) = execute( +): List = execute( GetGameHighScoresByChat(userId, chatId, messageId) ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( user: CommonUser, chatId: IdChatIdentifier, messageId: MessageId -) = getGameScore( +): List = getGameScore( user.id, chatId, messageId ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( userId: UserId, chat: Chat, messageId: MessageId -) = getGameScore( +): List = getGameScore( userId, chat.id, messageId ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( user: CommonUser, chat: Chat, messageId: MessageId -) = getGameScore( +): List = getGameScore( user.id, chat.id, messageId ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( userId: UserId, message: ContentMessage -) = getGameScore( +): List = getGameScore( userId, message.chat.id, message.messageId ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( user: CommonUser, message: ContentMessage -) = getGameScore( +): List = getGameScore( user.id, message.chat.id, message.messageId ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByInlineMessageId.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByInlineMessageId.kt index 7f8f31bfc2..0a73094e22 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByInlineMessageId.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/GetGameHighScoresByInlineMessageId.kt @@ -4,17 +4,18 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.games.GetGameHighScoresByInlineMessageId import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.games.GameHighScore -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( userId: UserId, inlineMessageId: InlineMessageId -) = execute( +): List = execute( GetGameHighScoresByInlineMessageId( userId, inlineMessageId ) ) -suspend fun TelegramBot.getGameScore( +public suspend fun TelegramBot.getGameScore( user: CommonUser, inlineMessageId: InlineMessageId -) = getGameScore(user.id, inlineMessageId) +): List = getGameScore(user.id, inlineMessageId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByChatId.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByChatId.kt index 6976858703..c0e1d338ea 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByChatId.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByChatId.kt @@ -8,66 +8,66 @@ import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.GameContent -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, chatId: IdChatIdentifier, messageId: MessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = execute( +): Boolean = execute( SetGameScoreByChatId(userId, score, chatId, messageId, force, disableEditMessage) ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, chatId: IdChatIdentifier, messageId: MessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore( +): Boolean = setGameScore( user.id, score, chatId, messageId, force, disableEditMessage ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, chat: Chat, messageId: MessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore( +): Boolean = setGameScore( userId, score, chat.id, messageId, force, disableEditMessage ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, chat: Chat, messageId: MessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore( +): Boolean = setGameScore( user.id, score, chat.id, messageId, force, disableEditMessage ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, message: ContentMessage, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore( +): Boolean = setGameScore( userId, score, message.chat.id, message.messageId, force, disableEditMessage ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, message: ContentMessage, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore( +): Boolean = setGameScore( user.id, score, message.chat.id, message.messageId, force, disableEditMessage ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByInlineMessageId.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByInlineMessageId.kt index 5a79c0f790..a9f8965683 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByInlineMessageId.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/games/SetGameScoreByInlineMessageId.kt @@ -5,22 +5,22 @@ import dev.inmo.tgbotapi.requests.games.SetGameScoreByInlineMessageId import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.CommonUser -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( userId: UserId, score: Long, inlineMessageId: InlineMessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = execute( +): Boolean = execute( SetGameScoreByInlineMessageId( userId, score, inlineMessageId, force, disableEditMessage ) ) -suspend fun TelegramBot.setGameScore( +public suspend fun TelegramBot.setGameScore( user: CommonUser, score: Long, inlineMessageId: InlineMessageId, force: Boolean = false, disableEditMessage: Boolean = false -) = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage) +): Boolean = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetBusinessConnection.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetBusinessConnection.kt index d6e6603bce..e7c3c3483b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetBusinessConnection.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetBusinessConnection.kt @@ -3,15 +3,16 @@ package dev.inmo.tgbotapi.extensions.api.get import dev.inmo.micro_utils.common.Warning import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetBusinessConnection +import dev.inmo.tgbotapi.types.business_connection.BusinessConnection import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId -suspend fun TelegramBot.getBusinessConnection( +public suspend fun TelegramBot.getBusinessConnection( id: BusinessConnectionId -) = execute(GetBusinessConnection(businessConnectionId = id)) +): BusinessConnection = execute(GetBusinessConnection(businessConnectionId = id)) @Warning("This method may lead to error due to raw String type usage") -suspend fun TelegramBot.getBusinessConnection( +public suspend fun TelegramBot.getBusinessConnection( id: String -) = getBusinessConnection( +): BusinessConnection = getBusinessConnection( BusinessConnectionId(id) ) \ No newline at end of file diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetCustomEmojiStickers.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetCustomEmojiStickers.kt index 60e3784a8d..17f2642424 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetCustomEmojiStickers.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetCustomEmojiStickers.kt @@ -4,34 +4,35 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetCustomEmojiStickers import dev.inmo.tgbotapi.requests.get.GetStickerSet import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.files.CustomEmojiSticker import dev.inmo.tgbotapi.types.files.Sticker import kotlin.js.JsName import kotlin.jvm.JvmName -suspend fun TelegramBot.getCustomEmojiStickers( +public suspend fun TelegramBot.getCustomEmojiStickers( customEmojiIds: List -) = execute( +): List = execute( GetCustomEmojiStickers(customEmojiIds) ) @JvmName("getCustomEmojiStickersWithStringsList") @JsName("getCustomEmojiStickersWithStringsList") -suspend fun TelegramBot.getCustomEmojiStickers( +public suspend fun TelegramBot.getCustomEmojiStickers( customEmojiIds: List -) = getCustomEmojiStickers(customEmojiIds.map(::CustomEmojiId)) +): List = getCustomEmojiStickers(customEmojiIds.map(::CustomEmojiId)) -suspend fun TelegramBot.getCustomEmojiStickerOrNull( +public suspend fun TelegramBot.getCustomEmojiStickerOrNull( customEmojiId: CustomEmojiId -) = getCustomEmojiStickers(listOf(customEmojiId)).firstOrNull() +): CustomEmojiSticker? = getCustomEmojiStickers(listOf(customEmojiId)).firstOrNull() -suspend fun TelegramBot.getCustomEmojiStickerOrThrow( +public suspend fun TelegramBot.getCustomEmojiStickerOrThrow( customEmojiId: CustomEmojiId -) = getCustomEmojiStickers(listOf(customEmojiId)).first() +): CustomEmojiSticker = getCustomEmojiStickers(listOf(customEmojiId)).first() -suspend fun TelegramBot.getCustomEmojiStickerOrNull( +public suspend fun TelegramBot.getCustomEmojiStickerOrNull( customEmojiId: String -) = getCustomEmojiStickerOrNull(CustomEmojiId(customEmojiId)) +): CustomEmojiSticker? = getCustomEmojiStickerOrNull(CustomEmojiId(customEmojiId)) -suspend fun TelegramBot.getCustomEmojiStickerOrThrow( +public suspend fun TelegramBot.getCustomEmojiStickerOrThrow( customEmojiId: String -) = getCustomEmojiStickerOrThrow(CustomEmojiId(customEmojiId)) +): CustomEmojiSticker = getCustomEmojiStickerOrThrow(CustomEmojiId(customEmojiId)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetFile.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetFile.kt index 807959644e..5af9b2fac3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetFile.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetFile.kt @@ -3,19 +3,20 @@ package dev.inmo.tgbotapi.extensions.api.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.requests.get.GetFile +import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.MediaContent -suspend fun TelegramBot.getFileAdditionalInfo( +public suspend fun TelegramBot.getFileAdditionalInfo( fileId: FileId -) = execute( +): PathedFile = execute( GetFile(fileId) ) -suspend fun TelegramBot.getFileAdditionalInfo( +public suspend fun TelegramBot.getFileAdditionalInfo( file: TelegramMediaFile -) = getFileAdditionalInfo(file.fileId) +): PathedFile = getFileAdditionalInfo(file.fileId) -suspend fun TelegramBot.getFileAdditionalInfo( +public suspend fun TelegramBot.getFileAdditionalInfo( content: MediaContent -) = getFileAdditionalInfo(content.media) +): PathedFile = getFileAdditionalInfo(content.media) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStarTransactions.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStarTransactions.kt index 74e7504f22..348c4fcd8d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStarTransactions.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStarTransactions.kt @@ -2,11 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.get import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetStarTransactions +import dev.inmo.tgbotapi.types.payments.stars.StarTransactions -suspend fun TelegramBot.getStarTransactions( +public suspend fun TelegramBot.getStarTransactions( offset: Int? = null, limit: Int? = null, -) = execute( +): StarTransactions = execute( GetStarTransactions( offset = offset, limit = limit diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt index 997b84ccb7..df3ce8ce70 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt @@ -4,27 +4,28 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetStickerSet import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.files.Sticker +import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.getStickerSet( +public suspend fun TelegramBot.getStickerSet( name: StickerSetName -) = execute( +): StickerSet = execute( GetStickerSet(name) ) -suspend fun TelegramBot.getStickerSet( +public suspend fun TelegramBot.getStickerSet( name: String -) = getStickerSet( +): StickerSet = getStickerSet( StickerSetName(name) ) -suspend fun TelegramBot.getStickerSetOrNull( +public suspend fun TelegramBot.getStickerSetOrNull( sticker: Sticker -) = sticker.stickerSetName ?.let { +): StickerSet? = sticker.stickerSetName ?.let { getStickerSet(it) } -suspend fun TelegramBot.getStickerSetOrThrow( +public suspend fun TelegramBot.getStickerSetOrThrow( sticker: Sticker -) = getStickerSet( +): StickerSet = getStickerSet( sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method") ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserChatBoosts.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserChatBoosts.kt index 23b4d42111..ab18163eb9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserChatBoosts.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserChatBoosts.kt @@ -4,16 +4,17 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetUserChatBoosts import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.UserId +import dev.inmo.tgbotapi.types.boosts.UserChatBoosts import dev.inmo.tgbotapi.types.chat.Chat -suspend fun TelegramBot.getUserChatBoosts( +public suspend fun TelegramBot.getUserChatBoosts( chatId: ChatIdentifier, userId: UserId -) = execute( +): UserChatBoosts = execute( GetUserChatBoosts(chatId = chatId, userId = userId) ) -suspend fun TelegramBot.getUserChatBoosts( +public suspend fun TelegramBot.getUserChatBoosts( chat: Chat, userId: UserId -) = getUserChatBoosts(chatId = chat.id, userId = userId) \ No newline at end of file +): UserChatBoosts = getUserChatBoosts(chatId = chat.id, userId = userId) \ No newline at end of file diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserProfilePhotos.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserProfilePhotos.kt index 14fb14d019..ff51cd5a58 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserProfilePhotos.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetUserProfilePhotos.kt @@ -4,19 +4,20 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.get.GetUserProfilePhotos import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.UserId +import dev.inmo.tgbotapi.types.UserProfilePhotos -suspend fun TelegramBot.getUserProfilePhotos( +public suspend fun TelegramBot.getUserProfilePhotos( userId: UserId, offset: Int? = null, limit: Int? = null -) = execute( +): UserProfilePhotos = execute( GetUserProfilePhotos( userId, offset, limit ) ) -suspend fun TelegramBot.getUserProfilePhotos( +public suspend fun TelegramBot.getUserProfilePhotos( user: CommonUser, offset: Int? = null, limit: Int? = null -) = getUserProfilePhotos(user.id, offset, limit) +): UserProfilePhotos = getUserProfilePhotos(user.id, offset, limit) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt index 814e40e02a..293e6a664f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrors.kt @@ -10,16 +10,16 @@ import dev.inmo.tgbotapi.types.passport.PassportElementError import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import dev.inmo.tgbotapi.utils.passport.Decryptor -suspend fun TelegramBot.setPassportDataErrors( +public suspend fun TelegramBot.setPassportDataErrors( userId: UserId, errors: List -) = execute(SetPassportDataErrors(userId, errors)) -suspend fun TelegramBot.setPassportDataErrors( +): Boolean = execute(SetPassportDataErrors(userId, errors)) +public suspend fun TelegramBot.setPassportDataErrors( user: User, errors: List -) = setPassportDataErrors(user.id, errors) +): Boolean = setPassportDataErrors(user.id, errors) -suspend fun TelegramBot.setPassportDataErrors( +public suspend fun TelegramBot.setPassportDataErrors( userId: UserId, passportData: PassportData, decryptor: Decryptor, @@ -32,15 +32,15 @@ suspend fun TelegramBot.setPassportDataErrors( } } ) -suspend fun TelegramBot.setPassportDataErrors( +public suspend fun TelegramBot.setPassportDataErrors( user: User, passportData: PassportData, decryptor: Decryptor, mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError -) = setPassportDataErrors(user.id, passportData, decryptor, mapper) +): Boolean = setPassportDataErrors(user.id, passportData, decryptor, mapper) -suspend fun TelegramBot.setPassportDataErrors( +public suspend fun TelegramBot.setPassportDataErrors( passportMessage: PassportMessage, decryptor: Decryptor, mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError -) = setPassportDataErrors(passportMessage.user, passportMessage.passportData, decryptor, mapper) +): Boolean = setPassportDataErrors(passportMessage.user, passportMessage.passportData, decryptor, mapper) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt index a39e052d2a..bc99fdee39 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt @@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChatId: ChatIdentifier, messageId: MessageId, toChatId: ChatIdentifier, @@ -25,7 +25,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): MessageId = execute( CopyMessage( fromChatId, messageId, @@ -45,7 +45,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChat: Chat, messageId: MessageId, toChatId: ChatIdentifier, @@ -57,13 +57,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChatId: ChatIdentifier, messageId: MessageId, toChat: Chat, @@ -75,13 +75,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChat: Chat, messageId: MessageId, toChat: Chat, @@ -93,14 +93,14 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChatId: ChatIdentifier, messageId: MessageId, toChatId: ChatIdentifier, @@ -111,7 +111,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): MessageId = execute( CopyMessage( fromChatId, messageId, @@ -130,7 +130,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChat: Chat, messageId: MessageId, toChatId: ChatIdentifier, @@ -141,13 +141,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChatId: ChatIdentifier, messageId: MessageId, toChat: Chat, @@ -158,13 +158,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( fromChat: Chat, messageId: MessageId, toChat: Chat, @@ -175,13 +175,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, message: AccessibleMessage, text: String? = null, @@ -192,13 +192,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, message: AccessibleMessage, text: String? = null, @@ -209,13 +209,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, message: AccessibleMessage, entities: TextSourcesList, @@ -225,13 +225,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, message: AccessibleMessage, entities: TextSourcesList, @@ -241,13 +241,13 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) +): MessageId = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageId: MessageId, @@ -259,7 +259,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): MessageId = execute( CopyMessage( fromChatId, messageId, @@ -279,7 +279,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, fromChat: Chat, messageId: MessageId, @@ -291,7 +291,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChatId, fromChat.id, messageId, @@ -309,7 +309,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, fromChatId: ChatIdentifier, messageId: MessageId, @@ -321,7 +321,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChat.id, fromChatId, messageId, @@ -339,7 +339,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, fromChat: Chat, messageId: MessageId, @@ -351,7 +351,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChat.id, fromChat.id, messageId, @@ -370,7 +370,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageId: MessageId, @@ -381,7 +381,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): MessageId = execute( CopyMessage( fromChatId, messageId, @@ -400,7 +400,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChatId: ChatIdentifier, fromChat: Chat, messageId: MessageId, @@ -411,7 +411,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChatId, fromChat.id, messageId, @@ -428,7 +428,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, fromChatId: ChatIdentifier, messageId: MessageId, @@ -439,7 +439,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChat.id, fromChatId, messageId, @@ -456,7 +456,7 @@ suspend inline fun TelegramBot.copyMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.copyMessage( +public suspend inline fun TelegramBot.copyMessage( toChat: Chat, fromChat: Chat, messageId: MessageId, @@ -467,7 +467,7 @@ suspend inline fun TelegramBot.copyMessage( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( toChat.id, fromChat.id, messageId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessages.kt index 03bacb0c65..b85db70bd8 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessages.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.Message import kotlin.jvm.JvmName -suspend fun TelegramBot.copyMessages( +public suspend fun TelegramBot.copyMessages( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: List, @@ -15,7 +15,7 @@ suspend fun TelegramBot.copyMessages( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = messageIds.chunked(copyMessagesLimit.last).flatMap { +): List = messageIds.chunked(copyMessagesLimit.last).flatMap { execute( CopyMessages( toChatId = toChatId, @@ -29,7 +29,7 @@ suspend fun TelegramBot.copyMessages( ) } -suspend fun TelegramBot.copyMessages( +public suspend fun TelegramBot.copyMessages( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: Array, @@ -37,7 +37,7 @@ suspend fun TelegramBot.copyMessages( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds.toList(), @@ -47,14 +47,14 @@ suspend fun TelegramBot.copyMessages( removeCaption = removeCaption ) -suspend fun TelegramBot.copyMessages( +public suspend fun TelegramBot.copyMessages( toChatId: ChatIdentifier, messagesMetas: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) -> +): List = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) -> copyMessages( toChatId = toChatId, fromChatId = chatId, @@ -67,14 +67,14 @@ suspend fun TelegramBot.copyMessages( } @JvmName("copyMessagesWithMessages") -suspend fun TelegramBot.copyMessages( +public suspend fun TelegramBot.copyMessages( toChatId: ChatIdentifier, messages: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, messagesMetas = messages.map { it.metaInfo }, threadId = threadId, @@ -83,7 +83,7 @@ suspend fun TelegramBot.copyMessages( removeCaption = removeCaption ) -suspend fun TelegramBot.copy( +public suspend fun TelegramBot.copy( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: List, @@ -91,7 +91,7 @@ suspend fun TelegramBot.copy( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds, @@ -101,7 +101,7 @@ suspend fun TelegramBot.copy( removeCaption = removeCaption ) -suspend fun TelegramBot.copy( +public suspend fun TelegramBot.copy( toChatId: ChatIdentifier, fromChatId: ChatIdentifier, messageIds: Array, @@ -109,7 +109,7 @@ suspend fun TelegramBot.copy( disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, fromChatId = fromChatId, messageIds = messageIds, @@ -119,14 +119,14 @@ suspend fun TelegramBot.copy( removeCaption = removeCaption ) -suspend fun TelegramBot.copy( +public suspend fun TelegramBot.copy( toChatId: ChatIdentifier, messagesMetas: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, messagesMetas = messagesMetas, threadId = threadId, @@ -136,14 +136,14 @@ suspend fun TelegramBot.copy( ) @JvmName("copyWithMessages") -suspend fun TelegramBot.copy( +public suspend fun TelegramBot.copy( toChatId: ChatIdentifier, messages: List, threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, removeCaption: Boolean = false -) = copyMessages( +): List = copyMessages( toChatId = toChatId, messages = messages, threadId = threadId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index a35f8bbeff..515afb94ad 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -24,6 +24,7 @@ import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.payments.LabeledPrice @@ -42,7 +43,7 @@ import kotlin.jvm.JvmName * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, phoneNumber: String, firstName: String, @@ -55,7 +56,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( replyInChatId, phoneNumber, firstName, @@ -73,7 +74,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, contact: Contact, replyInChatId: IdChatIdentifier = to.chat.id, @@ -84,7 +85,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( replyInChatId, contact, replyInThreadId, @@ -103,7 +104,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.replyWithDice( +public suspend inline fun TelegramBot.replyWithDice( to: AccessibleMessage, animationType: DiceAnimationType? = null, replyInChatId: IdChatIdentifier = to.chat.id, @@ -114,13 +115,13 @@ suspend inline fun TelegramBot.replyWithDice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, animationType: DiceAnimationType, replyInChatId: IdChatIdentifier = to.chat.id, @@ -131,7 +132,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = replyWithDice(to, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = replyWithDice(to, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Location @@ -140,7 +141,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, latitude: Double, longitude: Double, @@ -152,7 +153,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( replyInChatId, latitude, longitude, @@ -169,7 +170,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, location: StaticLocation, replyInChatId: IdChatIdentifier = to.chat.id, @@ -180,7 +181,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( replyInChatId, location, replyInThreadId, @@ -199,7 +200,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, text: String, parseMode: ParseMode? = null, @@ -212,7 +213,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage( +): ContentMessage = sendTextMessage( replyInChatId, text, parseMode, @@ -230,7 +231,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -242,7 +243,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage( +): ContentMessage = sendTextMessage( replyInChatId, entities, linkPreviewOptions, @@ -259,7 +260,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -272,13 +273,13 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -291,7 +292,7 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = reply(to, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Venue @@ -300,7 +301,7 @@ suspend fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, latitude: Double, longitude: Double, @@ -318,7 +319,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, latitude = latitude, longitude = longitude, @@ -337,7 +338,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, location: StaticLocation, title: String, @@ -354,7 +355,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, latitude = location.latitude, longitude = location.longitude, @@ -373,7 +374,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, venue: Venue, replyInChatId: IdChatIdentifier = to.chat.id, @@ -384,7 +385,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, venue = venue, threadId = replyInThreadId, @@ -399,7 +400,7 @@ suspend inline fun TelegramBot.reply( // Game -suspend inline fun TelegramBot.replyWithGame( +public suspend inline fun TelegramBot.replyWithGame( to: AccessibleMessage, gameShortName: String, replyInChatId: IdChatIdentifier = to.chat.id, @@ -410,11 +411,11 @@ suspend inline fun TelegramBot.replyWithGame( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( replyInChatId, gameShortName, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup ) -suspend inline fun TelegramBot.replyWithGame( +public suspend inline fun TelegramBot.replyWithGame( to: AccessibleMessage, game: Game, replyInChatId: IdChatIdentifier = to.chat.id, @@ -425,11 +426,11 @@ suspend inline fun TelegramBot.replyWithGame( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( replyInChatId, game.title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, game: Game, replyInChatId: IdChatIdentifier = to.chat.id, @@ -440,12 +441,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = replyWithGame(to, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = replyWithGame(to, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Animation -suspend inline fun TelegramBot.replyWithAnimation( +public suspend inline fun TelegramBot.replyWithAnimation( to: AccessibleMessage, animation: InputFile, thumb: InputFile? = null, @@ -464,7 +465,7 @@ suspend inline fun TelegramBot.replyWithAnimation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = replyInChatId, animation = animation, thumb = thumb, @@ -484,7 +485,7 @@ suspend inline fun TelegramBot.replyWithAnimation( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, animation: AnimationFile, text: String? = null, @@ -502,7 +503,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = replyInChatId, animation = animation, text = text, @@ -521,7 +522,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.replyWithAnimation( +public suspend inline fun TelegramBot.replyWithAnimation( to: AccessibleMessage, animation: InputFile, entities: TextSourcesList, @@ -539,7 +540,7 @@ suspend inline fun TelegramBot.replyWithAnimation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = replyInChatId, animation = animation, thumb = thumb, @@ -558,7 +559,7 @@ suspend inline fun TelegramBot.replyWithAnimation( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, animation: AnimationFile, entities: TextSourcesList, @@ -575,7 +576,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = replyInChatId, animation = animation, entities = entities, @@ -596,7 +597,7 @@ suspend inline fun TelegramBot.reply( // Audio -suspend inline fun TelegramBot.replyWithAudio( +public suspend inline fun TelegramBot.replyWithAudio( to: AccessibleMessage, audio: InputFile, thumb: InputFile? = null, @@ -613,9 +614,9 @@ suspend inline fun TelegramBot.replyWithAudio( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, audio: AudioFile, text: String? = null, @@ -629,9 +630,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithAudio( +public suspend inline fun TelegramBot.replyWithAudio( to: AccessibleMessage, audio: InputFile, thumb: InputFile? = null, @@ -647,9 +648,9 @@ suspend inline fun TelegramBot.replyWithAudio( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, audio: AudioFile, entities: TextSourcesList, @@ -662,12 +663,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Documents -suspend inline fun TelegramBot.replyWithDocument( +public suspend inline fun TelegramBot.replyWithDocument( to: AccessibleMessage, document: InputFile, thumb: InputFile? = null, @@ -682,9 +683,9 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, document: DocumentFile, text: String? = null, @@ -698,9 +699,9 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.replyWithDocument( +public suspend inline fun TelegramBot.replyWithDocument( to: AccessibleMessage, document: InputFile, thumb: InputFile? = null, @@ -714,9 +715,9 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, document: DocumentFile, entities: TextSourcesList, @@ -729,13 +730,13 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) // Media Group @RiskFeature(rawSendingMediaGroupsWarning) -suspend inline fun TelegramBot.replyWithMediaGroup( +public suspend inline fun TelegramBot.replyWithMediaGroup( to: AccessibleMessage, media: List, replyInChatId: IdChatIdentifier = to.chat.id, @@ -745,7 +746,7 @@ suspend inline fun TelegramBot.replyWithMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup( +): ContentMessage> = sendMediaGroup( chatId = replyInChatId, media = media, threadId = replyInThreadId, @@ -756,7 +757,7 @@ suspend inline fun TelegramBot.replyWithMediaGroup( replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply) ) -suspend inline fun TelegramBot.replyWithPlaylist( +public suspend inline fun TelegramBot.replyWithPlaylist( to: AccessibleMessage, media: List, replyInChatId: IdChatIdentifier = to.chat.id, @@ -766,7 +767,7 @@ suspend inline fun TelegramBot.replyWithPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendPlaylist( +): ContentMessage> = sendPlaylist( chatId = replyInChatId, media = media, threadId = replyInThreadId, @@ -777,7 +778,7 @@ suspend inline fun TelegramBot.replyWithPlaylist( replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply) ) -suspend inline fun TelegramBot.replyWithDocuments( +public suspend inline fun TelegramBot.replyWithDocuments( to: AccessibleMessage, media: List, replyInChatId: IdChatIdentifier = to.chat.id, @@ -787,7 +788,7 @@ suspend inline fun TelegramBot.replyWithDocuments( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup( +): ContentMessage> = sendDocumentsGroup( chatId = replyInChatId, media = media, threadId = replyInThreadId, @@ -798,7 +799,7 @@ suspend inline fun TelegramBot.replyWithDocuments( replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply) ) -suspend inline fun TelegramBot.replyWithGallery( +public suspend inline fun TelegramBot.replyWithGallery( to: AccessibleMessage, media: List, replyInChatId: IdChatIdentifier = to.chat.id, @@ -808,7 +809,7 @@ suspend inline fun TelegramBot.replyWithGallery( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup( +): ContentMessage> = sendVisualMediaGroup( chatId = replyInChatId, media = media, threadId = replyInThreadId, @@ -822,7 +823,7 @@ suspend inline fun TelegramBot.replyWithGallery( // Photo -suspend inline fun TelegramBot.replyWithPhoto( +public suspend inline fun TelegramBot.replyWithPhoto( to: AccessibleMessage, fileId: InputFile, text: String? = null, @@ -837,7 +838,7 @@ suspend inline fun TelegramBot.replyWithPhoto( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, fileId = fileId, text = text, @@ -853,7 +854,7 @@ suspend inline fun TelegramBot.replyWithPhoto( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, photo: PhotoFile, text: String? = null, @@ -868,7 +869,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, photo = photo, text = text, @@ -884,7 +885,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, photoSize: PhotoSize, text: String? = null, @@ -899,7 +900,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, photoSize = photoSize, text = text, @@ -916,7 +917,7 @@ suspend inline fun TelegramBot.reply( ) -suspend inline fun TelegramBot.replyWithPhoto( +public suspend inline fun TelegramBot.replyWithPhoto( to: AccessibleMessage, fileId: InputFile, entities: TextSourcesList, @@ -930,7 +931,7 @@ suspend inline fun TelegramBot.replyWithPhoto( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, fileId = fileId, entities = entities, @@ -945,7 +946,7 @@ suspend inline fun TelegramBot.replyWithPhoto( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, photo: PhotoFile, entities: TextSourcesList, @@ -959,7 +960,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, photo = photo, entities = entities, @@ -974,7 +975,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, photoSize: PhotoSize, entities: TextSourcesList, @@ -988,7 +989,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = replyInChatId, photoSize = photoSize, entities = entities, @@ -1006,7 +1007,7 @@ suspend inline fun TelegramBot.reply( // Sticker -suspend inline fun TelegramBot.replyWithSticker( +public suspend inline fun TelegramBot.replyWithSticker( to: AccessibleMessage, sticker: InputFile, emoji: String? = null, @@ -1018,9 +1019,9 @@ suspend inline fun TelegramBot.replyWithSticker( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, sticker: Sticker, emoji: String? = null, @@ -1032,12 +1033,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Videos -suspend inline fun TelegramBot.replyWithVideo( +public suspend inline fun TelegramBot.replyWithVideo( to: AccessibleMessage, video: InputFile, thumb: InputFile? = null, @@ -1056,7 +1057,7 @@ suspend inline fun TelegramBot.replyWithVideo( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = replyInChatId, video = video, thumb = thumb, @@ -1076,7 +1077,7 @@ suspend inline fun TelegramBot.replyWithVideo( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, video: VideoFile, text: String? = null, @@ -1091,7 +1092,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = replyInChatId, video = video, text = text, @@ -1107,7 +1108,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.replyWithVideo( +public suspend inline fun TelegramBot.replyWithVideo( to: AccessibleMessage, video: InputFile, thumb: InputFile? = null, @@ -1125,7 +1126,7 @@ suspend inline fun TelegramBot.replyWithVideo( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = replyInChatId, video = video, thumb = thumb, @@ -1144,7 +1145,7 @@ suspend inline fun TelegramBot.replyWithVideo( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, video: VideoFile, entities: TextSourcesList, @@ -1158,7 +1159,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = replyInChatId, video = video, entities = entities, @@ -1176,7 +1177,7 @@ suspend inline fun TelegramBot.reply( // VideoNotes -suspend inline fun TelegramBot.replyWithVideoNote( +public suspend inline fun TelegramBot.replyWithVideoNote( to: AccessibleMessage, videoNote: InputFile, thumb: InputFile? = null, @@ -1190,7 +1191,7 @@ suspend inline fun TelegramBot.replyWithVideoNote( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote( +): ContentMessage = sendVideoNote( chatId = replyInChatId, videoNote = videoNote, thumb = thumb, @@ -1205,7 +1206,7 @@ suspend inline fun TelegramBot.replyWithVideoNote( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, videoNote: VideoNoteFile, replyInChatId: IdChatIdentifier = to.chat.id, @@ -1216,7 +1217,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote( +): ContentMessage = sendVideoNote( chatId = replyInChatId, videoNote = videoNote, threadId = replyInThreadId, @@ -1231,7 +1232,7 @@ suspend inline fun TelegramBot.reply( // Voice -suspend inline fun TelegramBot.replyWithVoice( +public suspend inline fun TelegramBot.replyWithVoice( to: AccessibleMessage, voice: InputFile, text: String? = null, @@ -1245,9 +1246,9 @@ suspend inline fun TelegramBot.replyWithVoice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, voice: VoiceFile, text: String? = null, @@ -1260,10 +1261,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) -suspend inline fun TelegramBot.replyWithVoice( +public suspend inline fun TelegramBot.replyWithVoice( to: AccessibleMessage, voice: InputFile, entities: TextSourcesList, @@ -1276,9 +1277,9 @@ suspend inline fun TelegramBot.replyWithVoice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, voice: VoiceFile, entities: TextSourcesList, @@ -1290,7 +1291,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Invoice @@ -1299,7 +1300,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, title: String, description: String, @@ -1325,14 +1326,14 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(replyInChatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, replyInThreadId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) +): ContentMessage = sendInvoice(replyInChatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, replyInThreadId, disableNotification, protectContent, effectId, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, title: String, description: String, @@ -1347,7 +1348,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice( +): ContentMessage = sendInvoice( chatId = replyInChatId, title = title, description = description, @@ -1367,7 +1368,7 @@ suspend inline fun TelegramBot.reply( // Polls -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, question: String, options: List, @@ -1384,9 +1385,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, poll: RegularPoll, question: String, @@ -1404,10 +1405,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, questionTextSources: List, options: List, @@ -1423,9 +1424,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, poll: RegularPoll, questionTextSources: List = poll.questionTextSources, @@ -1442,9 +1443,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, question: String, options: List, @@ -1463,9 +1464,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, quizPoll: QuizPoll, question: String, @@ -1486,9 +1487,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, questionTextSources: List, options: List, @@ -1506,9 +1507,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, quizPoll: QuizPoll, explanation: String?, @@ -1528,9 +1529,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, question: String, options: List, @@ -1548,9 +1549,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, quizPoll: QuizPoll, question: String, @@ -1570,9 +1571,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, questionTextSources: List, options: List, @@ -1589,9 +1590,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, quizPoll: QuizPoll, questionTextSources: List = quizPoll.questionTextSources, @@ -1610,10 +1611,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(to.chat.id, to.messageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, poll: Poll, question: String, @@ -1629,7 +1630,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = when (poll) { +): ContentMessage = when (poll) { is RegularPoll -> reply( toChatId = to.chat.id, toMessageId = to.messageId, @@ -1670,7 +1671,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) } -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, poll: Poll, questionTextSources: List = poll.questionTextSources, @@ -1686,7 +1687,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = when (poll) { +): ContentMessage = when (poll) { is RegularPoll -> reply( toChatId = to.chat.id, toMessageId = to.messageId, @@ -1729,7 +1730,7 @@ suspend inline fun TelegramBot.reply( } -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, fromChatId: ChatIdentifier, messageId: MessageId, @@ -1742,7 +1743,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( replyInChatId, fromChatId, messageId, @@ -1756,7 +1757,7 @@ suspend inline fun TelegramBot.reply( replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, fromChat: Chat, messageId: MessageId, @@ -1769,9 +1770,9 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = reply(to, fromChat.id, messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) +): MessageId = reply(to, fromChat.id, messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( to: AccessibleMessage, copy: AccessibleMessage, text: String? = null, @@ -1783,7 +1784,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = reply( +): MessageId = reply( to = to, fromChat = copy.chat, messageId = copy.messageId, @@ -1798,7 +1799,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, content: MessageContent, replyInChatId: IdChatIdentifier = to.chat.id, @@ -1827,7 +1828,7 @@ suspend fun TelegramBot.reply( * * @see handleLiveLocation */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, @@ -1838,7 +1839,7 @@ suspend fun TelegramBot.reply( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = handleLiveLocation( +): Unit = handleLiveLocation( replyInChatId, locationsFlow, liveTimeMillis, @@ -1857,7 +1858,7 @@ suspend fun TelegramBot.reply( */ @JvmName("replyLiveLocationWithLocation") @JsName("replyLiveLocationWithLocation") -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, @@ -1889,7 +1890,7 @@ suspend fun TelegramBot.reply( */ @JvmName("replyLiveLocationWithLatLong") @JsName("replyLiveLocationWithLatLong") -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, locationsFlow: Flow>, liveTimeMillis: Long = defaultLivePeriodDelayMillis, @@ -1914,7 +1915,7 @@ suspend fun TelegramBot.reply( ) } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, mediaFile: TelegramMediaFile, replyInChatId: IdChatIdentifier = to.chat.id, @@ -2038,7 +2039,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, content: TextedMediaContent, text: String?, @@ -2140,7 +2141,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, content: TextedMediaContent, entities: TextSourcesList, @@ -2235,7 +2236,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, starCount: Int, media: List, @@ -2267,7 +2268,7 @@ suspend fun TelegramBot.reply( ) } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( to: AccessibleMessage, starCount: Int, media: List, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt index b2b17673eb..9357b164db 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt @@ -25,6 +25,7 @@ import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.payments.PaidMedia import dev.inmo.tgbotapi.types.message.payments.toTelegramMediaPhoto @@ -45,7 +46,7 @@ import kotlin.jvm.JvmName * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, phoneNumber: String, @@ -59,7 +60,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( replyInChatId, phoneNumber, firstName, @@ -77,7 +78,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, contact: Contact, @@ -89,7 +90,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( replyInChatId, contact, replyInThreadId, @@ -108,7 +109,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.replyWithDice( +public suspend inline fun TelegramBot.replyWithDice( toChatId: IdChatIdentifier, toMessageId: MessageId, animationType: DiceAnimationType? = null, @@ -120,13 +121,13 @@ suspend inline fun TelegramBot.replyWithDice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendDice(replyInChatId, animationType, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, animationType: DiceAnimationType, @@ -138,7 +139,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = replyWithDice(toChatId, toMessageId, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = replyWithDice(toChatId, toMessageId, animationType, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Location @@ -147,7 +148,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, latitude: Double, @@ -160,7 +161,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( replyInChatId, latitude, longitude, @@ -177,7 +178,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, location: StaticLocation, @@ -189,7 +190,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( replyInChatId, location, replyInThreadId, @@ -208,7 +209,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, text: String, @@ -222,7 +223,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage( +): ContentMessage = sendTextMessage( replyInChatId, text, parseMode, @@ -240,7 +241,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, entities: TextSourcesList, @@ -253,7 +254,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage( +): ContentMessage = sendTextMessage( replyInChatId, entities, linkPreviewOptions, @@ -270,7 +271,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, separator: TextSource? = null, @@ -284,13 +285,13 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, separator: String, @@ -304,7 +305,7 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = reply(toChatId, toMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Venue @@ -313,7 +314,7 @@ suspend fun TelegramBot.reply( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, latitude: Double, @@ -332,7 +333,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, latitude = latitude, longitude = longitude, @@ -351,7 +352,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, location: StaticLocation, @@ -369,7 +370,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, latitude = location.latitude, longitude = location.longitude, @@ -388,7 +389,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, venue: Venue, @@ -400,7 +401,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = replyInChatId, venue = venue, threadId = replyInThreadId, @@ -415,7 +416,7 @@ suspend inline fun TelegramBot.reply( // Game -suspend inline fun TelegramBot.replyWithGame( +public suspend inline fun TelegramBot.replyWithGame( toChatId: IdChatIdentifier, toMessageId: MessageId, gameShortName: String, @@ -427,11 +428,11 @@ suspend inline fun TelegramBot.replyWithGame( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( replyInChatId, gameShortName, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup ) -suspend inline fun TelegramBot.replyWithGame( +public suspend inline fun TelegramBot.replyWithGame( toChatId: IdChatIdentifier, toMessageId: MessageId, game: Game, @@ -443,11 +444,11 @@ suspend inline fun TelegramBot.replyWithGame( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( replyInChatId, game.title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, game: Game, @@ -459,12 +460,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = replyWithGame(toChatId, toMessageId, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) +): ContentMessage = replyWithGame(toChatId, toMessageId, game, replyInChatId, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, allowSendingWithoutReply, replyMarkup) // Animation -suspend inline fun TelegramBot.replyWithAnimation( +public suspend inline fun TelegramBot.replyWithAnimation( toChatId: IdChatIdentifier, toMessageId: MessageId, animation: InputFile, @@ -484,7 +485,7 @@ suspend inline fun TelegramBot.replyWithAnimation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( replyInChatId, animation, thumb, @@ -504,7 +505,7 @@ suspend inline fun TelegramBot.replyWithAnimation( replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, animation: AnimationFile, @@ -523,9 +524,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(replyInChatId, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAnimation(replyInChatId, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithAnimation( +public suspend inline fun TelegramBot.replyWithAnimation( toChatId: IdChatIdentifier, toMessageId: MessageId, animation: InputFile, @@ -544,7 +545,7 @@ suspend inline fun TelegramBot.replyWithAnimation( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( replyInChatId, animation, thumb, @@ -563,7 +564,7 @@ suspend inline fun TelegramBot.replyWithAnimation( replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, animation: AnimationFile, @@ -581,12 +582,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(replyInChatId, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAnimation(replyInChatId, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Audio -suspend inline fun TelegramBot.replyWithAudio( +public suspend inline fun TelegramBot.replyWithAudio( toChatId: IdChatIdentifier, toMessageId: MessageId, audio: InputFile, @@ -604,9 +605,9 @@ suspend inline fun TelegramBot.replyWithAudio( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, thumb, text, parseMode, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, audio: AudioFile, @@ -621,9 +622,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, text, parseMode, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithAudio( +public suspend inline fun TelegramBot.replyWithAudio( toChatId: IdChatIdentifier, toMessageId: MessageId, audio: InputFile, @@ -640,9 +641,9 @@ suspend inline fun TelegramBot.replyWithAudio( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, thumb, entities, duration, performer, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, audio: AudioFile, @@ -656,12 +657,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendAudio(replyInChatId, audio, entities, title, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Documents -suspend inline fun TelegramBot.replyWithDocument( +public suspend inline fun TelegramBot.replyWithDocument( toChatId: IdChatIdentifier, toMessageId: MessageId, document: InputFile, @@ -677,9 +678,9 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, thumb, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, document: DocumentFile, @@ -694,9 +695,9 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.replyWithDocument( +public suspend inline fun TelegramBot.replyWithDocument( toChatId: IdChatIdentifier, toMessageId: MessageId, document: InputFile, @@ -711,9 +712,9 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, thumb, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, document: DocumentFile, @@ -727,13 +728,13 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(replyInChatId, document, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup, disableContentTypeDetection) // Media Group @RiskFeature(rawSendingMediaGroupsWarning) -suspend inline fun TelegramBot.replyWithMediaGroup( +public suspend inline fun TelegramBot.replyWithMediaGroup( toChatId: IdChatIdentifier, toMessageId: MessageId, media: List, @@ -744,9 +745,9 @@ suspend inline fun TelegramBot.replyWithMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) +): ContentMessage> = sendMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) -suspend inline fun TelegramBot.replyWithPlaylist( +public suspend inline fun TelegramBot.replyWithPlaylist( toChatId: IdChatIdentifier, toMessageId: MessageId, media: List, @@ -757,9 +758,9 @@ suspend inline fun TelegramBot.replyWithPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendPlaylist(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) +): ContentMessage> = sendPlaylist(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) -suspend inline fun TelegramBot.replyWithDocuments( +public suspend inline fun TelegramBot.replyWithDocuments( toChatId: IdChatIdentifier, toMessageId: MessageId, media: List, @@ -770,9 +771,9 @@ suspend inline fun TelegramBot.replyWithDocuments( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) +): ContentMessage> = sendDocumentsGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) -suspend inline fun TelegramBot.replyWithGallery( +public suspend inline fun TelegramBot.replyWithGallery( toChatId: IdChatIdentifier, toMessageId: MessageId, media: List, @@ -783,12 +784,12 @@ suspend inline fun TelegramBot.replyWithGallery( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) +): ContentMessage> = sendVisualMediaGroup(replyInChatId, media, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply)) // Photo -suspend inline fun TelegramBot.replyWithPhoto( +public suspend inline fun TelegramBot.replyWithPhoto( toChatId: IdChatIdentifier, toMessageId: MessageId, fileId: InputFile, @@ -804,9 +805,9 @@ suspend inline fun TelegramBot.replyWithPhoto( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, fileId, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, fileId, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, photo: PhotoFile, @@ -822,9 +823,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, photo, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, photo, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, photoSize: PhotoSize, @@ -840,10 +841,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithPhoto( +public suspend inline fun TelegramBot.replyWithPhoto( toChatId: IdChatIdentifier, toMessageId: MessageId, fileId: InputFile, @@ -858,9 +859,9 @@ suspend inline fun TelegramBot.replyWithPhoto( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, fileId, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, fileId, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, photo: PhotoFile, @@ -875,9 +876,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, photo, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, photo, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, photoSize: PhotoSize, @@ -892,12 +893,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(replyInChatId, photoSize, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendPhoto(replyInChatId, photoSize, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Sticker -suspend inline fun TelegramBot.replyWithSticker( +public suspend inline fun TelegramBot.replyWithSticker( toChatId: IdChatIdentifier, toMessageId: MessageId, sticker: InputFile, @@ -910,9 +911,9 @@ suspend inline fun TelegramBot.replyWithSticker( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, sticker: Sticker, @@ -925,12 +926,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendSticker(replyInChatId, sticker, replyInThreadId, replyInBusinessConnectionId, emoji, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Videos -suspend inline fun TelegramBot.replyWithVideo( +public suspend inline fun TelegramBot.replyWithVideo( toChatId: IdChatIdentifier, toMessageId: MessageId, video: InputFile, @@ -950,9 +951,9 @@ suspend inline fun TelegramBot.replyWithVideo( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(replyInChatId, video, thumb, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideo(replyInChatId, video, thumb, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, video: VideoFile, @@ -968,9 +969,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(replyInChatId, video, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideo(replyInChatId, video, text, parseMode, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithVideo( +public suspend inline fun TelegramBot.replyWithVideo( toChatId: IdChatIdentifier, toMessageId: MessageId, video: InputFile, @@ -989,9 +990,9 @@ suspend inline fun TelegramBot.replyWithVideo( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(replyInChatId, video, thumb, entities, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideo(replyInChatId, video, thumb, entities, showCaptionAboveMedia, spoilered, duration, width, height, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, video: VideoFile, @@ -1006,12 +1007,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(replyInChatId, video, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideo(replyInChatId, video, entities, showCaptionAboveMedia, spoilered, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // VideoNotes -suspend inline fun TelegramBot.replyWithVideoNote( +public suspend inline fun TelegramBot.replyWithVideoNote( toChatId: IdChatIdentifier, toMessageId: MessageId, videoNote: InputFile, @@ -1026,9 +1027,9 @@ suspend inline fun TelegramBot.replyWithVideoNote( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideoNote(replyInChatId, videoNote, thumb, duration, size, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, videoNote: VideoNoteFile, @@ -1040,12 +1041,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(replyInChatId, videoNote, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVideoNote(replyInChatId, videoNote, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Voice -suspend inline fun TelegramBot.replyWithVoice( +public suspend inline fun TelegramBot.replyWithVoice( toChatId: IdChatIdentifier, toMessageId: MessageId, voice: InputFile, @@ -1060,9 +1061,9 @@ suspend inline fun TelegramBot.replyWithVoice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, text, parseMode, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, voice: VoiceFile, @@ -1076,10 +1077,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, text, parseMode, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.replyWithVoice( +public suspend inline fun TelegramBot.replyWithVoice( toChatId: IdChatIdentifier, toMessageId: MessageId, voice: InputFile, @@ -1093,9 +1094,9 @@ suspend inline fun TelegramBot.replyWithVoice( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, entities, duration, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, voice: VoiceFile, @@ -1108,7 +1109,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendVoice(replyInChatId, voice, entities, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Invoice @@ -1117,7 +1118,7 @@ suspend inline fun TelegramBot.reply( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, title: String, @@ -1144,12 +1145,12 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(replyInChatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, replyInThreadId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendInvoice(replyInChatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, replyInThreadId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) // Polls -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, question: String, @@ -1167,9 +1168,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, poll: RegularPoll, @@ -1188,10 +1189,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, question, options, closeInfo, questionParseMode, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, questionTextSources: List, @@ -1208,9 +1209,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, poll: RegularPoll, @@ -1228,9 +1229,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendRegularPoll(replyInChatId, questionTextSources, options, closeInfo, isAnonymous, allowMultipleAnswers, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, question: String, @@ -1250,9 +1251,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, quizPoll: QuizPoll, @@ -1274,9 +1275,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, questionTextSources: List, @@ -1295,9 +1296,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, quizPoll: QuizPoll, @@ -1318,9 +1319,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, question: String, @@ -1339,9 +1340,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, quizPoll: QuizPoll, @@ -1362,9 +1363,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, questionTextSources: List, @@ -1382,9 +1383,9 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, quizPoll: QuizPoll, @@ -1404,10 +1405,10 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) +): ContentMessage = sendQuizPoll(replyInChatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, replyInThreadId, replyInBusinessConnectionId, disableNotification, protectContent, effectId, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, poll: Poll, @@ -1424,7 +1425,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = when (poll) { +): ContentMessage = when (poll) { is RegularPoll -> reply( toChatId = toChatId, toMessageId = toMessageId, @@ -1464,7 +1465,7 @@ suspend inline fun TelegramBot.reply( replyMarkup = replyMarkup ) } -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, poll: Poll, @@ -1481,7 +1482,7 @@ suspend inline fun TelegramBot.reply( effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = when (poll) { +): ContentMessage = when (poll) { is RegularPoll -> reply( toChatId = toChatId, toMessageId = toMessageId, @@ -1524,7 +1525,7 @@ suspend inline fun TelegramBot.reply( } -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, fromChatId: ChatIdentifier, @@ -1538,7 +1539,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage( +): MessageId = copyMessage( replyInChatId, fromChatId, messageId, @@ -1552,7 +1553,7 @@ suspend inline fun TelegramBot.reply( replyMarkup ) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, fromChat: Chat, @@ -1566,9 +1567,9 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = reply(toChatId, toMessageId, fromChat.id, messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) +): MessageId = reply(toChatId, toMessageId, fromChat.id, messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) -suspend inline fun TelegramBot.reply( +public suspend inline fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, copy: AccessibleMessage, @@ -1581,9 +1582,9 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = reply(toChatId, toMessageId, copy.chat.id, copy.messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) +): MessageId = reply(toChatId, toMessageId, copy.chat.id, copy.messageId, text, parseMode, showCaptionAboveMedia, replyInChatId, replyInThreadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup) -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, content: MessageContent, @@ -1615,7 +1616,7 @@ suspend fun TelegramBot.reply( * * @see handleLiveLocation */ -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, locationsFlow: Flow, @@ -1627,7 +1628,7 @@ suspend fun TelegramBot.reply( protectContent: Boolean = false, effectId: EffectId? = null, allowSendingWithoutReply: Boolean? = null -) = handleLiveLocation( +): Unit = handleLiveLocation( replyInChatId, locationsFlow, liveTimeMillis, @@ -1646,7 +1647,7 @@ suspend fun TelegramBot.reply( */ @JvmName("replyLiveLocationWithLocationChatIdAndMessageId") @JsName("replyLiveLocationWithLocationChatIdAndMessageId") -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, locationsFlow: Flow, @@ -1679,7 +1680,7 @@ suspend fun TelegramBot.reply( */ @JvmName("replyLiveLocationWithLatLongChatIdAndMessageId") @JsName("replyLiveLocationWithLatLongChatIdAndMessageId") -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, locationsFlow: Flow>, @@ -1705,7 +1706,7 @@ suspend fun TelegramBot.reply( ) } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, mediaFile: TelegramMediaFile, @@ -1839,7 +1840,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, content: TextedMediaContent, @@ -1948,7 +1949,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, content: TextedMediaContent, @@ -2049,7 +2050,7 @@ suspend fun TelegramBot.reply( } } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, starCount: Int, @@ -2082,7 +2083,7 @@ suspend fun TelegramBot.reply( ) } -suspend fun TelegramBot.reply( +public suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, starCount: Int, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt index 7d6cf5ace0..fe534ff56b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.message.content.MessageContent /** * This method will send [content] to the [chatId] as is */ -suspend inline fun TelegramBot.resend( +public suspend inline fun TelegramBot.resend( chatId: ChatIdentifier, content: T, messageThreadId: MessageThreadId? = chatId.threadId, @@ -19,7 +19,7 @@ suspend inline fun TelegramBot.resend( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( content.createResend( chatId = chatId, messageThreadId = messageThreadId, @@ -34,7 +34,7 @@ suspend inline fun TelegramBot.resend( /** * This method will send [content] to the [chat] as is */ -suspend inline fun TelegramBot.resend( +public suspend inline fun TelegramBot.resend( chat: Chat, content: T, messageThreadId: MessageThreadId? = chat.id.threadId, @@ -43,7 +43,7 @@ suspend inline fun TelegramBot.resend( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = resend( +): ContentMessage = resend( chatId = chat.id, content = content, messageThreadId = messageThreadId, @@ -59,7 +59,7 @@ suspend inline fun TelegramBot.resend( * native methods for data sending (like [dev.inmo.tgbotapi.extensions.api.send.media.sendPhoto] if inoming content is * [dev.inmo.tgbotapi.types.message.content.PhotoContent]) */ -suspend inline fun TelegramBot.resend( +public suspend inline fun TelegramBot.resend( chatId: ChatIdentifier, message: ContentMessage, messageThreadId: MessageThreadId? = chatId.threadId, @@ -68,7 +68,7 @@ suspend inline fun TelegramBot.resend( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = resend( +): ContentMessage = resend( chatId = chatId, content = message.content, messageThreadId = messageThreadId, @@ -84,7 +84,7 @@ suspend inline fun TelegramBot.resend( * native methods for data sending (like [dev.inmo.tgbotapi.extensions.api.send.media.sendPhoto] if inoming content is * [dev.inmo.tgbotapi.types.message.content.PhotoContent]) */ -suspend inline fun TelegramBot.resend( +public suspend inline fun TelegramBot.resend( chat: Chat, message: ContentMessage, messageThreadId: MessageThreadId? = chat.id.threadId, @@ -93,7 +93,7 @@ suspend inline fun TelegramBot.resend( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = resend( +): ContentMessage = resend( chatId = chat.id, message = message, messageThreadId = messageThreadId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendAction.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendAction.kt index d7bf65dfa8..487d62d498 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendAction.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendAction.kt @@ -10,147 +10,147 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.threadId -suspend fun TelegramBot.sendBotAction( +public suspend fun TelegramBot.sendBotAction( chatId: ChatIdentifier, action: BotAction, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = execute( +): Boolean = execute( SendAction(chatId, action, threadId, businessConnectionId) ) -suspend fun TelegramBot.sendBotAction( +public suspend fun TelegramBot.sendBotAction( chat: Chat, action: BotAction, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat.id, action, threadId, businessConnectionId) +): Boolean = sendBotAction(chat.id, action, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionTyping( +public suspend fun TelegramBot.sendActionTyping( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, TypingAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, TypingAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadPhoto( +public suspend fun TelegramBot.sendActionUploadPhoto( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, UploadPhotoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, UploadPhotoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVideo( +public suspend fun TelegramBot.sendActionRecordVideo( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, RecordVideoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, RecordVideoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVideo( +public suspend fun TelegramBot.sendActionUploadVideo( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, UploadVideoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, UploadVideoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVoice( +public suspend fun TelegramBot.sendActionRecordVoice( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, RecordVoiceAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, RecordVoiceAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVoice( +public suspend fun TelegramBot.sendActionUploadVoice( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, UploadVoiceAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, UploadVoiceAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadDocument( +public suspend fun TelegramBot.sendActionUploadDocument( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, UploadDocumentAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, UploadDocumentAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionFindLocation( +public suspend fun TelegramBot.sendActionFindLocation( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, FindLocationAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, FindLocationAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVideoNote( +public suspend fun TelegramBot.sendActionRecordVideoNote( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVideoNote( +public suspend fun TelegramBot.sendActionUploadVideoNote( chatId: ChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId -) = sendBotAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionTyping( +public suspend fun TelegramBot.sendActionTyping( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, TypingAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, TypingAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadPhoto( +public suspend fun TelegramBot.sendActionUploadPhoto( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, UploadPhotoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, UploadPhotoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVideo( +public suspend fun TelegramBot.sendActionRecordVideo( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, RecordVideoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, RecordVideoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVideo( +public suspend fun TelegramBot.sendActionUploadVideo( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, UploadVideoAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, UploadVideoAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVoice( +public suspend fun TelegramBot.sendActionRecordVoice( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, RecordVoiceAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, RecordVoiceAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVoice( +public suspend fun TelegramBot.sendActionUploadVoice( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, UploadVoiceAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, UploadVoiceAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadDocument( +public suspend fun TelegramBot.sendActionUploadDocument( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, UploadDocumentAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, UploadDocumentAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionFindLocation( +public suspend fun TelegramBot.sendActionFindLocation( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, FindLocationAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, FindLocationAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionRecordVideoNote( +public suspend fun TelegramBot.sendActionRecordVideoNote( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, RecordVideoNoteAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, RecordVideoNoteAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionUploadVideoNote( +public suspend fun TelegramBot.sendActionUploadVideoNote( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, UploadVideoNoteAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, UploadVideoNoteAction, threadId, businessConnectionId) -suspend fun TelegramBot.sendActionChooseStickerAction( +public suspend fun TelegramBot.sendActionChooseStickerAction( chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId -) = sendBotAction(chat, ChooseStickerAction, threadId, businessConnectionId) +): Boolean = sendBotAction(chat, ChooseStickerAction, threadId, businessConnectionId) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt index 11ed6b9410..17d5e175e8 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt @@ -12,10 +12,10 @@ import kotlinx.coroutines.* import kotlin.contracts.* private const val refreshTime: MilliSeconds = (botActionActualityTime - 1) * 1000L -typealias TelegramBotActionCallback = suspend TelegramBot.() -> T +public typealias TelegramBotActionCallback = suspend TelegramBot.() -> T @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withAction( +public suspend fun TelegramBot.withAction( actionRequest: SendAction, block: TelegramBotActionCallback ): T { @@ -36,7 +36,7 @@ suspend fun TelegramBot.withAction( } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withAction( +public suspend fun TelegramBot.withAction( chatId: IdChatIdentifier, action: BotAction, threadId: MessageThreadId? = chatId.threadId, @@ -53,7 +53,7 @@ suspend fun TelegramBot.withAction( } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withAction( +public suspend fun TelegramBot.withAction( chat: Chat, action: BotAction, threadId: MessageThreadId? = chat.id.threadId, @@ -73,77 +73,77 @@ suspend fun TelegramBot.withAction( } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, TypingAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, UploadPhotoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, RecordVideoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, UploadVideoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, RecordVoiceAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, UploadVoiceAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, UploadDocumentAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, FindLocationAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } @@ -152,77 +152,77 @@ suspend fun TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, th @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, TypingAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, UploadPhotoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, RecordVideoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, UploadVideoAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, RecordVoiceAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, UploadVoiceAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, UploadDocumentAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, FindLocationAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, RecordVideoNoteAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return withAction(chat, UploadVideoNoteAction, threadId, businessConnectionId, block) } @OptIn(ExperimentalContracts::class) -suspend fun TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { +public suspend fun TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback) : T { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt index 037b50876c..187ba724b8 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt @@ -6,12 +6,14 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.ContactContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendContact( +public suspend fun TelegramBot.sendContact( chatId: ChatIdentifier, phoneNumber: String, firstName: String, @@ -23,7 +25,7 @@ suspend fun TelegramBot.sendContact( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendContact( chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -33,7 +35,7 @@ suspend fun TelegramBot.sendContact( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendContact( +public suspend fun TelegramBot.sendContact( chatId: ChatIdentifier, contact: Contact, threadId: MessageThreadId? = chatId.threadId, @@ -43,7 +45,7 @@ suspend fun TelegramBot.sendContact( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendContact( chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -53,7 +55,7 @@ suspend fun TelegramBot.sendContact( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendContact( +public suspend fun TelegramBot.sendContact( chat: Chat, phoneNumber: String, firstName: String, @@ -65,7 +67,7 @@ suspend fun TelegramBot.sendContact( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -73,7 +75,7 @@ suspend fun TelegramBot.sendContact( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendContact( +public suspend fun TelegramBot.sendContact( chat: Chat, contact: Contact, threadId: MessageThreadId? = chat.id.threadId, @@ -83,6 +85,6 @@ suspend fun TelegramBot.sendContact( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact( +): ContentMessage = sendContact( chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt index 355dcedae2..1e6549bedf 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt @@ -7,12 +7,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.dice.DiceAnimationType +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.DiceContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDice( +public suspend fun TelegramBot.sendDice( chatId: ChatIdentifier, animationType: DiceAnimationType? = null, threadId: MessageThreadId? = chatId.threadId, @@ -22,7 +24,7 @@ suspend fun TelegramBot.sendDice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) ) @@ -30,7 +32,7 @@ suspend fun TelegramBot.sendDice( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDice( +public suspend fun TelegramBot.sendDice( chat: Chat, animationType: DiceAnimationType? = null, threadId: MessageThreadId? = chat.id.threadId, @@ -40,4 +42,4 @@ suspend fun TelegramBot.sendDice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt index bdb19dfcb3..525256ff67 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt @@ -7,12 +7,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.LocationContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -27,7 +29,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendLiveLocation( chatId, latitude, @@ -50,7 +52,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, location: Location, livePeriod: Seconds, @@ -64,7 +66,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chatId, location.latitude, location.longitude, @@ -85,7 +87,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chat: Chat, latitude: Double, longitude: Double, @@ -100,7 +102,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chat.id, latitude, longitude, @@ -121,7 +123,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chat: Chat, location: Location, livePeriod: Seconds, @@ -135,7 +137,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chatId = chat.id, latitude = location.latitude, longitude = location.longitude, @@ -156,7 +158,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLiveLocation( +public suspend fun TelegramBot.sendLiveLocation( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -171,13 +173,13 @@ suspend fun TelegramBot.sendLiveLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLiveLocation( +public suspend fun TelegramBot.sendLiveLocation( chatId: ChatIdentifier, location: Location, livePeriod: Seconds, @@ -191,13 +193,13 @@ suspend fun TelegramBot.sendLiveLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLiveLocation( +public suspend fun TelegramBot.sendLiveLocation( chat: Chat, latitude: Double, longitude: Double, @@ -212,13 +214,13 @@ suspend fun TelegramBot.sendLiveLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLiveLocation( +public suspend fun TelegramBot.sendLiveLocation( chat: Chat, location: Location, livePeriod: Seconds, @@ -232,4 +234,4 @@ suspend fun TelegramBot.sendLiveLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt index 2c4fa0e946..f16a4651a5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt @@ -8,6 +8,8 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.utils.EntitiesBuilderBody import dev.inmo.tgbotapi.utils.buildEntities @@ -16,7 +18,7 @@ import dev.inmo.tgbotapi.utils.buildEntities * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chatId: ChatIdentifier, text: String, parseMode: ParseMode? = null, @@ -28,7 +30,7 @@ suspend fun TelegramBot.sendMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendTextMessage( chatId, text, @@ -48,7 +50,7 @@ suspend fun TelegramBot.sendMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chatId: ChatIdentifier, text: String, parseMode: ParseMode? = null, @@ -60,7 +62,7 @@ suspend fun TelegramBot.sendTextMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage( +): ContentMessage = sendMessage( chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -68,7 +70,7 @@ suspend fun TelegramBot.sendTextMessage( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chat: Chat, text: String, parseMode: ParseMode? = null, @@ -80,14 +82,14 @@ suspend fun TelegramBot.sendTextMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chat: Chat, text: String, parseMode: ParseMode? = null, @@ -99,13 +101,13 @@ suspend fun TelegramBot.sendMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chatId: ChatIdentifier, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -116,7 +118,7 @@ suspend fun TelegramBot.sendMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) ) @@ -124,7 +126,7 @@ suspend fun TelegramBot.sendMessage( * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chatId: ChatIdentifier, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -136,14 +138,14 @@ suspend fun TelegramBot.sendMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chatId: ChatIdentifier, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -155,13 +157,13 @@ suspend fun TelegramBot.sendMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chatId: ChatIdentifier, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -172,7 +174,7 @@ suspend fun TelegramBot.sendTextMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage( +): ContentMessage = sendMessage( chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -180,7 +182,7 @@ suspend fun TelegramBot.sendTextMessage( * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chatId: ChatIdentifier, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -192,14 +194,14 @@ suspend fun TelegramBot.sendTextMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chatId: ChatIdentifier, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -211,13 +213,13 @@ suspend fun TelegramBot.sendTextMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chat: Chat, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -228,13 +230,13 @@ suspend fun TelegramBot.sendMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chat: Chat, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -246,14 +248,14 @@ suspend fun TelegramBot.sendMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendMessage( +public suspend fun TelegramBot.sendMessage( chat: Chat, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -265,14 +267,14 @@ suspend fun TelegramBot.sendMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chat: Chat, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -283,13 +285,13 @@ suspend fun TelegramBot.sendTextMessage( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chat: Chat, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -301,14 +303,14 @@ suspend fun TelegramBot.sendTextMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendTextMessage( +public suspend fun TelegramBot.sendTextMessage( chat: Chat, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -320,4 +322,4 @@ suspend fun TelegramBot.sendTextMessage( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt index 4bc8049c55..52817c8cfe 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt @@ -7,12 +7,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.LocationContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -23,7 +25,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendStaticLocation( chatId, latitude, @@ -42,7 +44,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, location: Location, threadId: MessageThreadId? = chatId.threadId, @@ -52,7 +54,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chatId, location.latitude, location.longitude, @@ -69,7 +71,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chat: Chat, latitude: Double, longitude: Double, @@ -80,7 +82,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chat.id, latitude, longitude, @@ -97,7 +99,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendLocation( +public suspend fun TelegramBot.sendLocation( chat: Chat, location: Location, threadId: MessageThreadId? = chat.id.threadId, @@ -107,7 +109,7 @@ suspend fun TelegramBot.sendLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation( +): ContentMessage = sendLocation( chat.id, location.latitude, location.longitude, @@ -124,7 +126,7 @@ suspend fun TelegramBot.sendLocation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendStaticLocation( +public suspend fun TelegramBot.sendStaticLocation( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -135,13 +137,13 @@ suspend fun TelegramBot.sendStaticLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendStaticLocation( +public suspend fun TelegramBot.sendStaticLocation( chatId: ChatIdentifier, location: Location, threadId: MessageThreadId? = chatId.threadId, @@ -151,13 +153,13 @@ suspend fun TelegramBot.sendStaticLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendStaticLocation( +public suspend fun TelegramBot.sendStaticLocation( chat: Chat, latitude: Double, longitude: Double, @@ -168,13 +170,13 @@ suspend fun TelegramBot.sendStaticLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendStaticLocation( +public suspend fun TelegramBot.sendStaticLocation( chat: Chat, location: Location, threadId: MessageThreadId? = chat.id.threadId, @@ -184,4 +186,4 @@ suspend fun TelegramBot.sendStaticLocation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt index fd7e73e9ea..1223e811f1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt @@ -7,13 +7,15 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.location.StaticLocation +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.VenueContent import dev.inmo.tgbotapi.types.venue.Venue /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -30,7 +32,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVenue( chatId = chatId, latitude = latitude, @@ -55,7 +57,7 @@ suspend fun TelegramBot.sendVenue( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chat: Chat, latitude: Double, longitude: Double, @@ -72,7 +74,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = chat.id, latitude = latitude, longitude = longitude, @@ -95,7 +97,7 @@ suspend fun TelegramBot.sendVenue( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, location: StaticLocation, title: String, @@ -111,7 +113,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = chatId, latitude = location.latitude, longitude = location.longitude, @@ -134,7 +136,7 @@ suspend fun TelegramBot.sendVenue( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chat: Chat, location: StaticLocation, title: String, @@ -150,7 +152,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = chat.id, latitude = location.latitude, longitude = location.longitude, @@ -173,7 +175,7 @@ suspend fun TelegramBot.sendVenue( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chatId: ChatIdentifier, venue: Venue, threadId: MessageThreadId? = chatId.threadId, @@ -183,7 +185,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVenue( chatId = chatId, venue = venue, @@ -201,7 +203,7 @@ suspend fun TelegramBot.sendVenue( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVenue( +public suspend fun TelegramBot.sendVenue( chat: Chat, venue: Venue, threadId: MessageThreadId? = chat.id.threadId, @@ -211,7 +213,7 @@ suspend fun TelegramBot.sendVenue( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue( +): ContentMessage = sendVenue( chatId = chat.id, venue = venue, threadId = threadId, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt index eac023fe7a..22bad29ebb 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt @@ -21,6 +21,7 @@ import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.StaticLocation import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.message.ParseMode +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList @@ -34,25 +35,25 @@ import kotlin.jvm.JvmName /** * Will execute [sendBotAction] request */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, action: BotAction -) = sendBotAction(chatId, action) +): Boolean = sendBotAction(chatId, action) /** * Will execute [sendBotAction] request */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, action: BotAction -) = sendBotAction(chat, action) +): Boolean = sendBotAction(chat, action) /** * Will execute [sendAnimation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, animation: AnimationFile, text: String? = null, @@ -69,14 +70,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chatId, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAnimation(chatId, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, animation: AnimationFile, text: String? = null, @@ -93,14 +94,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAnimation(chat, animation, text, parseMode, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, animation: AnimationFile, entities: TextSourcesList, @@ -116,14 +117,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chatId, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAnimation(chatId, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, animation: AnimationFile, entities: TextSourcesList, @@ -139,14 +140,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAnimation(chat, animation, entities, showCaptionAboveMedia, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAudio] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, audio: AudioFile, text: String? = null, @@ -159,14 +160,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chatId, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAudio] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, audio: AudioFile, text: String? = null, @@ -179,14 +180,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAudio] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, audio: AudioFile, entities: TextSourcesList, @@ -198,14 +199,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chatId, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendAudio] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, audio: AudioFile, entities: TextSourcesList, @@ -217,14 +218,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendContact] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, phoneNumber: String, firstName: String, @@ -236,14 +237,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendContact(chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendContact] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, contact: Contact, threadId: MessageThreadId? = chatId.threadId, @@ -253,14 +254,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendContact(chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendContact] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, phoneNumber: String, firstName: String, @@ -272,14 +273,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chat, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendContact(chat, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendContact] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, contact: Contact, threadId: MessageThreadId? = chat.id.threadId, @@ -289,14 +290,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chat, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendContact(chat, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendDice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, animationType: DiceAnimationType, threadId: MessageThreadId? = chatId.threadId, @@ -306,14 +307,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendDice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, animationType: DiceAnimationType, threadId: MessageThreadId? = chat.id.threadId, @@ -323,14 +324,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chat, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendDice(chat, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendDocument] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, document: DocumentFile, text: String? = null, @@ -343,14 +344,14 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chatId, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chatId, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, document: DocumentFile, text: String? = null, @@ -363,14 +364,14 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, document: DocumentFile, entities: TextSourcesList, @@ -382,14 +383,14 @@ suspend inline fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chatId, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chatId, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, document: DocumentFile, entities: TextSourcesList, @@ -401,14 +402,14 @@ suspend inline fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendGame] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, game: Game, threadId: MessageThreadId? = chatId.threadId, @@ -418,14 +419,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame(chatId, game, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendGame(chatId, game, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendGame] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, game: Game, threadId: MessageThreadId? = chat.id.threadId, @@ -435,14 +436,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame(chat, game, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendGame(chat, game, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendInvoice] request * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: IdChatIdentifier, title: String, description: String, @@ -467,14 +468,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendInvoice] request * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( user: CommonUser, title: String, description: String, @@ -498,14 +499,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -516,14 +517,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendStaticLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, location: StaticLocation, threadId: MessageThreadId? = chatId.threadId, @@ -533,14 +534,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chatId, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendStaticLocation(chatId, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, latitude: Double, longitude: Double, @@ -551,14 +552,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chat, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendStaticLocation(chat, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, location: StaticLocation, threadId: MessageThreadId? = chat.id.threadId, @@ -568,14 +569,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chat, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendStaticLocation(chat, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, text: String, parseMode: ParseMode? = null, @@ -587,14 +588,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, text: String, parseMode: ParseMode? = null, @@ -606,14 +607,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -624,13 +625,13 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -642,14 +643,14 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -661,7 +662,7 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** @@ -669,7 +670,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, entities: TextSourcesList, linkPreviewOptions: LinkPreviewOptions? = null, @@ -680,13 +681,13 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendTextMessage(chat, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, separator: TextSource? = null, linkPreviewOptions: LinkPreviewOptions? = null, @@ -698,14 +699,14 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, separator: String, linkPreviewOptions: LinkPreviewOptions? = null, @@ -717,14 +718,14 @@ suspend fun TelegramBot.send( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, photo: PhotoFile, text: String? = null, @@ -738,14 +739,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chatId, photo, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPaidMedia] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, starCount: Int, media: List, @@ -758,14 +759,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia(chat, starCount, media, text, parseMode, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) +): ContentMessage = sendPaidMedia(chat, starCount, media, text, parseMode, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPaidMedia] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, starCount: Int, media: List, @@ -778,14 +779,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia(chatId, starCount, media, text, parseMode, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) +): ContentMessage = sendPaidMedia(chatId, starCount, media, text, parseMode, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPaidMedia] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, starCount: Int, media: List, @@ -797,14 +798,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia(chat, starCount, media, entities, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) +): ContentMessage = sendPaidMedia(chat, starCount, media, entities, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPaidMedia] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, starCount: Int, media: List, @@ -816,14 +817,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia(chatId, starCount, media, entities, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) +): ContentMessage = sendPaidMedia(chatId, starCount, media, entities, showCaptionAboveMedia, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, photo: PhotoFile, text: String? = null, @@ -837,14 +838,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photo, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chat, photo, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, photoSize: PhotoSize, text: String? = null, @@ -858,14 +859,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chatId, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, photoSize: PhotoSize, text: String? = null, @@ -879,14 +880,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chat, photoSize, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, photo: PhotoFile, entities: TextSourcesList, @@ -899,14 +900,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chatId, photo, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, photo: PhotoFile, entities: TextSourcesList, @@ -919,14 +920,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photo, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chat, photo, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, photoSize: PhotoSize, entities: TextSourcesList, @@ -939,14 +940,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chatId, photoSize, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, photoSize: PhotoSize, entities: TextSourcesList, @@ -959,14 +960,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photoSize, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendPhoto(chat, photoSize, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, question: String, options: List, @@ -982,14 +983,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, questionTextSources: List, options: List, @@ -1004,14 +1005,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, poll: RegularPoll, question: String, @@ -1028,14 +1029,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, poll: RegularPoll, questionTextSources: List = poll.questionTextSources, @@ -1051,14 +1052,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, question: String, options: List, @@ -1074,14 +1075,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, poll: RegularPoll, question: String, @@ -1098,14 +1099,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, poll: RegularPoll, questionTextSources: List = poll.questionTextSources, @@ -1121,14 +1122,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chat.id, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendRegularPoll(chat.id, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, question: String, options: List, @@ -1146,14 +1147,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, question: String, options: List, @@ -1171,14 +1172,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1197,7 +1198,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll( +): ContentMessage = sendQuizPoll( chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1206,7 +1207,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1225,14 +1226,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, questionTextSources: List, options: List, @@ -1249,14 +1250,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, questionTextSources: List, options: List, @@ -1273,14 +1274,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1298,7 +1299,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll( +): ContentMessage = sendQuizPoll( chatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1307,7 +1308,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1325,14 +1326,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, question: String, options: List, @@ -1349,14 +1350,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, question: String, options: List, @@ -1373,14 +1374,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1398,7 +1399,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll( +): ContentMessage = sendQuizPoll( chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1407,7 +1408,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1425,14 +1426,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, questionTextSources: List, options: List, @@ -1448,14 +1449,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, questionTextSources: List, options: List, @@ -1471,14 +1472,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1495,7 +1496,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll( +): ContentMessage = sendQuizPoll( chatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1504,7 +1505,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, isClosed: Boolean = false, quizPoll: QuizPoll, @@ -1521,14 +1522,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendSticker] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, sticker: Sticker, threadId: MessageThreadId? = chatId.threadId, @@ -1539,14 +1540,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendSticker] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, sticker: Sticker, threadId: MessageThreadId? = chat.id.threadId, @@ -1557,7 +1558,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendSticker(chat, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** @@ -1565,7 +1566,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -1580,7 +1581,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLiveLocation( +): ContentMessage = sendLiveLocation( chatId = chatId, latitude = latitude, longitude = longitude, @@ -1602,7 +1603,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, location: Location, livePeriod: Seconds, @@ -1616,7 +1617,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLiveLocation( +): ContentMessage = sendLiveLocation( chatId, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1625,7 +1626,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, latitude: Double, longitude: Double, @@ -1640,7 +1641,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLiveLocation( +): ContentMessage = sendLiveLocation( chat, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1649,7 +1650,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, location: Location, livePeriod: Seconds, @@ -1663,7 +1664,7 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLiveLocation( +): ContentMessage = sendLiveLocation( chat, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -1672,7 +1673,7 @@ suspend fun TelegramBot.send( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, latitude: Double, longitude: Double, @@ -1689,14 +1690,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVenue] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, latitude: Double, longitude: Double, @@ -1713,14 +1714,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVenue] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, location: StaticLocation, title: String, @@ -1736,14 +1737,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVenue] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, location: StaticLocation, title: String, @@ -1759,14 +1760,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVenue] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, venue: Venue, threadId: MessageThreadId? = chatId.threadId, @@ -1776,14 +1777,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, venue, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chatId, venue, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVenue] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, venue: Venue, threadId: MessageThreadId? = chat.id.threadId, @@ -1793,14 +1794,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, venue, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVenue(chat, venue, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideo] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, video: VideoFile, text: String? = null, @@ -1814,14 +1815,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideo(chatId, video, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideo] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, video: VideoFile, text: String? = null, @@ -1835,14 +1836,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat, video, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideo(chat, video, text, parseMode, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideo] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, video: VideoFile, entities: TextSourcesList, @@ -1855,14 +1856,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideo(chatId, video, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideo] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, video: VideoFile, entities: TextSourcesList, @@ -1875,14 +1876,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat, video, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideo(chat, video, entities, showCaptionAboveMedia, spoilered, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideoNote] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, videoNote: VideoNoteFile, threadId: MessageThreadId? = chatId.threadId, @@ -1892,14 +1893,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chatId, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideoNote(chatId, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVideoNote] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, videoNote: VideoNoteFile, threadId: MessageThreadId? = chat.id.threadId, @@ -1909,14 +1910,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideoNote(chat, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVoice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, voice: VoiceFile, text: String? = null, @@ -1928,14 +1929,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chatId, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chatId, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVoice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, voice: VoiceFile, text: String? = null, @@ -1947,14 +1948,14 @@ suspend fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVoice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chatId: ChatIdentifier, voice: VoiceFile, entities: TextSourcesList, @@ -1965,14 +1966,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chatId, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chatId, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * Will execute [sendVoice] request * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.send( +public suspend inline fun TelegramBot.send( chat: Chat, voice: VoiceFile, entities: TextSourcesList, @@ -1983,14 +1984,14 @@ suspend inline fun TelegramBot.send( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @see sendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroup") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -1999,14 +2000,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroup") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2015,14 +2016,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroupByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2031,14 +2032,14 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroupByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2047,13 +2048,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendPlaylist */ @JvmName("sendPlaylist") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2062,13 +2063,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendPlaylist(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendPlaylist */ @JvmName("sendPlaylist") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2077,13 +2078,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendPlaylist(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendPlaylist */ @JvmName("sendPlaylistByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2092,13 +2093,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendPlaylist(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendPlaylist */ @JvmName("sendPlaylistByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2107,13 +2108,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendPlaylist(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendDocumentsGroup */ @JvmName("sendDocuments") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2122,13 +2123,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendDocumentsGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendDocumentsGroup */ @JvmName("sendDocuments") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2137,13 +2138,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendDocumentsGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendDocumentsGroup */ @JvmName("sendDocumentsByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2152,13 +2153,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendDocumentsGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendDocumentsGroup */ @JvmName("sendDocumentsByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2167,13 +2168,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendDocumentsGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendVisualMediaGroup */ @JvmName("sendVisualMediaGroup") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2182,13 +2183,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendVisualMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendVisualMediaGroup */ @JvmName("sendVisualMediaGroup") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2197,13 +2198,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendVisualMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendVisualMediaGroup */ @JvmName("sendVisualMediaGroupByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -2212,13 +2213,13 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendVisualMediaGroup(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) /** * @see sendVisualMediaGroup */ @JvmName("sendVisualMediaGroupByContent") -suspend fun TelegramBot.send( +public suspend fun TelegramBot.send( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -2227,4 +2228,4 @@ suspend fun TelegramBot.send( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) +): ContentMessage> = sendVisualMediaGroup(chat, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SetMessageReactions.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SetMessageReactions.kt index 71bbd18aef..43119949fa 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SetMessageReactions.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SetMessageReactions.kt @@ -10,112 +10,112 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.reactions.Reaction import kotlin.jvm.JvmName -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( chatId: ChatIdentifier, messageId: MessageId, reactions: List = emptyList(), big: Boolean = false -) = execute( +): Boolean = execute( SetMessageReactions(chatId, messageId, reactions, big) ) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( chatId: ChatIdentifier, messageId: MessageId, reaction: Reaction? = null, big: Boolean = false -) = setMessageReactions(chatId, messageId, listOfNotNull(reaction), big) +): Boolean = setMessageReactions(chatId, messageId, listOfNotNull(reaction), big) -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( chat: Chat, messageId: MessageId, reactions: List = emptyList(), big: Boolean = false -) = setMessageReactions(chat.id, messageId, reactions, big) +): Boolean = setMessageReactions(chat.id, messageId, reactions, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( chat: Chat, messageId: MessageId, reaction: Reaction? = null, big: Boolean = false -) = setMessageReaction(chat.id, messageId, reaction, big) +): Boolean = setMessageReaction(chat.id, messageId, reaction, big) -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( meta: Message.MetaInfo, reactions: List = emptyList(), big: Boolean = false -) = setMessageReactions(meta.chatId, meta.messageId, reactions, big) +): Boolean = setMessageReactions(meta.chatId, meta.messageId, reactions, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( meta: Message.MetaInfo, reaction: Reaction? = null, big: Boolean = false -) = setMessageReaction(meta.chatId, meta.messageId, reaction, big) +): Boolean = setMessageReaction(meta.chatId, meta.messageId, reaction, big) -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( message: AccessibleMessage, reactions: List = emptyList(), big: Boolean = false -) = setMessageReactions(message.metaInfo, reactions, big) +): Boolean = setMessageReactions(message.metaInfo, reactions, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( message: AccessibleMessage, reaction: Reaction? = null, big: Boolean = false -) = setMessageReaction(message.metaInfo, reaction, big) +): Boolean = setMessageReaction(message.metaInfo, reaction, big) @JvmName("setMessageReactionsStrings") -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( chatId: ChatIdentifier, messageId: MessageId, emojis: List, big: Boolean = false -) = setMessageReactions(chatId, messageId, emojis.map { Reaction.Emoji(it) }, big) +): Boolean = setMessageReactions(chatId, messageId, emojis.map { Reaction.Emoji(it) }, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( chatId: ChatIdentifier, messageId: MessageId, emoji: String?, big: Boolean = false -) = setMessageReaction(chatId, messageId, emoji ?.let { Reaction.Emoji(it) }, big) +): Boolean = setMessageReaction(chatId, messageId, emoji ?.let { Reaction.Emoji(it) }, big) @JvmName("setMessageReactionsStrings") -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( chat: Chat, messageId: MessageId, emojis: List, big: Boolean = false -) = setMessageReactions(chat, messageId, emojis.map { Reaction.Emoji(it) }, big) +): Boolean = setMessageReactions(chat, messageId, emojis.map { Reaction.Emoji(it) }, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( chat: Chat, messageId: MessageId, emoji: String?, big: Boolean = false -) = setMessageReaction(chat, messageId, emoji ?.let { Reaction.Emoji(it) }, big) +): Boolean = setMessageReaction(chat, messageId, emoji ?.let { Reaction.Emoji(it) }, big) @JvmName("setMessageReactionsStrings") -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( meta: Message.MetaInfo, emojis: List, big: Boolean = false -) = setMessageReactions(meta, emojis.map { Reaction.Emoji(it) }, big) +): Boolean = setMessageReactions(meta, emojis.map { Reaction.Emoji(it) }, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( meta: Message.MetaInfo, emoji: String?, big: Boolean = false -) = setMessageReaction(meta, emoji ?.let { Reaction.Emoji(it) }, big) +): Boolean = setMessageReaction(meta, emoji ?.let { Reaction.Emoji(it) }, big) @JvmName("setMessageReactionsStrings") -suspend fun TelegramBot.setMessageReactions( +public suspend fun TelegramBot.setMessageReactions( message: AccessibleMessage, emojis: List, big: Boolean = false -) = setMessageReactions(message, emojis.map { Reaction.Emoji(it) }, big) +): Boolean = setMessageReactions(message, emojis.map { Reaction.Emoji(it) }, big) -suspend fun TelegramBot.setMessageReaction( +public suspend fun TelegramBot.setMessageReaction( message: AccessibleMessage, emoji: String?, big: Boolean = false -) = setMessageReaction(message, emoji ?.let { Reaction.Emoji(it) }, big) +): Boolean = setMessageReaction(message, emoji ?.let { Reaction.Emoji(it) }, big) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt index f6e1962e45..0038708783 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt @@ -7,12 +7,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.games.Game +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.GameContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendGame( +public suspend fun TelegramBot.sendGame( chatId: ChatIdentifier, gameShortName: String, threadId: MessageThreadId? = chatId.threadId, @@ -22,7 +24,7 @@ suspend fun TelegramBot.sendGame( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendGame( chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -32,7 +34,7 @@ suspend fun TelegramBot.sendGame( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendGame( +public suspend fun TelegramBot.sendGame( chat: Chat, gameShortName: String, threadId: MessageThreadId? = chat.id.threadId, @@ -42,7 +44,7 @@ suspend fun TelegramBot.sendGame( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -50,7 +52,7 @@ suspend fun TelegramBot.sendGame( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendGame( +public suspend fun TelegramBot.sendGame( chatId: ChatIdentifier, game: Game, threadId: MessageThreadId? = chatId.threadId, @@ -60,7 +62,7 @@ suspend fun TelegramBot.sendGame( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -68,7 +70,7 @@ suspend fun TelegramBot.sendGame( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendGame( +public suspend fun TelegramBot.sendGame( chat: Chat, game: Game, threadId: MessageThreadId? = chat.id.threadId, @@ -78,6 +80,6 @@ suspend fun TelegramBot.sendGame( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame( +): ContentMessage = sendGame( chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt index 2baef11f16..db2aae6e16 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.AnimationFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.AnimationContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: InputFile, thumb: InputFile? = null, @@ -33,7 +35,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendAnimation( chatId = chatId, animation = animation, @@ -59,7 +61,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: AnimationFile, text: String? = null, @@ -76,7 +78,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chatId, animation = animation.fileId, thumb = animation.thumbnail ?.fileId, @@ -100,7 +102,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chat: Chat, animation: InputFile, thumb: InputFile? = null, @@ -118,7 +120,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chat.id, animation = animation, thumb = thumb, @@ -142,7 +144,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chat: Chat, animation: AnimationFile, text: String? = null, @@ -159,7 +161,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chat.id, animation = animation, text = text, @@ -183,7 +185,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: InputFile, thumb: InputFile? = null, @@ -200,7 +202,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendAnimation( chatId = chatId, animation = animation, @@ -225,7 +227,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chatId: ChatIdentifier, animation: AnimationFile, entities: TextSourcesList, @@ -241,7 +243,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chatId, animation = animation.fileId, thumb = animation.thumbnail ?.fileId, @@ -264,7 +266,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chat: Chat, animation: InputFile, thumb: InputFile? = null, @@ -281,7 +283,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chat.id, animation = animation, thumb = thumb, @@ -304,7 +306,7 @@ suspend fun TelegramBot.sendAnimation( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAnimation( +public suspend fun TelegramBot.sendAnimation( chat: Chat, animation: AnimationFile, entities: TextSourcesList, @@ -320,7 +322,7 @@ suspend fun TelegramBot.sendAnimation( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation( +): ContentMessage = sendAnimation( chatId = chat.id, animation = animation, entities = entities, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt index 13f6c011de..2da47193ac 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.AudioFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.AudioContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAudio( +public suspend fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: InputFile, thumb: InputFile? = null, @@ -31,7 +33,7 @@ suspend fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendAudio( chatId, audio, @@ -55,7 +57,7 @@ suspend fun TelegramBot.sendAudio( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAudio( +public suspend fun TelegramBot.sendAudio( chat: Chat, audio: InputFile, thumb: InputFile? = null, @@ -71,13 +73,13 @@ suspend fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAudio( +public suspend fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: AudioFile, text: String? = null, @@ -90,13 +92,13 @@ suspend fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendAudio( +public suspend fun TelegramBot.sendAudio( chat: Chat, audio: AudioFile, text: String? = null, @@ -109,14 +111,14 @@ suspend fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendAudio( +public suspend inline fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: InputFile, thumb: InputFile? = null, @@ -131,7 +133,7 @@ suspend inline fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendAudio( chatId, audio, @@ -154,7 +156,7 @@ suspend inline fun TelegramBot.sendAudio( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendAudio( +public suspend inline fun TelegramBot.sendAudio( chat: Chat, audio: InputFile, thumb: InputFile? = null, @@ -169,13 +171,13 @@ suspend inline fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendAudio( +public suspend inline fun TelegramBot.sendAudio( chatId: ChatIdentifier, audio: AudioFile, entities: TextSourcesList, @@ -187,13 +189,13 @@ suspend inline fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendAudio( +public suspend inline fun TelegramBot.sendAudio( chat: Chat, audio: AudioFile, entities: TextSourcesList, @@ -205,4 +207,4 @@ suspend inline fun TelegramBot.sendAudio( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt index f28352b56d..53b8fb0d81 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.DocumentFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.DocumentContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDocument( +public suspend fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: InputFile, thumb: InputFile? = null, @@ -29,7 +31,7 @@ suspend fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = execute( +): ContentMessage = execute( SendDocument( chatId, document, @@ -51,7 +53,7 @@ suspend fun TelegramBot.sendDocument( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDocument( +public suspend fun TelegramBot.sendDocument( chat: Chat, document: InputFile, thumb: InputFile? = null, @@ -65,13 +67,13 @@ suspend fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDocument( +public suspend fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: DocumentFile, text: String? = null, @@ -84,7 +86,7 @@ suspend fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument( +): ContentMessage = sendDocument( chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection ) @@ -92,7 +94,7 @@ suspend fun TelegramBot.sendDocument( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendDocument( +public suspend fun TelegramBot.sendDocument( chat: Chat, document: DocumentFile, text: String? = null, @@ -105,13 +107,13 @@ suspend fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendDocument( +public suspend inline fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: InputFile, thumb: InputFile? = null, @@ -124,7 +126,7 @@ suspend inline fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = execute( +): ContentMessage = execute( SendDocument( chatId, document, @@ -145,7 +147,7 @@ suspend inline fun TelegramBot.sendDocument( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendDocument( +public suspend inline fun TelegramBot.sendDocument( chat: Chat, document: InputFile, thumb: InputFile? = null, @@ -158,13 +160,13 @@ suspend inline fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendDocument( +public suspend inline fun TelegramBot.sendDocument( chatId: ChatIdentifier, document: DocumentFile, entities: TextSourcesList, @@ -176,7 +178,7 @@ suspend inline fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument( +): ContentMessage = sendDocument( chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection ) @@ -184,7 +186,7 @@ suspend inline fun TelegramBot.sendDocument( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendDocument( +public suspend inline fun TelegramBot.sendDocument( chat: Chat, document: DocumentFile, entities: TextSourcesList, @@ -196,4 +198,4 @@ suspend inline fun TelegramBot.sendDocument( replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) +): ContentMessage = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt index cedb2df7d0..891477f16d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt @@ -6,10 +6,8 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.chat.Chat -import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent -import dev.inmo.tgbotapi.types.message.content.AudioContent -import dev.inmo.tgbotapi.types.message.content.DocumentContent +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.utils.RiskFeature import kotlin.jvm.JvmName @@ -17,7 +15,7 @@ import kotlin.jvm.JvmName * @see SendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) -suspend fun TelegramBot.sendMediaGroup( +public suspend fun TelegramBot.sendMediaGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -26,7 +24,7 @@ suspend fun TelegramBot.sendMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = execute( +): ContentMessage> = execute( SendMediaGroup( chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -36,7 +34,7 @@ suspend fun TelegramBot.sendMediaGroup( * @see SendMediaGroup */ @RiskFeature(rawSendingMediaGroupsWarning) -suspend fun TelegramBot.sendMediaGroup( +public suspend fun TelegramBot.sendMediaGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -45,7 +43,7 @@ suspend fun TelegramBot.sendMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup( +): ContentMessage> = sendMediaGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -54,7 +52,7 @@ suspend fun TelegramBot.sendMediaGroup( */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroupByContent") -suspend fun TelegramBot.sendMediaGroup( +public suspend fun TelegramBot.sendMediaGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -63,7 +61,7 @@ suspend fun TelegramBot.sendMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup( +): ContentMessage> = sendMediaGroup( chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -72,7 +70,7 @@ suspend fun TelegramBot.sendMediaGroup( */ @RiskFeature(rawSendingMediaGroupsWarning) @JvmName("sendMedaGroupByContent") -suspend fun TelegramBot.sendMediaGroup( +public suspend fun TelegramBot.sendMediaGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -81,14 +79,14 @@ suspend fun TelegramBot.sendMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendMediaGroup( +): ContentMessage> = sendMediaGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) /** * @see SendPlaylist */ -suspend fun TelegramBot.sendPlaylist( +public suspend fun TelegramBot.sendPlaylist( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -97,7 +95,7 @@ suspend fun TelegramBot.sendPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = execute( +): ContentMessage> = execute( SendPlaylist( chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -106,7 +104,7 @@ suspend fun TelegramBot.sendPlaylist( /** * @see SendPlaylist */ -suspend fun TelegramBot.sendPlaylist( +public suspend fun TelegramBot.sendPlaylist( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -115,7 +113,7 @@ suspend fun TelegramBot.sendPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist( +): ContentMessage> = sendPlaylist( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -123,7 +121,7 @@ suspend fun TelegramBot.sendPlaylist( * @see SendPlaylist */ @JvmName("sendPlaylistByContent") -suspend fun TelegramBot.sendPlaylist( +public suspend fun TelegramBot.sendPlaylist( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -132,7 +130,7 @@ suspend fun TelegramBot.sendPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist( +): ContentMessage> = sendPlaylist( chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -140,7 +138,7 @@ suspend fun TelegramBot.sendPlaylist( * @see SendPlaylist */ @JvmName("sendPlaylistByContent") -suspend fun TelegramBot.sendPlaylist( +public suspend fun TelegramBot.sendPlaylist( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -149,14 +147,14 @@ suspend fun TelegramBot.sendPlaylist( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendPlaylist( +): ContentMessage> = sendPlaylist( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) /** * @see SendDocumentsGroup */ -suspend fun TelegramBot.sendDocumentsGroup( +public suspend fun TelegramBot.sendDocumentsGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -165,7 +163,7 @@ suspend fun TelegramBot.sendDocumentsGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = execute( +): ContentMessage> = execute( SendDocumentsGroup( chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -174,7 +172,7 @@ suspend fun TelegramBot.sendDocumentsGroup( /** * @see SendDocumentsGroup */ -suspend fun TelegramBot.sendDocumentsGroup( +public suspend fun TelegramBot.sendDocumentsGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -183,7 +181,7 @@ suspend fun TelegramBot.sendDocumentsGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup( +): ContentMessage> = sendDocumentsGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -191,7 +189,7 @@ suspend fun TelegramBot.sendDocumentsGroup( * @see SendDocumentsGroup */ @JvmName("sendDocumentsByContent") -suspend fun TelegramBot.sendDocumentsGroup( +public suspend fun TelegramBot.sendDocumentsGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -200,7 +198,7 @@ suspend fun TelegramBot.sendDocumentsGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup( +): ContentMessage> = sendDocumentsGroup( chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -208,7 +206,7 @@ suspend fun TelegramBot.sendDocumentsGroup( * @see SendDocumentsGroup */ @JvmName("sendDocumentsByContent") -suspend fun TelegramBot.sendDocumentsGroup( +public suspend fun TelegramBot.sendDocumentsGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -217,14 +215,14 @@ suspend fun TelegramBot.sendDocumentsGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendDocumentsGroup( +): ContentMessage> = sendDocumentsGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) /** * @see SendVisualMediaGroup */ -suspend fun TelegramBot.sendVisualMediaGroup( +public suspend fun TelegramBot.sendVisualMediaGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -233,7 +231,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = execute( +): ContentMessage> = execute( SendVisualMediaGroup( chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -242,7 +240,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( /** * @see SendVisualMediaGroup */ -suspend fun TelegramBot.sendVisualMediaGroup( +public suspend fun TelegramBot.sendVisualMediaGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -251,7 +249,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup( +): ContentMessage> = sendVisualMediaGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -259,7 +257,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( * @see SendVisualMediaGroup */ @JvmName("sendVisualMediaGroupByContent") -suspend fun TelegramBot.sendVisualMediaGroup( +public suspend fun TelegramBot.sendVisualMediaGroup( chatId: ChatIdentifier, media: List, threadId: MessageThreadId? = chatId.threadId, @@ -268,7 +266,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup( +): ContentMessage> = sendVisualMediaGroup( chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) @@ -276,7 +274,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( * @see SendVisualMediaGroup */ @JvmName("sendVisualMediaGroupByContent") -suspend fun TelegramBot.sendVisualMediaGroup( +public suspend fun TelegramBot.sendVisualMediaGroup( chat: Chat, media: List, threadId: MessageThreadId? = chat.id.threadId, @@ -285,6 +283,6 @@ suspend fun TelegramBot.sendVisualMediaGroup( protectContent: Boolean = false, effectId: EffectId? = null, replyParameters: ReplyParameters? = null -) = sendVisualMediaGroup( +): ContentMessage> = sendVisualMediaGroup( chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPaidMedia.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPaidMedia.kt index 87904da651..432a27bad9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPaidMedia.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPaidMedia.kt @@ -9,12 +9,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.media.TelegramPaidMedia +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPaidMedia( +public suspend fun TelegramBot.sendPaidMedia( chatId: ChatIdentifier, starCount: Int, media: List, @@ -27,7 +29,7 @@ suspend fun TelegramBot.sendPaidMedia( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendPaidMedia( chatId = chatId, starCount = starCount, @@ -48,7 +50,7 @@ suspend fun TelegramBot.sendPaidMedia( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPaidMedia( +public suspend fun TelegramBot.sendPaidMedia( chat: Chat, starCount: Int, media: List, @@ -61,7 +63,7 @@ suspend fun TelegramBot.sendPaidMedia( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia( +): ContentMessage = sendPaidMedia( chatId = chat.id, starCount = starCount, media = media, @@ -81,7 +83,7 @@ suspend fun TelegramBot.sendPaidMedia( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPaidMedia( +public suspend inline fun TelegramBot.sendPaidMedia( chatId: ChatIdentifier, starCount: Int, media: List, @@ -93,7 +95,7 @@ suspend inline fun TelegramBot.sendPaidMedia( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendPaidMedia( chatId = chatId, starCount = starCount, @@ -113,7 +115,7 @@ suspend inline fun TelegramBot.sendPaidMedia( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPaidMedia( +public suspend inline fun TelegramBot.sendPaidMedia( chat: Chat, starCount: Int, media: List, @@ -125,7 +127,7 @@ suspend inline fun TelegramBot.sendPaidMedia( protectContent: Boolean = false, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPaidMedia( +): ContentMessage = sendPaidMedia( chatId = chat.id, starCount = starCount, media = media, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt index b86be33f9e..772312f26a 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.* +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.PhotoContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, fileId: InputFile, text: String? = null, @@ -29,7 +31,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendPhoto( chatId = chatId, photo = fileId, @@ -51,7 +53,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chat: Chat, fileId: InputFile, text: String? = null, @@ -65,7 +67,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, fileId = fileId, text = text, @@ -85,7 +87,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, photo: PhotoFile, text: String? = null, @@ -99,7 +101,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chatId, fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text = text, @@ -119,7 +121,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chat: Chat, photo: PhotoFile, text: String? = null, @@ -133,7 +135,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, photo = photo, text = text, @@ -153,7 +155,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chatId: ChatIdentifier, photoSize: PhotoSize, text: String? = null, @@ -167,7 +169,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chatId, fileId = photoSize.fileId, text = text, @@ -187,7 +189,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendPhoto( +public suspend fun TelegramBot.sendPhoto( chat: Chat, photoSize: PhotoSize, text: String? = null, @@ -201,7 +203,7 @@ suspend fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, photoSize = photoSize, text = text, @@ -222,7 +224,7 @@ suspend fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chatId: ChatIdentifier, fileId: InputFile, entities: TextSourcesList, @@ -235,7 +237,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendPhoto( chatId = chatId, photo = fileId, @@ -256,7 +258,7 @@ suspend inline fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chat: Chat, fileId: InputFile, entities: TextSourcesList, @@ -269,7 +271,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, fileId = fileId, entities = entities, @@ -288,7 +290,7 @@ suspend inline fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chatId: ChatIdentifier, photo: PhotoFile, entities: TextSourcesList, @@ -301,7 +303,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chatId, fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities = entities, @@ -320,7 +322,7 @@ suspend inline fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chat: Chat, photo: PhotoFile, entities: TextSourcesList, @@ -333,7 +335,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, photo = photo, entities = entities, @@ -352,7 +354,7 @@ suspend inline fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chatId: ChatIdentifier, photoSize: PhotoSize, entities: TextSourcesList, @@ -365,7 +367,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chatId, fileId = photoSize.fileId, entities = entities, @@ -384,7 +386,7 @@ suspend inline fun TelegramBot.sendPhoto( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendPhoto( +public suspend inline fun TelegramBot.sendPhoto( chat: Chat, photoSize: PhotoSize, entities: TextSourcesList, @@ -397,7 +399,7 @@ suspend inline fun TelegramBot.sendPhoto( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto( +): ContentMessage = sendPhoto( chatId = chat.id, photoSize = photoSize, entities = entities, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt index 2b6ca92d95..0f89488f84 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt @@ -8,12 +8,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.Sticker +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.StickerContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendSticker( +public suspend fun TelegramBot.sendSticker( chatId: ChatIdentifier, sticker: InputFile, threadId: MessageThreadId? = chatId.threadId, @@ -24,7 +26,7 @@ suspend fun TelegramBot.sendSticker( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) ) @@ -32,7 +34,7 @@ suspend fun TelegramBot.sendSticker( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendSticker( +public suspend fun TelegramBot.sendSticker( chat: Chat, sticker: InputFile, threadId: MessageThreadId? = chat.id.threadId, @@ -43,13 +45,13 @@ suspend fun TelegramBot.sendSticker( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendSticker( +public suspend fun TelegramBot.sendSticker( chatId: ChatIdentifier, sticker: Sticker, threadId: MessageThreadId? = chatId.threadId, @@ -60,13 +62,13 @@ suspend fun TelegramBot.sendSticker( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendSticker( +public suspend fun TelegramBot.sendSticker( chat: Chat, sticker: Sticker, threadId: MessageThreadId? = chat.id.threadId, @@ -77,4 +79,4 @@ suspend fun TelegramBot.sendSticker( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt index f641816260..75a439e1d3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VideoFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.VideoContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideo( +public suspend fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: InputFile, thumb: InputFile? = null, @@ -33,7 +35,7 @@ suspend fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVideo( chatId = chatId, video = video, @@ -60,7 +62,7 @@ suspend fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideo( +public suspend fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: VideoFile, text: String? = null, @@ -74,7 +76,7 @@ suspend fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chatId, video = video.fileId, thumb = video.thumbnail ?.fileId, @@ -98,7 +100,7 @@ suspend fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideo( +public suspend fun TelegramBot.sendVideo( chat: Chat, video: InputFile, thumb: InputFile? = null, @@ -116,7 +118,7 @@ suspend fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chat.id, video = video, thumb = thumb, @@ -141,7 +143,7 @@ suspend fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideo( +public suspend fun TelegramBot.sendVideo( chat: Chat, video: VideoFile, text: String? = null, @@ -155,7 +157,7 @@ suspend fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chat.id, video = video, text = text, @@ -175,7 +177,7 @@ suspend fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVideo( +public suspend inline fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: InputFile, thumb: InputFile? = null, @@ -192,7 +194,7 @@ suspend inline fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVideo( chatId = chatId, video = video, @@ -218,7 +220,7 @@ suspend inline fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVideo( +public suspend inline fun TelegramBot.sendVideo( chatId: ChatIdentifier, video: VideoFile, entities: TextSourcesList, @@ -231,7 +233,7 @@ suspend inline fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chatId, video = video.fileId, thumb = video.thumbnail ?.fileId, @@ -254,7 +256,7 @@ suspend inline fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVideo( +public suspend inline fun TelegramBot.sendVideo( chat: Chat, video: InputFile, thumb: InputFile? = null, @@ -271,7 +273,7 @@ suspend inline fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chat.id, video = video, thumb = thumb, @@ -295,7 +297,7 @@ suspend inline fun TelegramBot.sendVideo( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVideo( +public suspend inline fun TelegramBot.sendVideo( chat: Chat, video: VideoFile, entities: TextSourcesList, @@ -308,7 +310,7 @@ suspend inline fun TelegramBot.sendVideo( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo( +): ContentMessage = sendVideo( chatId = chat.id, video = video, entities = entities, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt index 1c0277235c..9416811896 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt @@ -8,12 +8,14 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VideoNoteFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.VideoNoteContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideoNote( +public suspend fun TelegramBot.sendVideoNote( chatId: ChatIdentifier, videoNote: InputFile, thumb: InputFile? = null, @@ -26,7 +28,7 @@ suspend fun TelegramBot.sendVideoNote( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVideoNote( chatId, videoNote, @@ -47,7 +49,7 @@ suspend fun TelegramBot.sendVideoNote( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideoNote( +public suspend fun TelegramBot.sendVideoNote( chatId: ChatIdentifier, videoNote: VideoNoteFile, threadId: MessageThreadId? = chatId.threadId, @@ -57,7 +59,7 @@ suspend fun TelegramBot.sendVideoNote( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote( +): ContentMessage = sendVideoNote( chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -65,7 +67,7 @@ suspend fun TelegramBot.sendVideoNote( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideoNote( +public suspend fun TelegramBot.sendVideoNote( chat: Chat, videoNote: InputFile, thumb: InputFile? = null, @@ -78,13 +80,13 @@ suspend fun TelegramBot.sendVideoNote( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVideoNote( +public suspend fun TelegramBot.sendVideoNote( chat: Chat, videoNote: VideoNoteFile, threadId: MessageThreadId? = chat.id.threadId, @@ -94,4 +96,4 @@ suspend fun TelegramBot.sendVideoNote( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt index 8f708377c6..9a3dfa8674 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt @@ -10,12 +10,14 @@ import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VoiceFile +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.VoiceContent /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVoice( +public suspend fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: InputFile, text: String? = null, @@ -28,7 +30,7 @@ suspend fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVoice( chatId, voice, @@ -49,7 +51,7 @@ suspend fun TelegramBot.sendVoice( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVoice( +public suspend fun TelegramBot.sendVoice( chat: Chat, voice: InputFile, text: String? = null, @@ -62,13 +64,13 @@ suspend fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVoice( +public suspend fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: VoiceFile, text: String? = null, @@ -80,7 +82,7 @@ suspend fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice( +): ContentMessage = sendVoice( chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) @@ -88,7 +90,7 @@ suspend fun TelegramBot.sendVoice( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend fun TelegramBot.sendVoice( +public suspend fun TelegramBot.sendVoice( chat: Chat, voice: VoiceFile, text: String? = null, @@ -100,14 +102,14 @@ suspend fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVoice( +public suspend inline fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: InputFile, entities: TextSourcesList, @@ -119,7 +121,7 @@ suspend inline fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendVoice( chatId = chatId, voice = voice, @@ -139,7 +141,7 @@ suspend inline fun TelegramBot.sendVoice( * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVoice( +public suspend inline fun TelegramBot.sendVoice( chat: Chat, voice: InputFile, entities: TextSourcesList, @@ -151,13 +153,13 @@ suspend inline fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVoice( +public suspend inline fun TelegramBot.sendVoice( chatId: ChatIdentifier, voice: VoiceFile, entities: TextSourcesList, @@ -168,14 +170,14 @@ suspend inline fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice( +): ContentMessage = sendVoice( chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup ) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param */ -suspend inline fun TelegramBot.sendVoice( +public suspend inline fun TelegramBot.sendVoice( chat: Chat, voice: VoiceFile, entities: TextSourcesList, @@ -186,4 +188,4 @@ suspend inline fun TelegramBot.sendVoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/CreateInvoiceLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/CreateInvoiceLink.kt index 27b8d1d08c..2430043d91 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/CreateInvoiceLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/CreateInvoiceLink.kt @@ -2,15 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send.payments import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -import dev.inmo.tgbotapi.requests.send.payments.SendInvoice -import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup -import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.payments.LabeledPrice import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.payments.abstracts.XTR -suspend fun TelegramBot.createInvoiceLink( +public suspend fun TelegramBot.createInvoiceLink( title: String, description: String, payload: String, @@ -27,14 +23,14 @@ suspend fun TelegramBot.createInvoiceLink( shouldSendPhoneNumberToProvider: Boolean = false, shouldSendEmailToProvider: Boolean = false, priceDependOnShipAddress: Boolean = false -) = execute( +): String = execute( CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress) ) /** * For links witn XTR currency and using of Telegram Stars */ -suspend fun TelegramBot.createInvoiceLink( +public suspend fun TelegramBot.createInvoiceLink( title: String, description: String, payload: String, @@ -49,6 +45,6 @@ suspend fun TelegramBot.createInvoiceLink( shouldSendPhoneNumberToProvider: Boolean = false, shouldSendEmailToProvider: Boolean = false, priceDependOnShipAddress: Boolean = false -) = execute( +): String = execute( CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress) ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/RefundStarPayment.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/RefundStarPayment.kt index 89cc9e48bc..8d2ff8c6c8 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/RefundStarPayment.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/RefundStarPayment.kt @@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.payments.SuccessfulPayment import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId -suspend fun TelegramBot.refundStarPayment( +public suspend fun TelegramBot.refundStarPayment( userId: UserId, telegramPaymentChargeId: TelegramPaymentChargeId -) = execute(RefundStarPayment(userId, telegramPaymentChargeId)) +): Boolean = execute(RefundStarPayment(userId, telegramPaymentChargeId)) -suspend fun TelegramBot.refundStarPayment( +public suspend fun TelegramBot.refundStarPayment( userId: UserId, successfulPayment: SuccessfulPayment -) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId) \ No newline at end of file +): Boolean = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId) \ No newline at end of file diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt index aea0885b1e..681ae2bfe2 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt @@ -5,6 +5,8 @@ import dev.inmo.tgbotapi.requests.send.payments.SendInvoice import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.InvoiceContent import dev.inmo.tgbotapi.types.payments.LabeledPrice import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.payments.abstracts.XTR @@ -13,7 +15,7 @@ import dev.inmo.tgbotapi.types.payments.abstracts.XTR * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendInvoice( +public suspend fun TelegramBot.sendInvoice( chatId: IdChatIdentifier, title: String, description: String, @@ -38,7 +40,7 @@ suspend fun TelegramBot.sendInvoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) ) @@ -46,7 +48,7 @@ suspend fun TelegramBot.sendInvoice( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendInvoice( +public suspend fun TelegramBot.sendInvoice( user: CommonUser, title: String, description: String, @@ -70,14 +72,14 @@ suspend fun TelegramBot.sendInvoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup) +): ContentMessage = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendInvoice( +public suspend fun TelegramBot.sendInvoice( chatId: IdChatIdentifier, title: String, description: String, @@ -91,7 +93,7 @@ suspend fun TelegramBot.sendInvoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendInvoice(chatId, title, description, payload, price, startParameter, providerData, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup) ) @@ -99,7 +101,7 @@ suspend fun TelegramBot.sendInvoice( * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] * as a builder for that */ -suspend fun TelegramBot.sendInvoice( +public suspend fun TelegramBot.sendInvoice( user: CommonUser, title: String, description: String, @@ -112,7 +114,7 @@ suspend fun TelegramBot.sendInvoice( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice( +): ContentMessage = sendInvoice( chatId = user.id, title = title, description = description, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendQuizPoll.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendQuizPoll.kt index 6a2eea164f..5bebb27e0d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendQuizPoll.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendQuizPoll.kt @@ -6,12 +6,14 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.ParseMode +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.PollContent import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.polls.InputPollOption import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, question: String, options: List, @@ -30,7 +32,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, question, @@ -53,7 +55,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -71,7 +73,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, questionEntities, @@ -93,7 +95,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, question: String, options: List, @@ -111,7 +113,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, question, @@ -134,7 +136,7 @@ suspend fun TelegramBot.sendQuizPoll( ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -151,7 +153,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, questionEntities, @@ -172,7 +174,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, question: String, options: List, @@ -190,7 +192,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, question, @@ -212,7 +214,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -229,7 +231,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, questionEntities, @@ -250,7 +252,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, question: String, options: List, @@ -267,7 +269,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, question, @@ -288,7 +290,7 @@ suspend fun TelegramBot.sendQuizPoll( ) ) -suspend fun TelegramBot.sendQuizPoll( +public suspend fun TelegramBot.sendQuizPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -304,7 +306,7 @@ suspend fun TelegramBot.sendQuizPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendQuizPoll( chatId, questionEntities, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendRegularPoll.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendRegularPoll.kt index a9dfe324dc..fd5a32d7ab 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendRegularPoll.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendRegularPoll.kt @@ -6,12 +6,14 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.ParseMode +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.PollContent import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.polls.InputPollOption import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo -suspend fun TelegramBot.sendRegularPoll( +public suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, question: String, options: List, @@ -28,7 +30,7 @@ suspend fun TelegramBot.sendRegularPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendRegularPoll( chatId, question, @@ -49,7 +51,7 @@ suspend fun TelegramBot.sendRegularPoll( ) ) -suspend fun TelegramBot.sendRegularPoll( +public suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -65,7 +67,7 @@ suspend fun TelegramBot.sendRegularPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendRegularPoll( chatId, questionEntities, @@ -85,7 +87,7 @@ suspend fun TelegramBot.sendRegularPoll( ) ) -suspend fun TelegramBot.sendRegularPoll( +public suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, question: String, options: List, @@ -101,7 +103,7 @@ suspend fun TelegramBot.sendRegularPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendRegularPoll( chatId, question, @@ -121,7 +123,7 @@ suspend fun TelegramBot.sendRegularPoll( ) ) -suspend fun TelegramBot.sendRegularPoll( +public suspend fun TelegramBot.sendRegularPoll( chatId: ChatIdentifier, questionEntities: List, options: List, @@ -136,7 +138,7 @@ suspend fun TelegramBot.sendRegularPoll( effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = execute( +): ContentMessage = execute( SendRegularPoll( chatId, questionEntities, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt index 566d4a3e57..d57f073a2f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt @@ -12,38 +12,38 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.stickers.MaskPosition import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSetName: StickerSetName, inputSticker: InputSticker -) = execute( +): Boolean = execute( AddStickerToSet(userId, stickerSetName, inputSticker) ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSetName: String, inputSticker: InputSticker -) = addStickerToSet(userId, StickerSetName(stickerSetName), inputSticker) +): Boolean = addStickerToSet(userId, StickerSetName(stickerSetName), inputSticker) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: InputSticker -) = addStickerToSet( +): Boolean = addStickerToSet( userId, stickerSet.name, sticker ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: InputFile, format: StickerFormat, emojis: List, keywords: List = emptyList() -) = addStickerToSet( +): Boolean = addStickerToSet( userId, stickerSet, when (stickerSet.stickerType) { @@ -68,14 +68,14 @@ suspend fun TelegramBot.addStickerToSet( } ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSet: StickerSet, sticker: InputFile, format: StickerFormat, emojis: List, maskPosition: MaskPosition? = null -) = addStickerToSet( +): Boolean = addStickerToSet( userId, stickerSet.name, when (stickerSet.stickerType) { @@ -101,34 +101,34 @@ suspend fun TelegramBot.addStickerToSet( } ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: InputSticker -) = addStickerToSet( +): Boolean = addStickerToSet( user.id, stickerSet.name, sticker ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: InputFile, format: StickerFormat, emojis: List, keywords: List = emptyList() -) = addStickerToSet( +): Boolean = addStickerToSet( user.id, stickerSet, sticker, format, emojis, keywords ) -suspend fun TelegramBot.addStickerToSet( +public suspend fun TelegramBot.addStickerToSet( user: CommonUser, stickerSet: StickerSet, sticker: InputFile, format: StickerFormat, emojis: List, maskPosition: MaskPosition? = null -) = addStickerToSet( +): Boolean = addStickerToSet( user.id, stickerSet, sticker, format, emojis, maskPosition ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/CreateNewStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/CreateNewStickerSet.kt index fa9099e30b..4784fbceb3 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/CreateNewStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/CreateNewStickerSet.kt @@ -7,23 +7,23 @@ import dev.inmo.tgbotapi.types.StickerFormat import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.UserId -suspend fun TelegramBot.createNewStickerSet( +public suspend fun TelegramBot.createNewStickerSet( userId: UserId, name: String, title: String, stickers: List, needsRepainting: Boolean = false -) = execute( +): Boolean = execute( CreateNewStickerSet(userId, name, title, stickers, needsRepainting) ) -suspend fun TelegramBot.createNewStickerSet( +public suspend fun TelegramBot.createNewStickerSet( user: CommonUser, name: String, title: String, stickers: List, needsRepainting: Boolean = false, -) = createNewStickerSet( +): Boolean = createNewStickerSet( user.id, name, title, stickers, needsRepainting ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerFromSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerFromSet.kt index 29be658518..4259a4488e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerFromSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerFromSet.kt @@ -5,16 +5,16 @@ import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.requests.stickers.DeleteStickerFromSet import dev.inmo.tgbotapi.types.files.Sticker -suspend fun TelegramBot.deleteStickerFromSet( +public suspend fun TelegramBot.deleteStickerFromSet( sticker: FileId -) = execute( +): Boolean = execute( DeleteStickerFromSet( sticker ) ) -suspend fun TelegramBot.deleteStickerFromSet( +public suspend fun TelegramBot.deleteStickerFromSet( sticker: Sticker -) = deleteStickerFromSet( +): Boolean = deleteStickerFromSet( sticker.fileId ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerSet.kt index bae7665e09..77a7ecd67d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerSet.kt @@ -8,18 +8,18 @@ import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.deleteStickerSet( +public suspend fun TelegramBot.deleteStickerSet( name: StickerSetName -) = execute( +): Boolean = execute( DeleteStickerSet(name) ) -suspend fun TelegramBot.deleteStickerSet( +public suspend fun TelegramBot.deleteStickerSet( sticker: Sticker -) = deleteStickerSet( +): Boolean = deleteStickerSet( sticker.stickerSetName ?: error("Unable to take name of sticker set from sticker $sticker") ) -suspend fun TelegramBot.deleteStickerSet( +public suspend fun TelegramBot.deleteStickerSet( stickerSet: StickerSet, -) = deleteStickerSet(stickerSet.name) +): Boolean = deleteStickerSet(stickerSet.name) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/ReplaceStickerInSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/ReplaceStickerInSet.kt index 376446dce4..eea1790d53 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/ReplaceStickerInSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/ReplaceStickerInSet.kt @@ -14,35 +14,35 @@ import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.stickers.MaskPosition import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( userId: UserId, stickerSetName: StickerSetName, oldSticker: FileId, newSticker: InputSticker -) = execute( +): Boolean = execute( ReplaceStickerInSet(userId, stickerSetName, oldSticker, newSticker) ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( userId: UserId, stickerSetName: String, oldSticker: FileId, newSticker: InputSticker -) = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker) +): Boolean = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( userId: UserId, stickerSet: StickerSet, oldSticker: FileId, newSticker: InputSticker -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( userId, stickerSet.name, oldSticker, newSticker ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( userId: UserId, stickerSet: StickerSet, oldSticker: FileId, @@ -50,7 +50,7 @@ suspend fun TelegramBot.replaceStickerInSet( format: StickerFormat, emojis: List, keywords: List = emptyList() -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( userId, stickerSet, oldSticker, @@ -76,7 +76,7 @@ suspend fun TelegramBot.replaceStickerInSet( } ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( userId: UserId, stickerSet: StickerSet, oldSticker: FileId, @@ -84,7 +84,7 @@ suspend fun TelegramBot.replaceStickerInSet( format: StickerFormat, emojis: List, maskPosition: MaskPosition? = null -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( userId, stickerSet.name, oldSticker, @@ -111,19 +111,19 @@ suspend fun TelegramBot.replaceStickerInSet( } ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( user: CommonUser, stickerSet: StickerSet, oldSticker: FileId, newSticker: InputSticker -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( user.id, stickerSet.name, oldSticker, newSticker ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( user: CommonUser, stickerSet: StickerSet, oldSticker: FileId, @@ -131,11 +131,11 @@ suspend fun TelegramBot.replaceStickerInSet( format: StickerFormat, emojis: List, keywords: List = emptyList() -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( user.id, stickerSet, oldSticker, sticker, format, emojis, keywords ) -suspend fun TelegramBot.replaceStickerInSet( +public suspend fun TelegramBot.replaceStickerInSet( user: CommonUser, stickerSet: StickerSet, oldSticker: FileId, @@ -143,6 +143,6 @@ suspend fun TelegramBot.replaceStickerInSet( format: StickerFormat, emojis: List, maskPosition: MaskPosition? = null -) = replaceStickerInSet( +): Boolean = replaceStickerInSet( user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetCustomEmojiStickerSetThumb.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetCustomEmojiStickerSetThumb.kt index b75abd9786..b099390a62 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetCustomEmojiStickerSetThumb.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetCustomEmojiStickerSetThumb.kt @@ -11,16 +11,16 @@ import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.setCustomEmojiStickerSetThumbnail( +public suspend fun TelegramBot.setCustomEmojiStickerSetThumbnail( stickerSetName: StickerSetName, customEmojiId: CustomEmojiId -) = execute( +): Boolean = execute( SetCustomEmojiStickerSetThumbnail(stickerSetName, customEmojiId) ) -suspend fun TelegramBot.setCustomEmojiStickerSetThumbnail( +public suspend fun TelegramBot.setCustomEmojiStickerSetThumbnail( stickerSet: StickerSet, customEmojiId: CustomEmojiId -) = setCustomEmojiStickerSetThumbnail( +): Boolean = setCustomEmojiStickerSetThumbnail( stickerSet.name, customEmojiId ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerEmojiList.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerEmojiList.kt index b8b1a45f5c..f6c49f68a1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerEmojiList.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerEmojiList.kt @@ -6,20 +6,20 @@ import dev.inmo.tgbotapi.requests.stickers.SetStickerEmojiList import dev.inmo.tgbotapi.requests.stickers.SetStickerPositionInSet import dev.inmo.tgbotapi.types.files.Sticker -suspend fun TelegramBot.setStickerEmojiList( +public suspend fun TelegramBot.setStickerEmojiList( sticker: FileId, emojis: List -) = execute( +): Boolean = execute( SetStickerEmojiList( sticker, emojis ) ) -suspend fun TelegramBot.setStickerEmojiList( +public suspend fun TelegramBot.setStickerEmojiList( sticker: Sticker, vararg emojis: String -) = setStickerEmojiList( +): Boolean = setStickerEmojiList( sticker.fileId, emojis.toList() ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerKeywords.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerKeywords.kt index 2653455511..7764dac237 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerKeywords.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerKeywords.kt @@ -7,20 +7,20 @@ import dev.inmo.tgbotapi.requests.stickers.SetStickerKeywords import dev.inmo.tgbotapi.requests.stickers.SetStickerPositionInSet import dev.inmo.tgbotapi.types.files.Sticker -suspend fun TelegramBot.setStickerKeywords( +public suspend fun TelegramBot.setStickerKeywords( sticker: FileId, keywords: List -) = execute( +): Boolean = execute( SetStickerKeywords( sticker, keywords ) ) -suspend fun TelegramBot.setStickerKeywords( +public suspend fun TelegramBot.setStickerKeywords( sticker: Sticker, vararg keywords: String -) = setStickerKeywords( +): Boolean = setStickerKeywords( sticker.fileId, keywords.toList() ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerMaskPosition.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerMaskPosition.kt index 7d05db2349..b14ea832a9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerMaskPosition.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerMaskPosition.kt @@ -8,10 +8,10 @@ import dev.inmo.tgbotapi.requests.stickers.SetStickerPositionInSet import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.stickers.MaskPosition -suspend fun TelegramBot.setStickerMaskPosition( +public suspend fun TelegramBot.setStickerMaskPosition( sticker: FileId, maskPosition: MaskPosition -) = execute( +): Boolean = execute( SetStickerMaskPosition( sticker, maskPosition diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerPositionInSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerPositionInSet.kt index affe3f2056..d12de74958 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerPositionInSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerPositionInSet.kt @@ -5,20 +5,20 @@ import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.requests.stickers.SetStickerPositionInSet import dev.inmo.tgbotapi.types.files.Sticker -suspend fun TelegramBot.setStickerPositionInSet( +public suspend fun TelegramBot.setStickerPositionInSet( sticker: FileId, position: Int -) = execute( +): Boolean = execute( SetStickerPositionInSet( sticker, position ) ) -suspend fun TelegramBot.setStickerPositionInSet( +public suspend fun TelegramBot.setStickerPositionInSet( sticker: Sticker, position: Int -) = setStickerPositionInSet( +): Boolean = setStickerPositionInSet( sticker.fileId, position ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumbnail.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumbnail.kt index 492533e890..4b1178681d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumbnail.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumbnail.kt @@ -10,74 +10,74 @@ import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( userId: UserId, stickerSetName: StickerSetName, format: StickerFormat, thumbnail: FileId -) = execute( +): Boolean = execute( SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail) ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( userId: UserId, stickerSetName: StickerSetName, format: StickerFormat, thumbnail: MultipartFile -) = execute( +): Boolean = execute( SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail) ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( user: CommonUser, stickerSetName: StickerSetName, format: StickerFormat, thumbnail: FileId -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( user.id, stickerSetName, format, thumbnail ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( user: CommonUser, stickerSetName: StickerSetName, format: StickerFormat, thumbnail: MultipartFile -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( user.id, stickerSetName, format, thumbnail ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( userId: UserId, stickerSet: StickerSet, format: StickerFormat, thumbnail: FileId -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( userId, stickerSet.name, format, thumbnail ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( userId: UserId, stickerSet: StickerSet, format: StickerFormat, thumbnail: MultipartFile -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( userId, stickerSet.name, format, thumbnail ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( user: CommonUser, stickerSet: StickerSet, format: StickerFormat, thumbnail: FileId -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( user.id, stickerSet, format, thumbnail ) -suspend fun TelegramBot.setStickerSetThumbnail( +public suspend fun TelegramBot.setStickerSetThumbnail( user: CommonUser, stickerSet: StickerSet, format: StickerFormat, thumbnail: MultipartFile -) = setStickerSetThumbnail( +): Boolean = setStickerSetThumbnail( user.id, stickerSet, format, thumbnail ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetTitle.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetTitle.kt index dea01e2f61..7596891a50 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetTitle.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetTitle.kt @@ -6,17 +6,17 @@ import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.stickers.StickerSet -suspend fun TelegramBot.setStickerSetTitle( +public suspend fun TelegramBot.setStickerSetTitle( name: StickerSetName, title: String -) = execute(SetStickerSetTitle(name, title)) +): Boolean = execute(SetStickerSetTitle(name, title)) -suspend fun TelegramBot.setStickerSetTitle( +public suspend fun TelegramBot.setStickerSetTitle( sticker: Sticker, title: String -) = setStickerSetTitle(sticker.stickerSetName ?: error("Unable to take name of sticker set from sticker $sticker"), title) +): Boolean = setStickerSetTitle(sticker.stickerSetName ?: error("Unable to take name of sticker set from sticker $sticker"), title) -suspend fun TelegramBot.setStickerSetTitle( +public suspend fun TelegramBot.setStickerSetTitle( stickerSet: StickerSet, title: String -) = setStickerSetTitle(stickerSet.name, title) +): Boolean = setStickerSetTitle(stickerSet.name, title) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/UploadStickerFile.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/UploadStickerFile.kt index 64cce2e2a4..99d38425a7 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/UploadStickerFile.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/UploadStickerFile.kt @@ -6,19 +6,20 @@ import dev.inmo.tgbotapi.requests.stickers.UploadStickerFile import dev.inmo.tgbotapi.types.StickerFormat import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.UserId +import dev.inmo.tgbotapi.types.files.File -suspend fun TelegramBot.uploadStickerFile( +public suspend fun TelegramBot.uploadStickerFile( userId: UserId, sticker: MultipartFile, stickerFormat: StickerFormat -) = execute( +): File = execute( UploadStickerFile(userId, sticker, stickerFormat) ) -suspend fun TelegramBot.uploadStickerFile( +public suspend fun TelegramBot.uploadStickerFile( user: CommonUser, sticker: MultipartFile, stickerFormat: StickerFormat -) = execute( +): File = execute( UploadStickerFile(user.id, sticker, stickerFormat) ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandling.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandling.kt index c0ad2cd264..ecb1e5a9b1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandling.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandling.kt @@ -17,7 +17,7 @@ import kotlinx.coroutines.launch * * @see UpdateReceiver */ -fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation( +public fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation( output: UpdateReceiver, mediaGroupsDebounceMillis: Long = 1000L ): UpdateReceiver { diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/DeleteWebhook.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/DeleteWebhook.kt index 9f503bc1dc..b4b25ffd93 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/DeleteWebhook.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/DeleteWebhook.kt @@ -3,4 +3,4 @@ package dev.inmo.tgbotapi.extensions.api.webhook import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.webhook.DeleteWebhook -suspend fun TelegramBot.deleteWebhook() = execute(DeleteWebhook()) +public suspend fun TelegramBot.deleteWebhook(): Boolean = execute(DeleteWebhook()) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/GetWebhookInfo.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/GetWebhookInfo.kt index d1fabc7e55..5d8cf0147b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/GetWebhookInfo.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/GetWebhookInfo.kt @@ -2,5 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.webhook import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.webhook.GetWebhookInfo +import dev.inmo.tgbotapi.types.WebhookInfo -suspend fun TelegramBot.getWebhookInfo() = execute(GetWebhookInfo()) +public suspend fun TelegramBot.getWebhookInfo(): WebhookInfo = execute(GetWebhookInfo()) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/SetWebhookInfo.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/SetWebhookInfo.kt index d2a986c5c2..162f89e6ab 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/SetWebhookInfo.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/webhook/SetWebhookInfo.kt @@ -9,14 +9,14 @@ import dev.inmo.tgbotapi.types.ALL_UPDATES_LIST /** * Use this method to send information about webhook (like [url]) */ -suspend fun TelegramBot.setWebhookInfo( +public suspend fun TelegramBot.setWebhookInfo( url: String, ipAddress: String? = null, maxAllowedConnections: Int? = null, allowedUpdates: List? = ALL_UPDATES_LIST, dropPendingUpdates: Boolean? = null, secretToken: String? = null -) = execute( +): Boolean = execute( SetWebhook( url, ipAddress, maxAllowedConnections, allowedUpdates, dropPendingUpdates, secretToken ) @@ -25,7 +25,7 @@ suspend fun TelegramBot.setWebhookInfo( /** * Use this method to send information about webhook (like [url] and [certificate]) */ -suspend fun TelegramBot.setWebhookInfo( +public suspend fun TelegramBot.setWebhookInfo( url: String, certificate: FileId, ipAddress: String? = null, @@ -33,7 +33,7 @@ suspend fun TelegramBot.setWebhookInfo( allowedUpdates: List? = ALL_UPDATES_LIST, dropPendingUpdates: Boolean? = null, secretToken: String? = null -) = execute( +): Boolean = execute( SetWebhook( url, certificate, ipAddress, maxAllowedConnections, allowedUpdates, dropPendingUpdates, secretToken ) @@ -42,7 +42,7 @@ suspend fun TelegramBot.setWebhookInfo( /** * Use this method to send information about webhook (like [url] and [certificate]) */ -suspend fun TelegramBot.setWebhookInfo( +public suspend fun TelegramBot.setWebhookInfo( url: String, certificate: MultipartFile, ipAddress: String? = null, @@ -50,7 +50,7 @@ suspend fun TelegramBot.setWebhookInfo( allowedUpdates: List? = ALL_UPDATES_LIST, dropPendingUpdates: Boolean? = null, secretToken: String? = null -) = execute( +): Boolean = execute( SetWebhook( url, certificate, ipAddress, maxAllowedConnections, allowedUpdates, dropPendingUpdates, secretToken ) 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) )