mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-16 05:40:32 +00:00
add ChatJoinRequest
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.FromUser
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ChatJoinRequest(
|
||||
@SerialName(chatField)
|
||||
val chat: PublicChat,
|
||||
@SerialName(userField)
|
||||
override val from: User,
|
||||
@SerialName(dateField)
|
||||
val date: TelegramDate,
|
||||
@SerialName(bioField)
|
||||
val bio: String,
|
||||
@SerialName(inviteLinkField)
|
||||
val inviteLink: ChatInviteLink
|
||||
) : FromUser
|
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.update
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.UpdateIdentifier
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
data class ChatJoinRequestUpdate(
|
||||
override val updateId: UpdateIdentifier,
|
||||
override val data: ChatJoinRequest
|
||||
) : Update
|
@@ -35,7 +35,8 @@ internal data class RawUpdate constructor(
|
||||
private val poll: Poll? = null,
|
||||
private val poll_answer: PollAnswer? = null,
|
||||
private val my_chat_member: ChatMemberUpdated? = null,
|
||||
private val chat_member: ChatMemberUpdated? = null
|
||||
private val chat_member: ChatMemberUpdated? = null,
|
||||
private val chat_join_request: ChatJoinRequest? = null
|
||||
) {
|
||||
private var initedUpdate: Update? = null
|
||||
/**
|
||||
@@ -61,6 +62,7 @@ internal data class RawUpdate constructor(
|
||||
poll_answer != null -> PollAnswerUpdate(updateId, poll_answer)
|
||||
my_chat_member != null -> MyChatMemberUpdatedUpdate(updateId, my_chat_member)
|
||||
chat_member != null -> CommonChatMemberUpdatedUpdate(updateId, chat_member)
|
||||
chat_join_request != null -> ChatJoinRequestUpdate(updateId, chat_join_request)
|
||||
else -> UnknownUpdate(
|
||||
updateId,
|
||||
raw.toString(),
|
||||
|
@@ -32,6 +32,7 @@ interface FlowsUpdatesFilter : UpdatesFilter {
|
||||
val pollAnswersFlow: Flow<PollAnswerUpdate>
|
||||
val chatMemberUpdatesFlow: Flow<CommonChatMemberUpdatedUpdate>
|
||||
val myChatMemberUpdatesFlow: Flow<MyChatMemberUpdatedUpdate>
|
||||
val chatJoinRequestUpdateFlow: Flow<ChatJoinRequestUpdate>
|
||||
val unknownUpdatesFlow: Flow<UnknownUpdate>
|
||||
}
|
||||
|
||||
@@ -62,6 +63,7 @@ abstract class AbstractFlowsUpdatesFilter : FlowsUpdatesFilter {
|
||||
override val pollAnswersFlow: Flow<PollAnswerUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val chatMemberUpdatesFlow: Flow<CommonChatMemberUpdatedUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val myChatMemberUpdatesFlow: Flow<MyChatMemberUpdatedUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val chatJoinRequestUpdateFlow: Flow<ChatJoinRequestUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val unknownUpdatesFlow: Flow<UnknownUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user