mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-10-25 22:16:58 +00:00
Add EphemeralChatId and identifier-sourced ephemeral defaults
New EphemeralChatId inheritor of IdChatIdentifier carrying receiverUser and ephemeralMessageId (mirroring ChatIdWithThreadId), with ChatIdentifier.receiverUser/ ephemeralMessageId extensions like ChatIdentifier.threadId. Every send/reply/edit/ delete method that takes receiverUserId/ephemeralMessageId now defaults them from the chat identifier, so passing an EphemeralChatId auto-fills them the same way a ChatIdWithThreadId fills threadId. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bc52be7b40
commit
a1d2ebb4dc
48 files changed
+560
-388
No files matched your search
+7
@@ -43,6 +43,7 @@ import dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited
|
||||
import dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest
|
||||
import dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers
|
||||
import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged
|
||||
import dev.inmo.tgbotapi.types.EphemeralChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult
|
||||
@@ -3126,6 +3127,12 @@ public inline fun ChatIdentifier.businessChatIdOrThrow(): BusinessChatId = this
|
||||
|
||||
public inline fun <T> ChatIdentifier.ifBusinessChatId(block: (BusinessChatId) -> T): T? = businessChatIdOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatIdentifier.ephemeralChatIdOrNull(): EphemeralChatId? = this as? dev.inmo.tgbotapi.types.EphemeralChatId
|
||||
|
||||
public inline fun ChatIdentifier.ephemeralChatIdOrThrow(): EphemeralChatId = this as dev.inmo.tgbotapi.types.EphemeralChatId
|
||||
|
||||
public inline fun <T> ChatIdentifier.ifEphemeralChatId(block: (EphemeralChatId) -> T): T? = ephemeralChatIdOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatIdentifier.usernameOrNull(): Username? = this as? dev.inmo.tgbotapi.types.Username
|
||||
|
||||
public inline fun ChatIdentifier.usernameOrThrow(): Username = this as dev.inmo.tgbotapi.types.Username
|
||||
|
||||
Reference in new issue
Block a user