1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

extract and deprecate MessageIdentifier

This commit is contained in:
InsanusMokrassar 2024-03-16 20:41:36 +06:00
parent 009c49247d
commit 08b0564dba
5 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
* `Core`:
* `MessageId` now is `value class`
* `MessageId` now is `value class`. `MessageIdentifier` become deprecated
* `MessageThreadId` now is `value class`
* `InlineQueryIdentifier` now is `value class`
* `MediaGroupIdentifier` now is `value class`

View File

@ -10,7 +10,6 @@ import kotlinx.serialization.encoding.Encoder
import kotlin.jvm.JvmInline
typealias Identifier = Long
typealias MessageIdentifier = MessageId
typealias ForwardSignature = String
typealias ForwardSenderName = String
typealias AuthorSignature = ForwardSignature

View File

@ -32,3 +32,6 @@ value class MessageId(
)
fun Long.asTelegramMessageId() = MessageId(this)
@Deprecated("Renamed", ReplaceWith("MessageId", "dev.inmo.tgbotapi.types.MessageId"))
typealias MessageIdentifier = MessageId

View File

@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.abstracts.WithPreviewChat
import dev.inmo.tgbotapi.abstracts.WithPreviewChatAndMessageId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.reactions.Reaction
@ -28,7 +27,7 @@ sealed interface ChatMessageReactionUpdated : WithPreviewChatAndMessageId {
@SerialName(chatField)
override val chat: PreviewChat,
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
override val messageId: MessageId,
@SerialName(userField)
override val reactedUser: PreviewUser,
@Serializable(TelegramDateSerializer::class)
@ -48,7 +47,7 @@ sealed interface ChatMessageReactionUpdated : WithPreviewChatAndMessageId {
@SerialName(chatField)
override val chat: PreviewChat,
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
override val messageId: MessageId,
@SerialName(actorChatField)
override val reactedChat: PreviewChat,
@Serializable(TelegramDateSerializer::class)
@ -68,7 +67,7 @@ sealed interface ChatMessageReactionUpdated : WithPreviewChatAndMessageId {
@SerialName(chatField)
override val chat: PreviewChat,
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
override val messageId: MessageId,
@SerialName(actorChatField)
override val reactedChat: PreviewChat?,
@SerialName(userField)
@ -88,7 +87,7 @@ sealed interface ChatMessageReactionUpdated : WithPreviewChatAndMessageId {
@SerialName(chatField)
val chat: PreviewChat,
@SerialName(messageIdField)
val messageId: MessageIdentifier,
val messageId: MessageId,
@SerialName(userField)
val reactedUser: PreviewUser? = null,
@SerialName(actorChatField)

View File

@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.abstracts.WithPreviewChat
import dev.inmo.tgbotapi.abstracts.WithPreviewChatAndMessageId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.reactions.ReactionsCount
@ -12,7 +11,7 @@ data class ChatMessageReactionsCountUpdated(
@SerialName(chatField)
override val chat: PreviewChat,
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
override val messageId: MessageId,
@Serializable(TelegramDateSerializer::class)
@SerialName(dateField)
val date: TelegramDate,