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

commonMain.builder.role.RolePositionsModifyBuilder.kt Maven / Gradle / Ivy

package dev.kord.rest.builder.role

import dev.kord.rest.builder.AuditRequestBuilder
import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.Snowflake
import dev.kord.rest.json.request.GuildRolePositionModifyRequest

@KordDsl
public class RolePositionsModifyBuilder : AuditRequestBuilder {
    override var reason: String? = null
    private val swaps: MutableList> = mutableListOf()

    public fun move(pair: Pair) {
        swaps += pair.first to pair.second
    }

    public fun move(vararg pairs: Pair) {
        swaps += pairs.map { it.first to it.second }
    }

    override fun toRequest(): GuildRolePositionModifyRequest =
        GuildRolePositionModifyRequest(swaps)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy