mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-09-13 19:44:18 +00:00
Compare commits
21 Commits
8a6e06bbf0
...
v15.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 96bbf5fc81 | |||
| 8e3e44769e | |||
| 2d11685b7b | |||
| 8bb3095fb1 | |||
| 799ad6ca66 | |||
| bd6ff747cb | |||
| 010c52adeb | |||
| 88008b7cfc | |||
| 42b32af986 | |||
| 4944c972a6 | |||
| 83445dd314 | |||
| 53ae56e887 | |||
| 1c587abcdc | |||
| 99f95ffc40 | |||
| a8ed162c9c | |||
| e5ea980347 | |||
| 4ce26c707e | |||
| 4343dbbde8 | |||
| cdecce96e7 | |||
|
|
40613e3418 | ||
|
|
016cfcb7cd |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,6 +1,26 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 15.1.1
|
||||
## 15.3.0
|
||||
|
||||
**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
|
||||
|
||||
* `API`:
|
||||
* Enabled an `explicit mode` for `API` module ([PR #876](https://github.com/InsanusMokrassar/ktgbotapi/pull/876))
|
||||
* `WebApps`:
|
||||
* Built-in `onClick` and `offClick` of `MainButton` become public ([PR #875](https://github.com/InsanusMokrassar/ktgbotapi/pull/875))
|
||||
* Old `MainButton.onClick` extension **has been removed** to avoid collisions of types
|
||||
|
||||
## 15.1.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-7-2024)
|
||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-31-2024)
|
||||
|
||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||
|
||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=15.1.1
|
||||
library_version=15.3.0
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JZLkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (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 <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (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;
|
||||
@@ -4689,7 +4692,12 @@ public abstract interface class dev/inmo/tgbotapi/requests/send/SendLocation : d
|
||||
public abstract fun method ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Companion {
|
||||
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Companion : kotlinx/serialization/KSerializer {
|
||||
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendLocation;)V
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
@@ -4702,6 +4710,7 @@ public final class dev/inmo/tgbotapi/requests/send/SendLocation$DefaultImpls {
|
||||
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Live : dev/inmo/tgbotapi/requests/send/SendLocation {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendLocation$Live$Companion;
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
|
||||
public final fun component10 ()Z
|
||||
public final fun component11 ()Z
|
||||
@@ -4760,6 +4769,7 @@ public final class dev/inmo/tgbotapi/requests/send/SendLocation$Live$Companion {
|
||||
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Static : dev/inmo/tgbotapi/requests/send/SendLocation {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendLocation$Static$Companion;
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
|
||||
public final fun component10 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
|
||||
public final fun component2 ()D
|
||||
@@ -8546,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;
|
||||
@@ -14508,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 <init> (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 <init> (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 <init> (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 <init> (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;
|
||||
@@ -14524,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;
|
||||
@@ -14534,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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<Boolean>, MessageAction, DisableNotification {
|
||||
): ChatRequest, SimpleRequest<Boolean>, MessageAction, DisableNotification, OptionallyBusinessConnectionRequest {
|
||||
override fun method(): String = "pinChatMessage"
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
|
||||
@@ -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<Boolean> {
|
||||
val messageId: MessageId? = null,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = null
|
||||
): ChatRequest, SimpleRequest<Boolean>, OptionallyBusinessConnectionRequest {
|
||||
override fun method(): String = "unpinChatMessage"
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
|
||||
@@ -11,6 +11,9 @@ import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializ
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.utils.throwRangeError
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
|
||||
|
||||
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<LocationContent>>
|
||||
@@ -102,7 +105,7 @@ fun SendLiveLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@Serializable(SendLocation.Companion::class)
|
||||
sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<ContentMessage<T>>,
|
||||
ReplyingMarkupSendMessageRequest<ContentMessage<T>>,
|
||||
PositionedSendMessageRequest<ContentMessage<T>>,
|
||||
@@ -113,7 +116,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override fun method(): String = "sendLocation"
|
||||
|
||||
@Serializable
|
||||
data class Live internal constructor(
|
||||
data class Live (
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(latitudeField)
|
||||
@@ -121,6 +124,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@SerialName(longitudeField)
|
||||
override val longitude: Double,
|
||||
@SerialName(livePeriodField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val livePeriod: Seconds = LiveLocation.INDEFINITE_LIVE_PERIOD,
|
||||
@SerialName(horizontalAccuracyField)
|
||||
override val horizontalAccuracy: Meters? = null,
|
||||
@@ -129,8 +134,12 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@SerialName(proximityAlertRadiusField)
|
||||
override val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@@ -146,7 +155,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override val resultDeserializer: DeserializationStrategy<ContentMessage<LiveLocationContent>>
|
||||
get() = liveResultDeserializer
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = Live.serializer()
|
||||
get() = serializer()
|
||||
|
||||
init {
|
||||
if (livePeriod !in livePeriodLimit) {
|
||||
@@ -159,7 +168,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class Static internal constructor(
|
||||
data class Static (
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@SerialName(latitudeField)
|
||||
@@ -167,8 +176,12 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@SerialName(longitudeField)
|
||||
override val longitude: Double,
|
||||
@SerialName(messageThreadIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@@ -194,4 +207,98 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
|
||||
companion object : KSerializer<SendLocation<*>> {
|
||||
@Serializable
|
||||
private class Surrogate(
|
||||
@SerialName(chatIdField)
|
||||
val chatId: ChatIdentifier,
|
||||
@SerialName(latitudeField)
|
||||
val latitude: Double,
|
||||
@SerialName(longitudeField)
|
||||
val longitude: Double,
|
||||
@SerialName(livePeriodField)
|
||||
val livePeriod: Seconds? = null,
|
||||
@SerialName(horizontalAccuracyField)
|
||||
val horizontalAccuracy: Meters? = null,
|
||||
@SerialName(headingField)
|
||||
val heading: Degrees? = null,
|
||||
@SerialName(proximityAlertRadiusField)
|
||||
val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
val protectContent: Boolean = false,
|
||||
@SerialName(messageEffectIdField)
|
||||
val effectId: EffectId? = null,
|
||||
@SerialName(replyParametersField)
|
||||
val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
val replyMarkup: KeyboardMarkup? = null
|
||||
)
|
||||
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = Surrogate.serializer().descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): SendLocation<*> {
|
||||
val surrogate = Surrogate.serializer().deserialize(decoder)
|
||||
|
||||
return when (surrogate.livePeriod) {
|
||||
null -> Static(
|
||||
chatId = surrogate.chatId,
|
||||
latitude = surrogate.latitude,
|
||||
longitude = surrogate.longitude,
|
||||
threadId = surrogate.threadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
effectId = surrogate.effectId,
|
||||
replyParameters = surrogate.replyParameters,
|
||||
replyMarkup = surrogate.replyMarkup
|
||||
)
|
||||
else -> Live(
|
||||
chatId = surrogate.chatId,
|
||||
latitude = surrogate.latitude,
|
||||
longitude = surrogate.longitude,
|
||||
livePeriod = surrogate.livePeriod,
|
||||
horizontalAccuracy = surrogate.horizontalAccuracy,
|
||||
heading = surrogate.heading,
|
||||
proximityAlertRadius = surrogate.proximityAlertRadius,
|
||||
threadId = surrogate.threadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
effectId = surrogate.effectId,
|
||||
replyParameters = surrogate.replyParameters,
|
||||
replyMarkup = surrogate.replyMarkup
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: SendLocation<*>) {
|
||||
val surrogate = with(value) {
|
||||
Surrogate(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
}
|
||||
Surrogate.serializer().serialize(encoder, surrogate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -119,7 +119,7 @@ data class LiveLocationContent(
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
) as SendMessageRequest<ContentMessage<LiveLocationContent>>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,5 +150,5 @@ data class StaticLocationContent(
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
) as SendMessageRequest<ContentMessage<StaticLocationContent>>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,8 +22,11 @@ external class MainButton {
|
||||
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
|
||||
fun hideProgress(): MainButton
|
||||
|
||||
internal fun onClick(eventHandler: () -> Unit): MainButton
|
||||
internal fun offClick(eventHandler: () -> Unit): MainButton
|
||||
/**
|
||||
* **This method argument do not accept `this` [WebApp] object**
|
||||
*/
|
||||
fun onClick(eventHandler: () -> Unit): MainButton
|
||||
fun offClick(eventHandler: () -> Unit): MainButton
|
||||
|
||||
internal fun setParams(params: Json): MainButton
|
||||
}
|
||||
@@ -36,11 +39,6 @@ data class MainButtonParams(
|
||||
val isVisible: Boolean? = null
|
||||
)
|
||||
|
||||
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
|
||||
val that = js("this").unsafeCast<WebApp>()
|
||||
that.eventHandler()
|
||||
}
|
||||
|
||||
fun MainButton.setParams(params: MainButtonParams) = setParams(
|
||||
json(
|
||||
*listOfNotNull(
|
||||
|
||||
@@ -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? = definedExternally)
|
||||
|
||||
fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally)
|
||||
fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.tgbotapi.webapps.stories
|
||||
|
||||
import kotlin.js.json
|
||||
|
||||
external interface StoryShareParams {
|
||||
val text: String
|
||||
@JsName("widget_link")
|
||||
val widgetLink: StoryWidgetLink?
|
||||
}
|
||||
|
||||
fun StoryShareParams(
|
||||
text: String,
|
||||
widgetLink: StoryWidgetLink? = null
|
||||
): StoryShareParams {
|
||||
val json = json()
|
||||
json["text"] = text
|
||||
widgetLink ?.let { json["widget_link"] = it }
|
||||
return json.unsafeCast<StoryShareParams>()
|
||||
}
|
||||
@@ -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? = null
|
||||
): StoryWidgetLink {
|
||||
val json = json()
|
||||
json["url"] = url
|
||||
name ?.let { json["name"] = it }
|
||||
return json.unsafeCast<StoryWidgetLink>()
|
||||
}
|
||||
Reference in New Issue
Block a user