diff --git a/CHANGELOG.md b/CHANGELOG.md index f13da02baa..4ba52cd572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # TelegramBotAPI changelog +## 0.38.1 + +* `Core`: + * `MessageCallbackQuery` (and all implementers as well) has changed the type of `message`: now it is `ContentMessage` instead of `Message` + * New type `ForwardFromPublicChatInfo` as extender of `ForwardInfo`: + * `ForwardFromChannelInfo` now extends `ForwardFromPublicChatInfo` + * `ForwardFromSupergroupInfo` now extends `ForwardFromPublicChatInfo` + * New type of events: `UserLoggedIn` +* `Utils`: + * ([#511](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/511)) New extensions properties (raw fields as in original API) for several types have been added: + * `Message` + * `CallbackQuery` + * `ChosenInlineResult` + * `InlineQuery` + * `Poll` + ## 0.38.0 _This update contains [Telegram Bot API 5.6](https://core.telegram.org/bots/api-changelog#december-30-2021) implementation_ diff --git a/gradle.properties b/gradle.properties index b1e761c4a1..3bcc54326f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,6 +18,6 @@ micro_utils_version=0.9.0 javax_activation_version=1.1.1 library_group=dev.inmo -library_version=0.38.0 +library_version=0.38.1 github_release_plugin_version=2.2.12 diff --git a/tgbotapi.api/publish.gradle b/tgbotapi.api/publish.gradle index 3d4d7407f8..7d5c9b3c64 100644 --- a/tgbotapi.api/publish.gradle +++ b/tgbotapi.api/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi.api/mpp_publish_template.kpsb b/tgbotapi.api/publish.kpsb similarity index 55% rename from tgbotapi.api/mpp_publish_template.kpsb rename to tgbotapi.api/publish.kpsb index a0b4d37d9d..0327fe799d 100644 --- a/tgbotapi.api/mpp_publish_template.kpsb +++ b/tgbotapi.api/publish.kpsb @@ -1 +1 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/tgbotapi.behaviour_builder.fsm/publish.gradle b/tgbotapi.behaviour_builder.fsm/publish.gradle index 562185a08c..f4ee4a926b 100644 --- a/tgbotapi.behaviour_builder.fsm/publish.gradle +++ b/tgbotapi.behaviour_builder.fsm/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi.behaviour_builder.fsm/mpp_publish_template.kpsb b/tgbotapi.behaviour_builder.fsm/publish.kpsb similarity index 51% rename from tgbotapi.behaviour_builder.fsm/mpp_publish_template.kpsb rename to tgbotapi.behaviour_builder.fsm/publish.kpsb index be7b82e6ec..10238359f7 100644 --- a/tgbotapi.behaviour_builder.fsm/mpp_publish_template.kpsb +++ b/tgbotapi.behaviour_builder.fsm/publish.kpsb @@ -1 +1 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot Behaviour Builder FSM Extensions","description":"FSM extension for dev.inmo:tgbotapi.extensions.behaviour_builder.fsm","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.behaviour_builder","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot Behaviour Builder FSM Extensions","description":"FSM extension for dev.inmo:tgbotapi.extensions.behaviour_builder.fsm","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.behaviour_builder","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/tgbotapi.behaviour_builder/publish.gradle b/tgbotapi.behaviour_builder/publish.gradle index 5af61a71f8..160347436c 100644 --- a/tgbotapi.behaviour_builder/publish.gradle +++ b/tgbotapi.behaviour_builder/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi.behaviour_builder/publish.kpsb b/tgbotapi.behaviour_builder/publish.kpsb new file mode 100644 index 0000000000..ded4dcd6d6 --- /dev/null +++ b/tgbotapi.behaviour_builder/publish.kpsb @@ -0,0 +1 @@ +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Steps Extensions","description":"This extensions project contains tools for simple interaction with chats","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.steps","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt index 81672cc796..841f9bcf06 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt @@ -234,3 +234,10 @@ suspend fun BehaviourContext.waitSuccessfulPaymentEvents( filter: SimpleFilter>? = null, mapper: EventMessageToEventMapper? = null ) = waitEvents(count, initRequest, errorFactory, filter, mapper) +suspend fun BehaviourContext.waitUserLoggedInEvents( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null }, + count: Int = 1, + filter: SimpleFilter>? = null, + mapper: EventMessageToEventMapper? = null +) = waitEvents(count, initRequest, errorFactory, filter, mapper) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index 4fe6b2c3a3..f39245b11d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -464,3 +464,22 @@ suspend fun BC.onSuccessfulPayment( markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) + +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously + * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +suspend fun BC.onUserLoggedIn( + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> +) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.core/mpp_publish_template.kpsb b/tgbotapi.core/mpp_publish_template.kpsb deleted file mode 100644 index 30b9e6fab3..0000000000 --- a/tgbotapi.core/mpp_publish_template.kpsb +++ /dev/null @@ -1 +0,0 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file diff --git a/tgbotapi.core/publish.gradle b/tgbotapi.core/publish.gradle index b15d7993ab..0826870836 100644 --- a/tgbotapi.core/publish.gradle +++ b/tgbotapi.core/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi.core/publish.kpsb b/tgbotapi.core/publish.kpsb new file mode 100644 index 0000000000..48aeac4f9d --- /dev/null +++ b/tgbotapi.core/publish.kpsb @@ -0,0 +1 @@ +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageCallbackQuery.kt index 666d9b829c..7db3589341 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageCallbackQuery.kt @@ -1,7 +1,8 @@ package dev.inmo.tgbotapi.types.CallbackQuery -import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent sealed interface MessageCallbackQuery : CallbackQuery { - val message: Message + val message: ContentMessage } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageDataCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageDataCallbackQuery.kt index e276bd219e..fac77ae179 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageDataCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageDataCallbackQuery.kt @@ -2,12 +2,13 @@ package dev.inmo.tgbotapi.types.CallbackQuery import dev.inmo.tgbotapi.types.CallbackQueryIdentifier import dev.inmo.tgbotapi.types.User -import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent data class MessageDataCallbackQuery( override val id: CallbackQueryIdentifier, override val from: User, override val chatInstance: String, - override val message: Message, + override val message: ContentMessage, override val data: String ) : DataCallbackQuery, MessageCallbackQuery diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageGameShortNameCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageGameShortNameCallbackQuery.kt index 208f820179..88c66aca9a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageGameShortNameCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/MessageGameShortNameCallbackQuery.kt @@ -2,12 +2,13 @@ package dev.inmo.tgbotapi.types.CallbackQuery import dev.inmo.tgbotapi.types.CallbackQueryIdentifier import dev.inmo.tgbotapi.types.User -import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent data class MessageGameShortNameCallbackQuery( override val id: CallbackQueryIdentifier, override val from: User, override val chatInstance: String, - override val message: Message, + override val message: ContentMessage, override val gameShortName: String ) : GameShortNameCallbackQuery, MessageCallbackQuery diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/RawCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/RawCallbackQuery.kt index 4184a8902f..379095335d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/RawCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/CallbackQuery/RawCallbackQuery.kt @@ -1,8 +1,9 @@ package dev.inmo.tgbotapi.types.CallbackQuery import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer +import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -13,7 +14,7 @@ internal data class RawCallbackQuery( @SerialName(fromField) val from: User, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) - val message: Message? = null, + val message: ContentMessage? = null, @SerialName(inlineMessageIdField) val inlineMessageId: InlineMessageIdentifier? = null, @SerialName("chat_instance") diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt index bfdfc6050f..3a2c827b51 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types +import com.soywiz.klock.DateTime import dev.inmo.tgbotapi.CommonAbstracts.FromUser import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat import kotlinx.serialization.SerialName @@ -20,4 +21,7 @@ data class ChatJoinRequest( val inviteLink: ChatInviteLink, @SerialName(bioField) val bio: String? = null -) : FromUser +) : FromUser { + val dateTime: DateTime + get() = date.asDate +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/UserLoggedIn.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/UserLoggedIn.kt new file mode 100644 index 0000000000..eb21c274e3 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/UserLoggedIn.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.types.message.ChatEvents + +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent + +data class UserLoggedIn( + val domain: String +) : PrivateEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt index f239b9d235..8613ff4e43 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt @@ -2,8 +2,7 @@ package dev.inmo.tgbotapi.types.message import dev.inmo.tgbotapi.CommonAbstracts.FromUser import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.chat.abstracts.ChannelChat -import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat +import dev.inmo.tgbotapi.types.chat.abstracts.* sealed class ForwardInfo { abstract val dateOfOriginal: TelegramDate @@ -19,14 +18,24 @@ data class UserForwardInfo( override val from: User ) : ForwardInfo(), FromUser +sealed class ForwardFromPublicChatInfo : ForwardInfo() { + abstract val chat: PublicChat +} + data class ForwardFromChannelInfo( override val dateOfOriginal: TelegramDate, val messageId: MessageIdentifier, val channelChat: ChannelChat, val signature: String? = null -) : ForwardInfo() +) : ForwardFromPublicChatInfo() { + override val chat: PublicChat + get() = channelChat +} data class ForwardFromSupergroupInfo( override val dateOfOriginal: TelegramDate, val group: SupergroupChat -) : ForwardInfo() +) : ForwardFromPublicChatInfo() { + override val chat: PublicChat + get() = group +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index e823db8cc2..38868d2ae3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -201,6 +201,7 @@ internal data class RawMessage( pinned_message != null -> PinnedMessage(pinned_message.asMessage) proximity_alert_triggered != null -> proximity_alert_triggered successful_payment != null -> SuccessfulPaymentEvent(successful_payment) + connected_website != null -> UserLoggedIn(connected_website) else -> null } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt index 48535529b6..b91d6a98e6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt @@ -54,7 +54,9 @@ sealed interface Poll { } @Serializable(PollSerializer::class) -sealed interface MultipleAnswersPoll : Poll +sealed interface MultipleAnswersPoll : Poll { + val allowMultipleAnswers: Boolean +} @Serializable private class RawPoll( @@ -122,7 +124,7 @@ data class RegularPoll( override val votesCount: Int, override val isClosed: Boolean = false, override val isAnonymous: Boolean = false, - val allowMultipleAnswers: Boolean = false, + override val allowMultipleAnswers: Boolean = false, override val scheduledCloseInfo: ScheduledCloseInfo? = null ) : MultipleAnswersPoll diff --git a/tgbotapi.utils/publish.gradle b/tgbotapi.utils/publish.gradle index 8cd9a87e46..9d0054f20c 100644 --- a/tgbotapi.utils/publish.gradle +++ b/tgbotapi.utils/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi.utils/mpp_publish_template.kpsb b/tgbotapi.utils/publish.kpsb similarity index 52% rename from tgbotapi.utils/mpp_publish_template.kpsb rename to tgbotapi.utils/publish.kpsb index b9cb0896cd..f7b70b9aac 100644 --- a/tgbotapi.utils/mpp_publish_template.kpsb +++ b/tgbotapi.utils/publish.kpsb @@ -1 +1 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index d033cd6421..ca4d66cd9b 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.CallbackQuery.* import dev.inmo.tgbotapi.types.ChatMember.* import dev.inmo.tgbotapi.types.ChatMember.abstracts.* -import dev.inmo.tgbotapi.types.ChatMember.abstracts.MemberChatMember +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.* import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.* import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.* @@ -42,6 +42,7 @@ import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.content.abstracts.* import dev.inmo.tgbotapi.types.message.content.media.* import dev.inmo.tgbotapi.types.message.payments.InvoiceContent +import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.types.passport.* import dev.inmo.tgbotapi.types.passport.decrypted.* import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.* @@ -3064,6 +3065,15 @@ inline fun ChatEvent.asPinnedMessage(): PinnedMessage? = this as? PinnedMessage @PreviewFeature inline fun ChatEvent.requirePinnedMessage(): PinnedMessage = this as PinnedMessage +@PreviewFeature +inline fun ChatEvent.whenSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = asSuccessfulPaymentEvent() ?.let(block) + +@PreviewFeature +inline fun ChatEvent.asSuccessfulPaymentEvent(): SuccessfulPaymentEvent? = this as? SuccessfulPaymentEvent + +@PreviewFeature +inline fun ChatEvent.requireSuccessfulPaymentEvent(): SuccessfulPaymentEvent = this as SuccessfulPaymentEvent + @PreviewFeature inline fun ChatEvent.whenProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = asProximityAlertTriggered() ?.let(block) @@ -3174,6 +3184,24 @@ inline fun ChatEvent.asVoiceChatStarted(): VoiceChatStarted? = this as? VoiceCha @PreviewFeature inline fun ChatEvent.requireVoiceChatStarted(): VoiceChatStarted = this as VoiceChatStarted +@PreviewFeature +inline fun ChatEvent.whenVoiceChatScheduled(block: (VoiceChatScheduled) -> T) = asVoiceChatScheduled() ?.let(block) + +@PreviewFeature +inline fun ChatEvent.asVoiceChatScheduled(): VoiceChatScheduled? = this as? VoiceChatScheduled + +@PreviewFeature +inline fun ChatEvent.requireVoiceChatScheduled(): VoiceChatScheduled = this as VoiceChatScheduled + +@PreviewFeature +inline fun ChatEvent.whenUserLoggedIn(block: (UserLoggedIn) -> T) = asUserLoggedIn() ?.let(block) + +@PreviewFeature +inline fun ChatEvent.asUserLoggedIn(): UserLoggedIn? = this as? UserLoggedIn + +@PreviewFeature +inline fun ChatEvent.requireUserLoggedIn(): UserLoggedIn = this as UserLoggedIn + @PreviewFeature inline fun CommonSendInvoiceData.whenSendInvoice(block: (SendInvoice) -> T) = asSendInvoice() ?.let(block) @@ -3283,3 +3311,93 @@ inline fun ChatInviteLink.asChatInviteLinkUnlimited(): ChatInviteLinkUnlimited? @PreviewFeature inline fun ChatInviteLink.requireChatInviteLinkUnlimited(): ChatInviteLinkUnlimited = this as ChatInviteLinkUnlimited + +@PreviewFeature +inline fun ForwardInfo.whenAnonymousForwardInfo(block: (AnonymousForwardInfo) -> T) = asAnonymousForwardInfo() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.asAnonymousForwardInfo(): AnonymousForwardInfo? = this as? AnonymousForwardInfo + +@PreviewFeature +inline fun ForwardInfo.requireAnonymousForwardInfo(): AnonymousForwardInfo = this as AnonymousForwardInfo + +@PreviewFeature +inline fun ForwardInfo.whenUserForwardInfo(block: (UserForwardInfo) -> T) = asUserForwardInfo() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.asUserForwardInfo(): UserForwardInfo? = this as? UserForwardInfo + +@PreviewFeature +inline fun ForwardInfo.requireUserForwardInfo(): UserForwardInfo = this as UserForwardInfo + +@PreviewFeature +inline fun ForwardInfo.whenForwardFromPublicChatInfo(block: (ForwardFromPublicChatInfo) -> T) = asForwardFromPublicChatInfo() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.asForwardFromPublicChatInfo(): ForwardFromPublicChatInfo? = this as? ForwardFromPublicChatInfo + +@PreviewFeature +inline fun ForwardInfo.requireForwardFromPublicChatInfo(): ForwardFromPublicChatInfo = this as ForwardFromPublicChatInfo + +@PreviewFeature +inline fun ForwardInfo.whenForwardFromChannelInfo(block: (ForwardFromChannelInfo) -> T) = asForwardFromChannelInfo() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.asForwardFromChannelInfo(): ForwardFromChannelInfo? = this as? ForwardFromChannelInfo + +@PreviewFeature +inline fun ForwardInfo.requireForwardFromChannelInfo(): ForwardFromChannelInfo = this as ForwardFromChannelInfo + +@PreviewFeature +inline fun ForwardInfo.whenForwardFromSupergroupInfo(block: (ForwardFromSupergroupInfo) -> T) = asForwardFromSupergroupInfo() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.asForwardFromSupergroupInfo(): ForwardFromSupergroupInfo? = this as? ForwardFromSupergroupInfo + +@PreviewFeature +inline fun ForwardInfo.requireForwardFromSupergroupInfo(): ForwardFromSupergroupInfo = this as ForwardFromSupergroupInfo + +@PreviewFeature +inline fun MessageContent.whenTextedInput(block: (TextedInput) -> T) = asTextedInput() ?.let(block) + +@PreviewFeature +inline fun MessageContent.asTextedInput(): TextedInput? = this as? TextedInput + +@PreviewFeature +inline fun MessageContent.requireTextedInput(): TextedInput = this as TextedInput + +@PreviewFeature +inline fun ScheduledCloseInfo.whenExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = asExactScheduledCloseInfo() ?.let(block) + +@PreviewFeature +inline fun ScheduledCloseInfo.asExactScheduledCloseInfo(): ExactScheduledCloseInfo? = this as? ExactScheduledCloseInfo + +@PreviewFeature +inline fun ScheduledCloseInfo.requireExactScheduledCloseInfo(): ExactScheduledCloseInfo = this as ExactScheduledCloseInfo + +@PreviewFeature +inline fun ScheduledCloseInfo.whenApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = asApproximateScheduledCloseInfo() ?.let(block) + +@PreviewFeature +inline fun ScheduledCloseInfo.asApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo? = this as? ApproximateScheduledCloseInfo + +@PreviewFeature +inline fun ScheduledCloseInfo.requireApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo = this as ApproximateScheduledCloseInfo + +@PreviewFeature +inline fun ChosenInlineResult.whenLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = asLocationChosenInlineResult() ?.let(block) + +@PreviewFeature +inline fun ChosenInlineResult.asLocationChosenInlineResult(): LocationChosenInlineResult? = this as? LocationChosenInlineResult + +@PreviewFeature +inline fun ChosenInlineResult.requireLocationChosenInlineResult(): LocationChosenInlineResult = this as LocationChosenInlineResult + +@PreviewFeature +inline fun ChosenInlineResult.whenBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = asBaseChosenInlineResult() ?.let(block) + +@PreviewFeature +inline fun ChosenInlineResult.asBaseChosenInlineResult(): BaseChosenInlineResult? = this as? BaseChosenInlineResult + +@PreviewFeature +inline fun ChosenInlineResult.requireBaseChosenInlineResult(): BaseChosenInlineResult = this as BaseChosenInlineResult diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt index 202785be46..fa735e08a9 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt @@ -1,7 +1,2 @@ package dev.inmo.tgbotapi.extensions.utils.extensions -import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.SentMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate -import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.merge diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt index 4ce905c52f..1baf85da06 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt @@ -2,13 +2,11 @@ package dev.inmo.tgbotapi.extensions.utils.extensions import dev.inmo.tgbotapi.CommonAbstracts.FromUser import dev.inmo.tgbotapi.CommonAbstracts.WithUser -import dev.inmo.tgbotapi.extensions.utils.asFromUser import dev.inmo.tgbotapi.extensions.utils.asUser import dev.inmo.tgbotapi.extensions.utils.shortcuts.chat -import dev.inmo.tgbotapi.types.ChatJoinRequest import dev.inmo.tgbotapi.types.User import dev.inmo.tgbotapi.types.chat.abstracts.Chat -import dev.inmo.tgbotapi.types.update.* +import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.* import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate import dev.inmo.tgbotapi.types.update.abstracts.Update diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt new file mode 100644 index 0000000000..ea1f5161ca --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt @@ -0,0 +1,21 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.extensions.utils.* +import dev.inmo.tgbotapi.types.CallbackQuery.CallbackQuery +import dev.inmo.tgbotapi.types.InlineMessageIdentifier +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val CallbackQuery.message: ContentMessage? + get() = asMessageCallbackQuery() ?.message +@RiskFeature(RawFieldsUsageWarning) +val CallbackQuery.inline_message_id: InlineMessageIdentifier? + get() = asInlineMessageIdCallbackQuery() ?.inlineMessageId +@RiskFeature(RawFieldsUsageWarning) +val CallbackQuery.data: String? + get() = asDataCallbackQuery() ?.data +@RiskFeature(RawFieldsUsageWarning) +val CallbackQuery.game_short_name: String? + get() = asGameShortNameCallbackQuery() ?.gameShortName diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt new file mode 100644 index 0000000000..badefba058 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt @@ -0,0 +1,9 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.types.ChatInviteLink +import dev.inmo.tgbotapi.types.ChatJoinRequest +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val ChatJoinRequest.invite_link: ChatInviteLink + get() = inviteLink diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatMemberUpdated.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatMemberUpdated.kt new file mode 100644 index 0000000000..f4346c3efd --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatMemberUpdated.kt @@ -0,0 +1,16 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.types.ChatInviteLink +import dev.inmo.tgbotapi.types.ChatMember.abstracts.ChatMember +import dev.inmo.tgbotapi.types.ChatMemberUpdated +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val ChatMemberUpdated.old_chat_member: ChatMember + get() = oldChatMemberState +@RiskFeature(RawFieldsUsageWarning) +val ChatMemberUpdated.new_chat_member: ChatMember + get() = newChatMemberState +@RiskFeature(RawFieldsUsageWarning) +val ChatMemberUpdated.invite_link: ChatInviteLink? + get() = inviteLink diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChosenInlineResult.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChosenInlineResult.kt new file mode 100644 index 0000000000..af054ba9f3 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChosenInlineResult.kt @@ -0,0 +1,20 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.extensions.utils.asLocationChosenInlineResult +import dev.inmo.tgbotapi.types.InlineMessageIdentifier +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueryIdentifier +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val ChosenInlineResult.location: Location? + get() = asLocationChosenInlineResult() ?.location + +@RiskFeature(RawFieldsUsageWarning) +val ChosenInlineResult.result_id: InlineQueryIdentifier + get() = resultId + +@RiskFeature(RawFieldsUsageWarning) +val ChosenInlineResult.inline_message_id: InlineMessageIdentifier? + get() = inlineMessageId diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/InlineQuery.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/InlineQuery.kt new file mode 100644 index 0000000000..b7f61bd33a --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/InlineQuery.kt @@ -0,0 +1,14 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.extensions.utils.asLocationInlineQuery +import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val InlineQuery.location: Location? + get() = asLocationInlineQuery() ?.location + +@RiskFeature(RawFieldsUsageWarning) +val InlineQuery.chat_type: String? + get() = chatType ?.stringified diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt new file mode 100644 index 0000000000..8b20c66359 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -0,0 +1,208 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.extensions.utils.* +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.chat.abstracts.Chat +import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat +import dev.inmo.tgbotapi.types.dice.Dice +import dev.inmo.tgbotapi.types.files.* +import dev.inmo.tgbotapi.types.games.Game +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.message.ChatEvents.* +import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* +import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.passport.PassportData +import dev.inmo.tgbotapi.types.payments.Invoice +import dev.inmo.tgbotapi.types.payments.SuccessfulPayment +import dev.inmo.tgbotapi.types.polls.Poll +import dev.inmo.tgbotapi.types.venue.Venue +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.from: User? + get() = asFromUser() ?.from +@RiskFeature(RawFieldsUsageWarning) +inline val Message.sender_chat: PublicChat? + get() = asFromChannelGroupContentMessage() ?.senderChat +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_from: User? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asUserForwardInfo() ?.from +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_from_chat: Chat? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromPublicChatInfo() ?.chat +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_from_message_id: MessageIdentifier? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromChannelInfo() ?.messageId +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_signature: ForwardSignature? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromChannelInfo() ?.signature +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_sender_name: ForwardSenderName? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asAnonymousForwardInfo() ?.senderName +@RiskFeature(RawFieldsUsageWarning) +inline val Message.forward_date: TelegramDate? + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.dateOfOriginal +@RiskFeature(RawFieldsUsageWarning) +inline val Message.is_automatic_forward: Boolean? + get() = this is ConnectedFromChannelGroupContentMessage<*> +@RiskFeature(RawFieldsUsageWarning) +inline val Message.reply_to_message: Message? + get() = asPossiblyReplyMessage() ?.replyTo +@RiskFeature(RawFieldsUsageWarning) +inline val Message.via_bot: CommonBot? + get() = asPossiblySentViaBotCommonMessage() ?.senderBot +@RiskFeature(RawFieldsUsageWarning) +inline val Message.edit_date: TelegramDate? + get() = asPossiblyEditedMessage() ?.editDate ?.toTelegramDate() +@RiskFeature(RawFieldsUsageWarning) +inline val Message.has_protected_content: Boolean? + get() = asContentMessage() ?.hasProtectedContent +@RiskFeature(RawFieldsUsageWarning) +inline val Message.media_group_id: MediaGroupIdentifier? + get() = asMediaGroupMessage() ?.mediaGroupId +@RiskFeature(RawFieldsUsageWarning) +inline val Message.author_signature: AuthorSignature? + get() = asSignedMessage() ?.authorSignature +@RiskFeature(RawFieldsUsageWarning) +inline val Message.text: String? + get() = asContentMessage() ?.content ?.asTextContent() ?.text +@RiskFeature(RawFieldsUsageWarning) +inline val Message.entities: TextSourcesList? + get() = asContentMessage() ?.content ?.asTextContent() ?.textSources +@RiskFeature(RawFieldsUsageWarning) +inline val Message.caption: String? + get() = whenContentMessage { + if (it.content !is TextContent) { + it.content.asTextedInput() ?.text + } else { + null + } + } +@RiskFeature(RawFieldsUsageWarning) +inline val Message.caption_entities: TextSourcesList? + get() = whenContentMessage { + if (it.content !is TextContent) { + it.content.asTextedInput() ?.textSources + } else { + null + } + } +@RiskFeature(RawFieldsUsageWarning) +inline val Message.audio: AudioFile? + get() = asContentMessage() ?.content ?.asAudioContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.document: DocumentFile? + get() = asContentMessage() ?.content ?.asDocumentContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.animation: AnimationFile? + get() = asContentMessage() ?.content ?.asAnimationContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.game: Game? + get() = asContentMessage() ?.content ?.asGameContent() ?.game +@RiskFeature(RawFieldsUsageWarning) +inline val Message.photo: Photo? + get() = asContentMessage() ?.content ?.asPhotoContent() ?.mediaCollection +@RiskFeature(RawFieldsUsageWarning) +inline val Message.sticker: Sticker? + get() = asContentMessage() ?.content ?.asStickerContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.video: VideoFile? + get() = asContentMessage() ?.content ?.asVideoContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.voice: VoiceFile? + get() = asContentMessage() ?.content ?.asVoiceContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.video_note: VideoNoteFile? + get() = asContentMessage() ?.content ?.asVideoNoteContent() ?.media +@RiskFeature(RawFieldsUsageWarning) +inline val Message.contact: Contact? + get() = asContentMessage() ?.content ?.asContactContent() ?.contact +@RiskFeature(RawFieldsUsageWarning) +inline val Message.location: Location? + get() = asContentMessage() ?.content ?.asLocationContent() ?.location +@RiskFeature(RawFieldsUsageWarning) +inline val Message.venue: Venue? + get() = asContentMessage() ?.content ?.asVenueContent() ?.venue +@RiskFeature(RawFieldsUsageWarning) +inline val Message.poll: Poll? + get() = asContentMessage() ?.content ?.asPollContent() ?.poll +@RiskFeature(RawFieldsUsageWarning) +inline val Message.invoice: Invoice? + get() = asContentMessage() ?.content ?.asInvoiceContent() ?.invoice +@RiskFeature(RawFieldsUsageWarning) +inline val Message.dice: Dice? + get() = asContentMessage() ?.content ?.asDiceContent() ?.dice +@RiskFeature(RawFieldsUsageWarning) +inline val Message.new_chat_members: List? + get() = asChatEventMessage() ?.chatEvent ?.asNewChatMembers() ?.members +@RiskFeature(RawFieldsUsageWarning) +inline val Message.left_chat_member: User? + get() = asChatEventMessage() ?.chatEvent ?.asLeftChatMember() ?.user +@RiskFeature(RawFieldsUsageWarning) +inline val Message.new_chat_title: String? + get() = asChatEventMessage() ?.chatEvent ?.asNewChatTitle() ?.title +@RiskFeature(RawFieldsUsageWarning) +inline val Message.new_chat_photo: Photo? + get() = asChatEventMessage() ?.chatEvent ?.asNewChatPhoto() ?.photo +@RiskFeature(RawFieldsUsageWarning) +inline val Message.delete_chat_photo: Boolean + get() = asChatEventMessage() ?.chatEvent is DeleteChatPhoto +@RiskFeature(RawFieldsUsageWarning) +inline val Message.group_chat_created: Boolean + get() = asChatEventMessage() ?.chatEvent is GroupChatCreated +@RiskFeature(RawFieldsUsageWarning) +inline val Message.supergroup_chat_created: Boolean + get() = asChatEventMessage() ?.chatEvent is SupergroupChatCreated +@RiskFeature(RawFieldsUsageWarning) +inline val Message.channel_chat_created: Boolean + get() = asChatEventMessage() ?.chatEvent is ChannelChatCreated +@RiskFeature(RawFieldsUsageWarning) +inline val Message.migrate_to_chat_id: ChatId? + get() = asChatEventMessage() ?.chatEvent ?.asGroupChatCreated() ?.migratedTo +@RiskFeature(RawFieldsUsageWarning) +inline val Message.migrate_from_chat_id: ChatId? + get() = asChatEventMessage() ?.chatEvent ?.let { + it ?.asSupergroupChatCreated() ?.migratedFrom ?: it ?.asMigratedToSupergroup() ?.migratedFrom + } +@RiskFeature(RawFieldsUsageWarning) +inline val Message.pinned_message: Message? + get() = asChatEventMessage() ?.chatEvent ?.asPinnedMessage() ?.message +@RiskFeature(RawFieldsUsageWarning) +inline val Message.successful_payment: SuccessfulPayment? + get() = asChatEventMessage() ?.chatEvent ?.asSuccessfulPaymentEvent() ?.payment + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.voice_chat_scheduled: VoiceChatScheduled? + get() = asChatEventMessage() ?.chatEvent ?.asVoiceChatScheduled() +@RiskFeature(RawFieldsUsageWarning) +inline val Message.voice_chat_started: VoiceChatStarted? + get() = asChatEventMessage() ?.chatEvent ?.asVoiceChatStarted() +@RiskFeature(RawFieldsUsageWarning) +inline val Message.voice_chat_ended: VoiceChatEnded? + get() = asChatEventMessage() ?.chatEvent ?.asVoiceChatEnded() +@RiskFeature(RawFieldsUsageWarning) +inline val Message.voice_chat_participants_invited: VoiceChatParticipantsInvited? + get() = asChatEventMessage() ?.chatEvent ?.asVoiceChatParticipantsInvited() + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged? + get() = asChatEventMessage() ?.chatEvent ?.asMessageAutoDeleteTimerChanged() + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.connected_website: String? + get() = asChatEventMessage() ?.chatEvent ?.asUserLoggedIn() ?.domain +@RiskFeature(RawFieldsUsageWarning) +inline val Message.proximity_alert_triggered: ProximityAlertTriggered? + get() = asChatEventMessage() ?.chatEvent ?.asProximityAlertTriggered() + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.passport_data: PassportData? + get() = asPassportMessage() ?.passportData + +@RiskFeature(RawFieldsUsageWarning) +inline val Message.reply_markup: InlineKeyboardMarkup? + get() = asCommonMessage() ?.replyMarkup diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Poll.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Poll.kt new file mode 100644 index 0000000000..00f20a33b8 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Poll.kt @@ -0,0 +1,43 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.extensions.utils.* +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList +import dev.inmo.tgbotapi.types.polls.* +import dev.inmo.tgbotapi.utils.RiskFeature +import kotlinx.serialization.json.jsonPrimitive + +@RiskFeature(RawFieldsUsageWarning) +val Poll.total_voter_count: Int + get() = votesCount +@RiskFeature(RawFieldsUsageWarning) +val Poll.type: String + get() = when (this) { + is RegularPoll -> "regular" + is UnknownPollType -> raw["type"]!!.jsonPrimitive.content + is QuizPoll -> "quiz" + } +@RiskFeature(RawFieldsUsageWarning) +val Poll.allows_multiple_answers: Boolean + get() = asMultipleAnswersPoll() ?.allowMultipleAnswers == true +@RiskFeature(RawFieldsUsageWarning) +val Poll.correct_option_id: Int? + get() = asQuizPoll() ?.correctOptionId +@RiskFeature(RawFieldsUsageWarning) +val Poll.explanation: String? + get() = asQuizPoll() ?.text +@RiskFeature(RawFieldsUsageWarning) +val Poll.explanation_entities: TextSourcesList? + get() = asQuizPoll() ?.textSources +@RiskFeature(RawFieldsUsageWarning) +val Poll.open_period: Seconds? + get() = scheduledCloseInfo ?.asApproximateScheduledCloseInfo() ?.openDuration ?.seconds ?.toInt() +@RiskFeature(RawFieldsUsageWarning) +val Poll.close_date: TelegramDate? + get() = scheduledCloseInfo ?.asExactScheduledCloseInfo() ?.closeDateTime ?.toTelegramDate() +@RiskFeature(RawFieldsUsageWarning) +val Poll.is_closed: Boolean + get() = isClosed +@RiskFeature(RawFieldsUsageWarning) +val Poll.is_anonymous: Boolean + get() = isAnonymous diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PollAnswer.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PollAnswer.kt new file mode 100644 index 0000000000..3b0fcba264 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PollAnswer.kt @@ -0,0 +1,12 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.types.PollIdentifier +import dev.inmo.tgbotapi.types.polls.PollAnswer +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val PollAnswer.poll_id: PollIdentifier + get() = pollId +@RiskFeature(RawFieldsUsageWarning) +val PollAnswer.option_ids: List + get() = chosen diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PreCheckoutQuery.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PreCheckoutQuery.kt new file mode 100644 index 0000000000..1c1226c925 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/PreCheckoutQuery.kt @@ -0,0 +1,20 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.types.InvoicePayload +import dev.inmo.tgbotapi.types.ShippingOptionIdentifier +import dev.inmo.tgbotapi.types.payments.OrderInfo +import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val PreCheckoutQuery.total_amount: Long + get() = amount +@RiskFeature(RawFieldsUsageWarning) +val PreCheckoutQuery.invoice_payload: InvoicePayload + get() = invoicePayload +@RiskFeature(RawFieldsUsageWarning) +val PreCheckoutQuery.shipping_option_id: ShippingOptionIdentifier? + get() = shippingOptionId +@RiskFeature(RawFieldsUsageWarning) +val PreCheckoutQuery.order_info: OrderInfo? + get() = orderInfo diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/RawFieldsUsageWarning.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/RawFieldsUsageWarning.kt new file mode 100644 index 0000000000..8a09157cdd --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/RawFieldsUsageWarning.kt @@ -0,0 +1,3 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +internal const val RawFieldsUsageWarning = "This API is raw and experimental. So, it is possible that behaviour of this API will be changed in near updates" diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ShippingQuery.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ShippingQuery.kt new file mode 100644 index 0000000000..0400107c5c --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ShippingQuery.kt @@ -0,0 +1,13 @@ +package dev.inmo.tgbotapi.extensions.utils.extensions.raw + +import dev.inmo.tgbotapi.types.InvoicePayload +import dev.inmo.tgbotapi.types.payments.ShippingAddress +import dev.inmo.tgbotapi.types.payments.ShippingQuery +import dev.inmo.tgbotapi.utils.RiskFeature + +@RiskFeature(RawFieldsUsageWarning) +val ShippingQuery.invoice_payload: InvoicePayload + get() = invoicePayload +@RiskFeature(RawFieldsUsageWarning) +val ShippingQuery.shipping_address: ShippingAddress + get() = shippingAddress diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt index 6746cb2e15..dbab023d4c 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt @@ -9,7 +9,6 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.PrivateEventMessage import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent -import dev.inmo.tgbotapi.types.payments.SuccessfulPayment import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.utils.RiskFeature import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt index f359d0e5ee..ea36d5cfc4 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.extensions.utils.types.buttons import dev.inmo.tgbotapi.types.buttons.* -import dev.inmo.tgbotapi.types.inputFieldPlaceholderField import dev.inmo.tgbotapi.utils.MatrixBuilder import dev.inmo.tgbotapi.utils.RowBuilder -import kotlinx.serialization.SerialName /** * Core DSL part of Keyboard DSL. Can accept only [KeyboardButton] and returns ready to use diff --git a/tgbotapi/mpp_publish_template.kpsb b/tgbotapi/mpp_publish_template.kpsb deleted file mode 100644 index d750a5847e..0000000000 --- a/tgbotapi/mpp_publish_template.kpsb +++ /dev/null @@ -1 +0,0 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} diff --git a/tgbotapi/publish.gradle b/tgbotapi/publish.gradle index 9c91d01447..4adb64e4e7 100644 --- a/tgbotapi/publish.gradle +++ b/tgbotapi/publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -62,8 +61,19 @@ publishing { } } } - -signing { - useGpgCmd() - sign publishing.publications + +if (project.hasProperty("signing.gnupg.keyName")) { + apply plugin: 'signing' + + signing { + useGpgCmd() + + sign publishing.publications + } + + task signAll { + tasks.withType(Sign).forEach { + dependsOn(it) + } + } } diff --git a/tgbotapi/publish.kpsb b/tgbotapi/publish.kpsb new file mode 100644 index 0000000000..e91196a721 --- /dev/null +++ b/tgbotapi/publish.kpsb @@ -0,0 +1 @@ +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file