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)
}