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

commonMain.builder.member.MemberAddBuilder.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
package dev.kord.rest.builder.member

import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalBoolean
import dev.kord.common.entity.optional.delegate.delegate
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.GuildMemberAddRequest

@KordDsl
public class MemberAddBuilder(public var token: String) : RequestBuilder {

    private var _nickname: Optional = Optional.Missing()
    public var nickname: String? by ::_nickname.delegate()

    public var roles: MutableSet = mutableSetOf()

    private var _muted: OptionalBoolean = OptionalBoolean.Missing
    public var muted: Boolean? by ::_muted.delegate()

    private var _deafened: OptionalBoolean = OptionalBoolean.Missing
    public var deafened: Boolean? by ::_deafened.delegate()

    override fun toRequest(): GuildMemberAddRequest = GuildMemberAddRequest(
        token, _nickname, Optional.missingOnEmpty(roles), mute = _muted, deaf = _deafened
    )

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy