commonMain.builder.interaction.ApplicationCommandBuilders.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.interaction
import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.ApplicationCommandType
import dev.kord.common.entity.Permissions
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.ApplicationCommandCreateRequest
import dev.kord.rest.json.request.ApplicationCommandModifyRequest
@KordDsl
public interface ApplicationCommandCreateBuilder : LocalizedNameCreateBuilder,
RequestBuilder {
public var defaultMemberPermissions: Permissions?
@Deprecated("'defaultPermission' is deprecated in favor of 'defaultMemberPermissions' and 'dmPermission'. Setting 'defaultPermission' to false can be replaced by setting 'defaultMemberPermissions' to empty Permissions and 'dmPermission' to false ('dmPermission' is only available for global commands).")
public var defaultPermission: Boolean?
public val type: ApplicationCommandType
/**
* Disables the command for everyone except admins by default.
*
* **This does not ensure normal users cannot execute the command, any admin can change this setting.**
*/
public fun disableCommandInGuilds() {
defaultMemberPermissions = Permissions()
}
/** Indicates whether the command is age-restricted. Defaults to `false`. */
public var nsfw: Boolean?
}
@KordDsl
public interface GlobalApplicationCommandCreateBuilder : ApplicationCommandCreateBuilder {
public var dmPermission: Boolean?
}
@KordDsl
public interface GlobalApplicationCommandModifyBuilder : ApplicationCommandModifyBuilder {
public var dmPermission: Boolean?
}
@KordDsl
public interface ApplicationCommandModifyBuilder : LocalizedNameModifyBuilder,
RequestBuilder {
public var defaultMemberPermissions: Permissions?
@Deprecated("'defaultPermission' is deprecated in favor of 'defaultMemberPermissions' and 'dmPermission'. Setting 'defaultPermission' to false can be replaced by setting 'defaultMemberPermissions' to empty Permissions and 'dmPermission' to false ('dmPermission' is only available for global commands).")
public var defaultPermission: Boolean?
/** Indicates whether the command is age-restricted. */
public var nsfw: Boolean?
}