mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
ForwardFromSupergroupInfo
This commit is contained in:
parent
403aa684a8
commit
70b592baad
@ -44,6 +44,9 @@
|
|||||||
|
|
||||||
### 0.28.5
|
### 0.28.5
|
||||||
|
|
||||||
|
* `TelegramBotAPI-core`:
|
||||||
|
* Now in forward info you can get `ForwardFromSupergroupInfo`
|
||||||
|
|
||||||
### 0.28.4
|
### 0.28.4
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.ChannelChat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.ChannelChat
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat
|
||||||
|
|
||||||
sealed class ForwardInfo {
|
sealed class ForwardInfo {
|
||||||
abstract val dateOfOriginal: TelegramDate
|
abstract val dateOfOriginal: TelegramDate
|
||||||
@ -23,3 +24,9 @@ data class ForwardFromChannelInfo(
|
|||||||
val channelChat: ChannelChat,
|
val channelChat: ChannelChat,
|
||||||
val signature: String? = null
|
val signature: String? = null
|
||||||
) : ForwardInfo()
|
) : ForwardInfo()
|
||||||
|
|
||||||
|
data class ForwardFromSupergroupInfo(
|
||||||
|
override val dateOfOriginal: TelegramDate,
|
||||||
|
val messageId: MessageIdentifier,
|
||||||
|
val group: SupergroupChat
|
||||||
|
) : ForwardInfo()
|
||||||
|
@ -153,6 +153,11 @@ internal data class RawMessage(
|
|||||||
forward_from_chat,
|
forward_from_chat,
|
||||||
forward_signature
|
forward_signature
|
||||||
)
|
)
|
||||||
|
forward_from_chat is SupergroupChat -> ForwardFromSupergroupInfo(
|
||||||
|
forward_date,
|
||||||
|
forward_from_message_id ?: error("Channel forwarded message must contain message id, but was not"),
|
||||||
|
forward_from_chat
|
||||||
|
)
|
||||||
forward_from != null -> UserForwardInfo(
|
forward_from != null -> UserForwardInfo(
|
||||||
forward_date,
|
forward_date,
|
||||||
forward_from
|
forward_from
|
||||||
|
Loading…
Reference in New Issue
Block a user