mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
reply_markup in messages
This commit is contained in:
parent
5bc3169578
commit
4570df330b
@ -3,6 +3,7 @@
|
|||||||
## 0.16.0 Bot API 4.3
|
## 0.16.0 Bot API 4.3
|
||||||
|
|
||||||
* `LoginURL` and `LoginURLInlineKeyboardButton` has been added
|
* `LoginURL` and `LoginURLInlineKeyboardButton` has been added
|
||||||
|
* `replyMarkup` field was added to the `CommonMessage` objects via `AbleToBeMarkedUp` interface
|
||||||
|
|
||||||
## 0.15.0
|
## 0.15.0
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
|
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.MediaGroupMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||||
@ -16,5 +17,6 @@ data class ChannelMediaGroupMessage(
|
|||||||
override val content: MediaGroupContent,
|
override val content: MediaGroupContent,
|
||||||
override val editDate: DateTime?,
|
override val editDate: DateTime?,
|
||||||
override val forwarded: ForwardedMessage?,
|
override val forwarded: ForwardedMessage?,
|
||||||
override val replyTo: Message?
|
override val replyTo: Message?,
|
||||||
|
override val replyMarkup: InlineKeyboardMarkup?
|
||||||
) : MediaGroupMessage
|
) : MediaGroupMessage
|
||||||
|
@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.AuthorSignature
|
import com.github.insanusmokrassar.TelegramBotAPI.types.AuthorSignature
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
|
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.CommonMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||||
@ -16,5 +17,6 @@ data class ChannelMessage<T: MessageContent>(
|
|||||||
override val editDate: DateTime?,
|
override val editDate: DateTime?,
|
||||||
override val forwarded: ForwardedMessage?,
|
override val forwarded: ForwardedMessage?,
|
||||||
override val replyTo: Message?,
|
override val replyTo: Message?,
|
||||||
|
override val replyMarkup: InlineKeyboardMarkup?,
|
||||||
val authorSignature: AuthorSignature?
|
val authorSignature: AuthorSignature?
|
||||||
) : CommonMessage<T>
|
) : CommonMessage<T>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
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.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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
|
||||||
@ -15,5 +16,6 @@ data class CommonMediaGroupMessage(
|
|||||||
override val content: MediaGroupContent,
|
override val content: MediaGroupContent,
|
||||||
override val editDate: DateTime?,
|
override val editDate: DateTime?,
|
||||||
override val forwarded: ForwardedMessage?,
|
override val forwarded: ForwardedMessage?,
|
||||||
override val replyTo: Message?
|
override val replyTo: Message?,
|
||||||
|
override val replyMarkup: InlineKeyboardMarkup?
|
||||||
) : MediaGroupMessage, FromUserMessage
|
) : MediaGroupMessage, FromUserMessage
|
||||||
|
@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
||||||
|
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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
||||||
@ -17,5 +18,6 @@ data class CommonMessageImpl<T: MessageContent>(
|
|||||||
override val editDate: DateTime?,
|
override val editDate: DateTime?,
|
||||||
override val forwarded: ForwardedMessage?,
|
override val forwarded: ForwardedMessage?,
|
||||||
override val replyTo: Message?,
|
override val replyTo: Message?,
|
||||||
|
override val replyMarkup: InlineKeyboardMarkup?,
|
||||||
val paymentInfo: PaymentInfo?
|
val paymentInfo: PaymentInfo?
|
||||||
) : Message, CommonMessage<T>, FromUserMessage
|
) : Message, CommonMessage<T>, FromUserMessage
|
@ -3,6 +3,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.MessageEntity.RawMessageEntities
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntities
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntitiesSerializer
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntitiesSerializer
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
|
||||||
@ -82,7 +83,9 @@ data class RawMessage(
|
|||||||
private val connected_website: String? = null,
|
private val connected_website: String? = null,
|
||||||
|
|
||||||
// passport property
|
// passport property
|
||||||
private val passport_data: Unit? = null
|
private val passport_data: Unit? = null,
|
||||||
|
|
||||||
|
private val reply_markup: InlineKeyboardMarkup? = null
|
||||||
) {
|
) {
|
||||||
@Transient
|
@Transient
|
||||||
private val content: MessageContent? by lazy {
|
private val content: MessageContent? by lazy {
|
||||||
@ -227,7 +230,8 @@ data class RawMessage(
|
|||||||
},
|
},
|
||||||
edit_date ?.asDate,
|
edit_date ?.asDate,
|
||||||
forwarded,
|
forwarded,
|
||||||
reply_to_message ?.asMessage
|
reply_to_message ?.asMessage,
|
||||||
|
reply_markup
|
||||||
)
|
)
|
||||||
else -> CommonMediaGroupMessage(
|
else -> CommonMediaGroupMessage(
|
||||||
messageId,
|
messageId,
|
||||||
@ -242,7 +246,8 @@ data class RawMessage(
|
|||||||
},
|
},
|
||||||
edit_date ?.asDate,
|
edit_date ?.asDate,
|
||||||
forwarded,
|
forwarded,
|
||||||
reply_to_message ?.asMessage
|
reply_to_message ?.asMessage,
|
||||||
|
reply_markup
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: when (chat) {
|
} ?: when (chat) {
|
||||||
@ -254,6 +259,7 @@ data class RawMessage(
|
|||||||
edit_date ?.asDate,
|
edit_date ?.asDate,
|
||||||
forwarded,
|
forwarded,
|
||||||
reply_to_message ?.asMessage,
|
reply_to_message ?.asMessage,
|
||||||
|
reply_markup,
|
||||||
author_signature
|
author_signature
|
||||||
)
|
)
|
||||||
else -> CommonMessageImpl(
|
else -> CommonMessageImpl(
|
||||||
@ -265,6 +271,7 @@ data class RawMessage(
|
|||||||
edit_date ?.asDate,
|
edit_date ?.asDate,
|
||||||
forwarded,
|
forwarded,
|
||||||
reply_to_message ?.asMessage,
|
reply_to_message ?.asMessage,
|
||||||
|
reply_markup,
|
||||||
paymentInfo
|
paymentInfo
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
interface AbleToBeMarkedUp {
|
||||||
|
val replyMarkup: InlineKeyboardMarkup?
|
||||||
|
}
|
@ -6,4 +6,5 @@ interface CommonMessage<T: MessageContent> : Message,
|
|||||||
AbleToBeForwardedMessage,
|
AbleToBeForwardedMessage,
|
||||||
AbleToBeEditedMessage,
|
AbleToBeEditedMessage,
|
||||||
AbleToReplyMessage,
|
AbleToReplyMessage,
|
||||||
|
AbleToBeMarkedUp,
|
||||||
ContentMessage<T>
|
ContentMessage<T>
|
||||||
|
Loading…
Reference in New Issue
Block a user