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

add opportunity to create Hex from rgb

This commit is contained in:
InsanusMokrassar 2023-09-25 16:26:27 +06:00
parent 88f6b349ea
commit c92ed92f7c
2 changed files with 19 additions and 17 deletions

View File

@ -15,37 +15,37 @@ data class PromoteChatMember(
@SerialName(userIdField) @SerialName(userIdField)
override val userId: UserId, override val userId: UserId,
@SerialName(untilDateField) @SerialName(untilDateField)
override val untilDate: TelegramDate?, override val untilDate: TelegramDate? = null,
@SerialName(isAnonymousField) @SerialName(isAnonymousField)
private val isAnonymous: Boolean?, private val isAnonymous: Boolean? = null,
@SerialName(canChangeInfoField) @SerialName(canChangeInfoField)
private val canChangeInfo: Boolean?, private val canChangeInfo: Boolean? = null,
@SerialName(canPostMessagesField) @SerialName(canPostMessagesField)
private val canPostMessages: Boolean?, private val canPostMessages: Boolean? = null,
@SerialName(canEditMessagesField) @SerialName(canEditMessagesField)
private val canEditMessages: Boolean?, private val canEditMessages: Boolean? = null,
@SerialName(canDeleteMessagesField) @SerialName(canDeleteMessagesField)
private val canDeleteMessages: Boolean?, private val canDeleteMessages: Boolean? = null,
@SerialName(canInviteUsersField) @SerialName(canInviteUsersField)
private val canInviteUsers: Boolean?, private val canInviteUsers: Boolean? = null,
@SerialName(canRestrictMembersField) @SerialName(canRestrictMembersField)
private val canRestrictMembers: Boolean?, private val canRestrictMembers: Boolean? = null,
@SerialName(canPinMessagesField) @SerialName(canPinMessagesField)
private val canPinMessages: Boolean?, private val canPinMessages: Boolean? = null,
@SerialName(canPromoteMembersField) @SerialName(canPromoteMembersField)
private val canPromoteMembers: Boolean?, private val canPromoteMembers: Boolean? = null,
@SerialName(canManageVideoChatsField) @SerialName(canManageVideoChatsField)
private val canManageVideoChats: Boolean?, private val canManageVideoChats: Boolean? = null,
@SerialName(canManageChatField) @SerialName(canManageChatField)
private val canManageChat: Boolean?, private val canManageChat: Boolean? = null,
@SerialName(canManageTopicsField) @SerialName(canManageTopicsField)
private val canManageTopics: Boolean?, private val canManageTopics: Boolean? = null,
@SerialName(canPostStoriesField) @SerialName(canPostStoriesField)
private val canPostStories: Boolean?, private val canPostStories: Boolean? = null,
@SerialName(canEditStoriesField) @SerialName(canEditStoriesField)
private val canEditStories: Boolean?, private val canEditStories: Boolean? = null,
@SerialName(canDeleteStoriesField) @SerialName(canDeleteStoriesField)
private val canDeleteStories: Boolean? private val canDeleteStories: Boolean? = null
) : ChatMemberRequest<Boolean>, UntilDate { ) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "promoteChatMember" override fun method(): String = "promoteChatMember"
override val resultDeserializer: DeserializationStrategy<Boolean> override val resultDeserializer: DeserializationStrategy<Boolean>

View File

@ -8,7 +8,9 @@ sealed interface Color {
value class BackgroundColor(override val value: String) : Color value class BackgroundColor(override val value: String) : Color
@Serializable @Serializable
value class Hex(override val value: String) : Color value class Hex(override val value: String) : Color {
constructor(r: UByte, g: UByte, b: UByte) : this("#${r.toString(16)}${g.toString(16)}${b.toString(16)}")
}
companion object { companion object {
val BackgroundColor = BackgroundColor("bg_color") val BackgroundColor = BackgroundColor("bg_color")