1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 15:19:30 +00:00

improve new chat member difference

This commit is contained in:
2024-08-14 22:33:11 +06:00
parent 49f7954db7
commit e9a172565e
6 changed files with 56 additions and 13 deletions

View File

@@ -170,6 +170,7 @@ import dev.inmo.tgbotapi.types.chat.member.MemberChatMember
import dev.inmo.tgbotapi.types.chat.member.OwnerChatMember
import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember
import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember
import dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember
import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType
import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType
import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType
@@ -772,6 +773,18 @@ public inline fun <T>
OptionallyWithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? =
specialRightsChatMemberOrNull() ?.let(block)
public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrNull():
SubscriptionMemberChatMember? = this as?
dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember
public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrThrow():
SubscriptionMemberChatMember = this as
dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember
public inline fun <T>
OptionallyWithUser.ifSubscriptionMemberChatMember(block: (SubscriptionMemberChatMember) -> T):
T? = subscriptionMemberChatMemberOrNull() ?.let(block)
public inline fun OptionallyWithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as?
dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent