commonMain.builder.user.CurrentUserModifyBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-rest Show documentation
Show all versions of kord-rest Show documentation
Idiomatic Kotlin Wrapper for The Discord API
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 }
)
}