From 4944c972a6cc6bf1c71fb3b7e324520cb6168a10 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:03:09 +0600 Subject: [PATCH 1/9] start 15.3.0 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fa59bff3..30a580c85e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 15.3.0 + ## 15.2.0 * `API`: diff --git a/gradle.properties b/gradle.properties index 01c72d41e8..4b0cc5d055 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=15.2.0 +library_version=15.3.0 From 42b32af986a13d8c14a92615c56d72d8761e5ee2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:09:20 +0600 Subject: [PATCH 2/9] add hasMainWebApp into extended bots --- .../src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 4abe77e2e3..d8de107a3c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -159,6 +159,7 @@ const val hasVisibleHistoryField = "has_visible_history" const val unrestrictBoostsCountField = "unrestrict_boost_count" const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name" const val iconCustomEmojiIdField = "icon_custom_emoji_id" +const val hasMainWebAppField = "has_main_web_app" const val canJoinGroupsField = "can_join_groups" const val canReadAllGroupMessagesField = "can_read_all_group_messages" const val canReplyField = "can_reply" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index 58419106df..5dc0f90985 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -308,6 +308,8 @@ data class ExtendedBot( override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(hasMainWebAppField) + val hasMainWebApp: Boolean = false ) : Bot(), ExtendedChat { @SerialName(isBotField) private val isBot = true From 88008b7cfc73048fbbd3480a759bc3bc59a8db71 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:17:41 +0600 Subject: [PATCH 3/9] add support of business connection id in pin/unpin for messages --- tgbotapi.api/api/tgbotapi.api.api | 23 ++++++----- .../api/chat/modify/PinChatMessage.kt | 11 +++-- .../api/chat/modify/UnpinChatMessage.kt | 17 +++++--- tgbotapi.core/api/tgbotapi.core.api | 40 +++++++++++-------- .../OptionallyBusinessConnectionRequest.kt | 6 +-- .../requests/chat/modify/PinChatMessage.kt | 5 ++- .../requests/chat/modify/UnpinChatMessage.kt | 8 +++- 7 files changed, 65 insertions(+), 45 deletions(-) diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 5d4dedc9f0..659607348e 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -667,12 +667,12 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/modify/DeleteChatPhotoK } public final class dev/inmo/tgbotapi/extensions/api/chat/modify/PinChatMessageKt { - public static final fun pinChatMessage (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun pinChatMessage$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun pinChatMessage-SAUdIcY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JZLkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun pinChatMessage-SAUdIcY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JZLkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun pinChatMessage-SAUdIcY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun pinChatMessage-SAUdIcY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun pinChatMessage-iJMbh4A (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun pinChatMessage-iJMbh4A$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun pinChatMessage-rd3ngj0 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun pinChatMessage-rd3ngj0 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JLjava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun pinChatMessage-rd3ngj0$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun pinChatMessage-rd3ngj0$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JLjava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/chat/modify/SetChatDescriptionKt { @@ -712,11 +712,12 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinAllChatMess } public final class dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessageKt { - public static final fun unpinChatMessage (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun unpinChatMessage-MzaUNdY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun unpinChatMessage-MzaUNdY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun unpinChatMessage-MzaUNdY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun unpinChatMessage-MzaUNdY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun unpinChatMessage-DZdi6a4 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun unpinChatMessage-DZdi6a4 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun unpinChatMessage-DZdi6a4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun unpinChatMessage-DZdi6a4$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun unpinChatMessage-efQd2eE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun unpinChatMessage-efQd2eE$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/chat/stickers/DeleteChatStickerSetKt { 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 b08f55f5a7..d22aa7458e 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 @@ -4,22 +4,27 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId +import dev.inmo.tgbotapi.types.businessConnectionId +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage public suspend fun TelegramBot.pinChatMessage( chatId: ChatIdentifier, messageId: MessageId, + businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, disableNotification: Boolean = false -): Boolean = execute(PinChatMessage(chatId, messageId, disableNotification)) +): Boolean = execute(PinChatMessage(chatId, messageId, businessConnectionId, disableNotification)) public suspend fun TelegramBot.pinChatMessage( chat: Chat, messageId: MessageId, + businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, disableNotification: Boolean = false -): Boolean = pinChatMessage(chat.id, messageId, disableNotification) +): Boolean = pinChatMessage(chat.id, messageId, businessConnectionId, disableNotification) public suspend fun TelegramBot.pinChatMessage( message: AccessibleMessage, + businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, disableNotification: Boolean = false -): Boolean = pinChatMessage(message.chat.id, message.messageId, disableNotification) +): Boolean = pinChatMessage(message.chat.id, message.messageId, businessConnectionId, disableNotification) 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 35da0909cd..4c599faf3c 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 @@ -4,19 +4,24 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId +import dev.inmo.tgbotapi.types.businessConnectionId +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage public suspend fun TelegramBot.unpinChatMessage( chatId: ChatIdentifier, - messageId: MessageId? = null -): Boolean = execute(UnpinChatMessage(chatId, messageId)) + messageId: MessageId? = null, + businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId +): Boolean = execute(UnpinChatMessage(chatId, messageId, businessConnectionId)) public suspend fun TelegramBot.unpinChatMessage( chat: Chat, - messageId: MessageId? = null -): Boolean = unpinChatMessage(chat.id, messageId) + messageId: MessageId? = null, + businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId +): Boolean = unpinChatMessage(chat.id, messageId, businessConnectionId) public suspend fun TelegramBot.unpinChatMessage( - message: AccessibleMessage -): Boolean = unpinChatMessage(message.chat.id, message.messageId) + message: AccessibleMessage, + businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId, +): Boolean = unpinChatMessage(message.chat.id, message.messageId, businessConnectionId) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 32a63f508b..de071ed17f 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -168,8 +168,7 @@ public abstract interface class dev/inmo/tgbotapi/abstracts/types/OptionalChatRe public abstract fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; } -public abstract interface class dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest { - public abstract fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; +public abstract interface class dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest : dev/inmo/tgbotapi/abstracts/types/WithOptionalBusinessConnectionId { } public abstract interface class dev/inmo/tgbotapi/abstracts/types/OptionallyWithEffectId { @@ -3076,16 +3075,18 @@ public final class dev/inmo/tgbotapi/requests/chat/modify/DeleteChatPhoto$Compan public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage : dev/inmo/tgbotapi/abstracts/types/ChatRequest, dev/inmo/tgbotapi/abstracts/types/DisableNotification, dev/inmo/tgbotapi/abstracts/types/MessageAction, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { +public final class dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage : dev/inmo/tgbotapi/abstracts/types/ChatRequest, dev/inmo/tgbotapi/abstracts/types/DisableNotification, dev/inmo/tgbotapi/abstracts/types/MessageAction, dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JZILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; public final fun component2-APLFQys ()J - public final fun component3 ()Z - public final fun copy-HkzWJnM (Ldev/inmo/tgbotapi/types/ChatIdentifier;JZ)Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage; - public static synthetic fun copy-HkzWJnM$default (Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage;Ldev/inmo/tgbotapi/types/ChatIdentifier;JZILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage; + public final fun component3-nXr5wdE ()Ljava/lang/String; + public final fun component4 ()Z + public final fun copy-HtX6zsU (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Z)Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage; + public static synthetic fun copy-HtX6zsU$default (Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/modify/PinChatMessage; public fun equals (Ljava/lang/Object;)Z + public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; public fun getDisableNotification ()Z public fun getMessageId-APLFQys ()J @@ -3337,15 +3338,17 @@ public final class dev/inmo/tgbotapi/requests/chat/modify/UnpinAllChatMessages$C public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage : dev/inmo/tgbotapi/abstracts/types/ChatRequest, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { +public final class dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage : dev/inmo/tgbotapi/abstracts/types/ChatRequest, dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; public final fun component2-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId; - public final fun copy-rTT8EQM (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;)Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage; - public static synthetic fun copy-rTT8EQM$default (Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage; + public final fun component3-nXr5wdE ()Ljava/lang/String; + public final fun copy-PPbMvFs (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage; + public static synthetic fun copy-PPbMvFs$default (Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage; public fun equals (Ljava/lang/Object;)Z + public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; public final fun getMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId; public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; @@ -8553,6 +8556,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field hasAggressiveAntiSpamEnabledField Ljava/lang/String; public static final field hasCustomCertificateField Ljava/lang/String; public static final field hasHiddenMembersField Ljava/lang/String; + public static final field hasMainWebAppField Ljava/lang/String; public static final field hasPrivateForwardsField Ljava/lang/String; public static final field hasPublicWinnersField Ljava/lang/String; public static final field hasRestrictedVoiceAndVideoMessagesField Ljava/lang/String; @@ -14515,14 +14519,15 @@ public final class dev/inmo/tgbotapi/types/chat/CommonUser$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/types/chat/Bot, dev/inmo/tgbotapi/types/chat/ExtendedChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedBot$Companion; - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZLkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-tHkBKVM ()J public final fun component10-f3WtEc0 ()I public final fun component11-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId; public final fun component12-GbmMWyQ ()Ljava/lang/String; public final fun component13-GbmMWyQ ()Ljava/lang/String; public final fun component14 ()I + public final fun component15 ()Z public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4-san03mo ()Ljava/lang/String; @@ -14531,8 +14536,8 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/ public final fun component7 ()Z public final fun component8 ()Z public final fun component9 ()Ldev/inmo/tgbotapi/types/ChatPhoto; - public final fun copy-gWg6A_4 (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;I)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; - public static synthetic fun copy-gWg6A_4$default (Ldev/inmo/tgbotapi/types/chat/ExtendedBot;JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; + public final fun copy-IItryQQ (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZ)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; + public static synthetic fun copy-IItryQQ$default (Ldev/inmo/tgbotapi/types/chat/ExtendedBot;JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; @@ -14541,6 +14546,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/ public final fun getCanReadAllGroupMessages ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getFirstName ()Ljava/lang/String; + public final fun getHasMainWebApp ()Z public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getId-tHkBKVM ()J public fun getLastName ()Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest.kt index d33f8d3b85..8aba6f9dec 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/OptionallyBusinessConnectionRequest.kt @@ -1,7 +1,3 @@ package dev.inmo.tgbotapi.abstracts.types -import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId - -interface OptionallyBusinessConnectionRequest { - val businessConnectionId: BusinessConnectionId? -} +interface OptionallyBusinessConnectionRequest : WithOptionalBusinessConnectionId diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage.kt index cc01d6dcc9..b10408f8de 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/PinChatMessage.kt @@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.chat.modify import dev.inmo.tgbotapi.abstracts.types.* import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer @@ -17,9 +18,11 @@ data class PinChatMessage ( override val chatId: ChatIdentifier, @SerialName(messageIdField) override val messageId: MessageId, + @SerialName(businessConnectionIdField) + override val businessConnectionId: BusinessConnectionId? = null, @SerialName(disableNotificationField) override val disableNotification: Boolean = false -): ChatRequest, SimpleRequest, MessageAction, DisableNotification { +): ChatRequest, SimpleRequest, MessageAction, DisableNotification, OptionallyBusinessConnectionRequest { override fun method(): String = "pinChatMessage" override val resultDeserializer: DeserializationStrategy get() = Boolean.serializer() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt index b191a2a3d7..7437ff3bc3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt @@ -1,8 +1,10 @@ package dev.inmo.tgbotapi.requests.chat.modify import dev.inmo.tgbotapi.abstracts.types.ChatRequest +import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer @@ -11,8 +13,10 @@ data class UnpinChatMessage( @SerialName(chatIdField) override val chatId: ChatIdentifier, @SerialName(messageIdField) - val messageId: MessageId? = null -): ChatRequest, SimpleRequest { + val messageId: MessageId? = null, + @SerialName(businessConnectionIdField) + override val businessConnectionId: BusinessConnectionId? = null +): ChatRequest, SimpleRequest, OptionallyBusinessConnectionRequest { override fun method(): String = "unpinChatMessage" override val resultDeserializer: DeserializationStrategy get() = Boolean.serializer() From 010c52adebe5ffea138e30afb8b733852c5d3b43 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:26:18 +0600 Subject: [PATCH 4/9] add shareToStory in WebApp --- .../kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt | 3 +++ .../webapps/stories/StoryShareParams.kt | 7 +++++++ .../webapps/stories/StoryWidgetLink.kt | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt create mode 100644 tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt index 47465ef96b..f205ae37e9 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/WebApp.kt @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.webapps.cloud.CloudStorage import dev.inmo.tgbotapi.webapps.haptic.HapticFeedback import dev.inmo.tgbotapi.webapps.invoice.InvoiceClosedInfo import dev.inmo.tgbotapi.webapps.popup.* +import dev.inmo.tgbotapi.webapps.stories.StoryShareParams external class WebApp { val version: String @@ -101,6 +102,8 @@ external class WebApp { fun openTelegramLink(url: String) fun openInvoice(url: String, callback: (InvoiceClosedInfo) -> Unit = definedExternally) + fun shareToStory(mediaUrl: String, params: StoryShareParams?) + fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally) fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally) } diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt new file mode 100644 index 0000000000..2ecb275909 --- /dev/null +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt @@ -0,0 +1,7 @@ +package dev.inmo.tgbotapi.webapps.stories + +external interface StoryShareParams { + val text: String + @JsName("widget_link") + val widgetLink: StoryWidgetLink? +} \ No newline at end of file diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt new file mode 100644 index 0000000000..61ee95a034 --- /dev/null +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt @@ -0,0 +1,18 @@ +package dev.inmo.tgbotapi.webapps.stories + +import kotlin.js.json + +external interface StoryWidgetLink { + val url: String + val name: String? +} + +fun StoryWidgetLink( + url: String, + name: String? +): StoryWidgetLink { + val result: dynamic = js("{}") + result["url"] = url + name ?.let { result["name"] = it } + return result.unsafeCast() +} From bd6ff747cb33e8b5f78c0e90316833376e7a9e99 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:32:51 +0600 Subject: [PATCH 5/9] add note about telegram bot api 7.8 support --- CHANGELOG.md | 3 +++ README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30a580c85e..790c9275b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 15.3.0 +**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.8** + + ## 15.2.0 * `API`: diff --git a/README.md b/README.md index 5ee58069da..5ee6e4837c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.7-blue)](https://core.telegram.org/bots/api-changelog#july-7-2024) +# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.8-blue)](https://core.telegram.org/bots/api-changelog#july-31-2024) | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| From 799ad6ca66019a8f1abf41b7781cf75619664329 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:38:16 +0600 Subject: [PATCH 6/9] fill changelog and add StoryShareParams factory function --- CHANGELOG.md | 9 +++++++++ .../tgbotapi/webapps/stories/StoryShareParams.kt | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 790c9275b7..49dbe847d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ **THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.8** +* `Core`: + * `OptionallyBusinessConnectionRequest` now extends `WithOptionalBusinessConnectionId` + * Add `hasMainWebApp` in `ExtendedBot` +* `API`: + * Add `BusinessConnectionId` to pin/unpin methods +* `WebApp`: + * Add `shareToStory` in `WebApp` + + ## 15.2.0 diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt index 2ecb275909..f8b91b9b49 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt @@ -4,4 +4,14 @@ external interface StoryShareParams { val text: String @JsName("widget_link") val widgetLink: StoryWidgetLink? -} \ No newline at end of file +} + +fun StoryShareParams( + text: String, + widgetLink: StoryWidgetLink? +): StoryShareParams { + val result: dynamic = js("{}") + result["text"] = text + widgetLink ?.let { result["widgetLink"] = it } + return result.unsafeCast() +} From 8bb3095fb14020feec7072e1e2ea6e902bda076e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:39:14 +0600 Subject: [PATCH 7/9] fix of "widget_link" parameter name in StoryShareParams --- .../dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt index f8b91b9b49..e3fb6f260e 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt @@ -12,6 +12,6 @@ fun StoryShareParams( ): StoryShareParams { val result: dynamic = js("{}") result["text"] = text - widgetLink ?.let { result["widgetLink"] = it } + widgetLink ?.let { result["widget_link"] = it } return result.unsafeCast() } From 2d11685b7b48c1e6e2e0cedc9239075dc2bb8aea Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:41:02 +0600 Subject: [PATCH 8/9] fix using of json in new webapp types --- .../inmo/tgbotapi/webapps/stories/StoryShareParams.kt | 10 ++++++---- .../inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt index e3fb6f260e..c75e32660e 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt @@ -1,5 +1,7 @@ package dev.inmo.tgbotapi.webapps.stories +import kotlin.js.json + external interface StoryShareParams { val text: String @JsName("widget_link") @@ -10,8 +12,8 @@ fun StoryShareParams( text: String, widgetLink: StoryWidgetLink? ): StoryShareParams { - val result: dynamic = js("{}") - result["text"] = text - widgetLink ?.let { result["widget_link"] = it } - return result.unsafeCast() + val json = json() + json["text"] = text + widgetLink ?.let { json["widget_link"] = it } + return json.unsafeCast() } diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt index 61ee95a034..b56959cbd6 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt @@ -11,8 +11,8 @@ fun StoryWidgetLink( url: String, name: String? ): StoryWidgetLink { - val result: dynamic = js("{}") - result["url"] = url - name ?.let { result["name"] = it } - return result.unsafeCast() + val json = json() + json["url"] = url + name ?.let { json["name"] = it } + return json.unsafeCast() } From 8e3e44769ec90a3080c80e7cc8cb5aaf9bb24ac2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:43:08 +0600 Subject: [PATCH 9/9] add defaults in StoryShareParams and StoryWidgetLink --- .../dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt | 2 +- .../kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt index c75e32660e..93257cdd0b 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryShareParams.kt @@ -10,7 +10,7 @@ external interface StoryShareParams { fun StoryShareParams( text: String, - widgetLink: StoryWidgetLink? + widgetLink: StoryWidgetLink? = null ): StoryShareParams { val json = json() json["text"] = text diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt index b56959cbd6..06767336a8 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/stories/StoryWidgetLink.kt @@ -9,7 +9,7 @@ external interface StoryWidgetLink { fun StoryWidgetLink( url: String, - name: String? + name: String? = null ): StoryWidgetLink { val json = json() json["url"] = url