1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-16 13:49:26 +00:00

improvements in same-notations

This commit is contained in:
2023-03-16 19:29:35 +06:00
parent f8bbfa2b1e
commit 0eba0c4e15
5 changed files with 155 additions and 30 deletions

View File

@@ -0,0 +1,10 @@
package dev.inmo.tgbotapi.abstracts
import dev.inmo.tgbotapi.types.chat.Chat
/**
* All inheritors of this interface have [chat] field and related to this [chat]
*/
interface WithChat {
val chat: Chat
}

View File

@@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.types.message.abstracts
import com.soywiz.klock.DateTime
import dev.inmo.tgbotapi.abstracts.WithChat
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
@@ -11,9 +12,8 @@ import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
@ClassCastsIncluded
interface Message {
interface Message : WithChat {
val messageId: MessageId
val chat: Chat
val date: DateTime
}