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

RawChat boilerplate was removed and replaced by serializers

This commit is contained in:
2019-08-12 15:41:07 +06:00
parent d6bb14e342
commit 1f62c8cf98
17 changed files with 168 additions and 138 deletions

View File

@@ -3,7 +3,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.RawChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ExtendedChatSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.extended.ExtendedChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
@@ -11,7 +12,7 @@ import kotlinx.serialization.*
data class GetChat(
@SerialName(chatIdField)
override val chatId: ChatIdentifier
): ChatRequest, SimpleRequest<RawChat> {
): ChatRequest, SimpleRequest<ExtendedChat> {
override fun method(): String = "getChat"
override fun resultSerializer(): KSerializer<RawChat> = RawChat.serializer()
override fun resultSerializer(): KSerializer<ExtendedChat> = ExtendedChatSerializer
}