From 799ad6ca66019a8f1abf41b7781cf75619664329 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 1 Aug 2024 17:38:16 +0600 Subject: [PATCH] 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() +}