1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

add via_bot

This commit is contained in:
InsanusMokrassar 2020-06-05 13:38:05 +06:00
parent e6430a729c
commit 835b8b34f9
5 changed files with 22 additions and 8 deletions

View File

@ -51,6 +51,11 @@
### 0.27.6 ### 0.27.6
* `TelegramBotAPI`:
* Interface `PossiblySentViaBot` has been added
* Currently, only `ChannelMessage` and `CommonMessageImpl` are implementing interface `PossiblySentViaBot`. It
could be changed in future
### 0.27.5 ### 0.27.5
* `Common`: * `Common`:

View File

@ -1,11 +1,9 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message package com.github.insanusmokrassar.TelegramBotAPI.types.message
import com.github.insanusmokrassar.TelegramBotAPI.types.AuthorSignature import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
import com.soywiz.klock.DateTime import com.soywiz.klock.DateTime
@ -18,5 +16,6 @@ data class ChannelMessage<T: MessageContent>(
override val forwardInfo: ForwardInfo?, override val forwardInfo: ForwardInfo?,
override val replyTo: Message?, override val replyTo: Message?,
override val replyMarkup: InlineKeyboardMarkup?, override val replyMarkup: InlineKeyboardMarkup?,
override val senderBot: CommonBot?,
val authorSignature: AuthorSignature? val authorSignature: AuthorSignature?
) : CommonMessage<T> ) : CommonMessage<T>, PossiblySentViaBot

View File

@ -1,7 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message package com.github.insanusmokrassar.TelegramBotAPI.types.message
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.User
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
@ -19,5 +18,6 @@ data class CommonMessageImpl<T: MessageContent>(
override val forwardInfo: ForwardInfo?, override val forwardInfo: ForwardInfo?,
override val replyTo: Message?, override val replyTo: Message?,
override val replyMarkup: InlineKeyboardMarkup?, override val replyMarkup: InlineKeyboardMarkup?,
override val senderBot: CommonBot?,
val paymentInfo: SuccessfulPaymentInfo? val paymentInfo: SuccessfulPaymentInfo?
) : Message, CommonMessage<T>, FromUserMessage ) : Message, CommonMessage<T>, PossiblySentViaBot, FromUserMessage

View File

@ -42,6 +42,7 @@ internal data class RawMessage(
private val forward_sender_name: ForwardSenderName? = null, private val forward_sender_name: ForwardSenderName? = null,
private val forward_date: TelegramDate? = null, private val forward_date: TelegramDate? = null,
private val reply_to_message: RawMessage? = null, private val reply_to_message: RawMessage? = null,
private val via_bot: CommonBot? = null,
private val edit_date: TelegramDate? = null, private val edit_date: TelegramDate? = null,
private val media_group_id: MediaGroupIdentifier? = null, private val media_group_id: MediaGroupIdentifier? = null,
private val author_signature: AuthorSignature? = null, private val author_signature: AuthorSignature? = null,
@ -255,6 +256,7 @@ internal data class RawMessage(
forwarded, forwarded,
reply_to_message?.asMessage, reply_to_message?.asMessage,
reply_markup, reply_markup,
via_bot,
author_signature author_signature
) )
else -> CommonMessageImpl( else -> CommonMessageImpl(
@ -268,6 +270,7 @@ internal data class RawMessage(
forwarded, forwarded,
reply_to_message?.asMessage, reply_to_message?.asMessage,
reply_markup, reply_markup,
via_bot,
paymentInfo paymentInfo
) )
} }

View File

@ -0,0 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.types.CommonBot
interface PossiblySentViaBot {
val senderBot: CommonBot?
}