1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 08:37:12 +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)
override val userId: UserId,
@SerialName(untilDateField)
override val untilDate: TelegramDate?,
override val untilDate: TelegramDate? = null,
@SerialName(isAnonymousField)
private val isAnonymous: Boolean?,
private val isAnonymous: Boolean? = null,
@SerialName(canChangeInfoField)
private val canChangeInfo: Boolean?,
private val canChangeInfo: Boolean? = null,
@SerialName(canPostMessagesField)
private val canPostMessages: Boolean?,
private val canPostMessages: Boolean? = null,
@SerialName(canEditMessagesField)
private val canEditMessages: Boolean?,
private val canEditMessages: Boolean? = null,
@SerialName(canDeleteMessagesField)
private val canDeleteMessages: Boolean?,
private val canDeleteMessages: Boolean? = null,
@SerialName(canInviteUsersField)
private val canInviteUsers: Boolean?,
private val canInviteUsers: Boolean? = null,
@SerialName(canRestrictMembersField)
private val canRestrictMembers: Boolean?,
private val canRestrictMembers: Boolean? = null,
@SerialName(canPinMessagesField)
private val canPinMessages: Boolean?,
private val canPinMessages: Boolean? = null,
@SerialName(canPromoteMembersField)
private val canPromoteMembers: Boolean?,
private val canPromoteMembers: Boolean? = null,
@SerialName(canManageVideoChatsField)
private val canManageVideoChats: Boolean?,
private val canManageVideoChats: Boolean? = null,
@SerialName(canManageChatField)
private val canManageChat: Boolean?,
private val canManageChat: Boolean? = null,
@SerialName(canManageTopicsField)
private val canManageTopics: Boolean?,
private val canManageTopics: Boolean? = null,
@SerialName(canPostStoriesField)
private val canPostStories: Boolean?,
private val canPostStories: Boolean? = null,
@SerialName(canEditStoriesField)
private val canEditStories: Boolean?,
private val canEditStories: Boolean? = null,
@SerialName(canDeleteStoriesField)
private val canDeleteStories: Boolean?
private val canDeleteStories: Boolean? = null
) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "promoteChatMember"
override val resultDeserializer: DeserializationStrategy<Boolean>

View File

@ -8,7 +8,9 @@ sealed interface Color {
value class BackgroundColor(override val value: String) : Color
@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 {
val BackgroundColor = BackgroundColor("bg_color")