1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

add ExtendedUser

This commit is contained in:
InsanusMokrassar 2020-03-22 22:37:26 +06:00
parent 041232e260
commit 909a7fd26a
3 changed files with 19 additions and 1 deletions

View File

@ -23,6 +23,7 @@
* `PathedFile#fullUrl` now is not `inline` function * `PathedFile#fullUrl` now is not `inline` function
* `SimpleRequest#json` now is not `inline` and `internal` function * `SimpleRequest#json` now is not `inline` and `internal` function
* `FlowsUpdatesFilter` now have two additional flows: `pollAnswerFlow`, `unknownUpdateTypeFlow` * `FlowsUpdatesFilter` now have two additional flows: `pollAnswerFlow`, `unknownUpdateTypeFlow`
* `ExtendedUser` (`typealias`) was added as a `PreviewFeature`
## 0.24.0 ## 0.24.0

View File

@ -1,6 +1,8 @@
package com.github.insanusmokrassar.TelegramBotAPI.types package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PrivateChat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PrivateChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.extended.ExtendedPrivateChat
import com.github.insanusmokrassar.TelegramBotAPI.utils.PreviewFeature
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.json.JsonObjectSerializer import kotlinx.serialization.json.JsonObjectSerializer
@ -21,6 +23,9 @@ data class CommonUser(
val languageCode: String? = null val languageCode: String? = null
) : User() ) : User()
@PreviewFeature
typealias ExtendedUser = ExtendedPrivateChat
@Serializable(UserSerializer::class) @Serializable(UserSerializer::class)
sealed class Bot : User() { sealed class Bot : User() {
abstract override val username: Username abstract override val username: Username

View File

@ -1,7 +1,19 @@
package com.github.insanusmokrassar.TelegramBotAPI.utils package com.github.insanusmokrassar.TelegramBotAPI.utils
@RequiresOptIn( @RequiresOptIn(
"It is possible, that bevahiour of this thing will be changed later", "It is possible, that behaviour of this thing will be changed later",
RequiresOptIn.Level.WARNING RequiresOptIn.Level.WARNING
) )
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.FIELD,
AnnotationTarget.PROPERTY,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.FUNCTION,
AnnotationTarget.TYPE,
AnnotationTarget.TYPEALIAS,
AnnotationTarget.TYPE_PARAMETER
)
annotation class PreviewFeature annotation class PreviewFeature