1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 00:03:48 +00:00

Merge pull request #880 from InsanusMokrassar/15.3.0

15.3.0
This commit is contained in:
InsanusMokrassar 2024-08-02 16:50:09 +06:00 committed by GitHub
commit f7cf37f338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 124 additions and 47 deletions

View File

@ -1,5 +1,19 @@
# TelegramBotAPI changelog
## 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`:

View File

@ -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) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@ -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

View File

@ -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 {

View File

@ -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)

View File

@ -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)

View File

@ -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;
@ -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 <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;
@ -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;

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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"

View File

@ -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

View File

@ -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)
}

View File

@ -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>()
}

View File

@ -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>()
}