All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.builder.user.CurrentUserModifyBuilder.kt Maven / Gradle / Ivy

The newest version!
package dev.kord.rest.builder.user

import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.delegate.delegate
import dev.kord.common.entity.optional.map
import dev.kord.rest.Image
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.CurrentUserModifyRequest

@KordDsl
public class CurrentUserModifyBuilder : RequestBuilder {

    private var _username: Optional = Optional.Missing()
    public var username: String? by ::_username.delegate()

    private var _avatar: Optional = Optional.Missing()
    public var avatar: Image? by ::_avatar.delegate()

    override fun toRequest(): CurrentUserModifyRequest = CurrentUserModifyRequest(
        _username, _avatar.map { it.dataUri }
    )

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy