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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user