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

commonMain.builder.ban.BanCreateBuilder.kt Maven / Gradle / Ivy

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

import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.delegate.delegate
import dev.kord.rest.builder.AuditRequestBuilder
import dev.kord.rest.json.request.GuildBanCreateRequest
import kotlin.time.Duration

@KordDsl
public class BanCreateBuilder : AuditRequestBuilder {

    override var reason: String? = null

    private var _deleteMessageDuration: Optional = Optional.Missing()

    /** [Duration] to delete messages for, between 0 and 604800 seconds (7 days). */
    public var deleteMessageDuration: Duration? by ::_deleteMessageDuration.delegate()

    override fun toRequest(): GuildBanCreateRequest = GuildBanCreateRequest(
        deleteMessageSeconds = _deleteMessageDuration,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy