1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-01-12 16:29:20 +00:00

make chats to support private forums

This commit is contained in:
2026-01-07 23:19:12 +06:00
parent 9713a668e2
commit cc5056b685
12 changed files with 373 additions and 22 deletions

View File

@@ -513,6 +513,7 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/get/GetChatKt {
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/GroupChatImpl;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PrivateChat;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PrivateChatImpl;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PrivateForumChatImpl;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/SupergroupChat;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getChat (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/SupergroupChatImpl;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@@ -117,6 +117,17 @@ public suspend fun TelegramBot.getChat(
chat: PrivateChatImpl
): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPrivateForumChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
*/
@PreviewFeature
public suspend fun TelegramBot.getChat(
chat: PrivateForumChatImpl
): ExtendedPrivateForumChatImpl = getChat(chat.id) as ExtendedPrivateForumChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedUser] with unsafe operator "as"