improvements in same-notations

This commit is contained in:
InsanusMokrassar committed 2023-03-16 19:29:35 +06:00
1 parent f8bbfa2b1e
commit 0eba0c4e15
5 files changed
+155 -30

No files matched your search

@@ -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
}
@@ -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
}