From 2dd91f47d7a3e929786632215cf09030e9fd0125 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 2 Mar 2026 17:40:47 +0600 Subject: [PATCH] add helper method sender_tag for messages --- tgbotapi.utils/api/tgbotapi.utils.api | 1 + .../inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 66e0ab624d..22e2db5c35 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -3165,6 +3165,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/extensions/raw/MessageKt { public static final fun getReply_markup (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; public static final fun getReply_to_message (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/Message; public static final fun getSender_chat (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/chat/PreviewChat; + public static final fun getSender_tag (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ljava/lang/String; public static final fun getSticker (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/files/Sticker; public static final fun getSuccessful_payment (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/payments/SuccessfulPayment; public static final fun getSupergroup_chat_created (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Z diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt index 0a627f1aef..1b9ba7f042 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -28,6 +28,9 @@ inline val Message.from: User? inline val Message.sender_chat: PreviewChat? get() = withSenderChatMessageOrNull() ?.senderChat @RiskFeature(RawFieldsUsageWarning) +inline val Message.sender_tag: UserTag? + get() = potentiallyFromUserGroupContentMessageOrNull() ?.senderTag +@RiskFeature(RawFieldsUsageWarning) inline val Message.forward_from: User? get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asUserForwardInfo() ?.from @RiskFeature(RawFieldsUsageWarning)