discord_gleam/types/slash_command
Types
An simplified command option type
See https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
pub type CommandOption {
CommandOption(
name: String,
description: String,
type_: CommandOptionType,
required: Bool,
)
}
Constructors
-
CommandOption( name: String, description: String, type_: CommandOptionType, required: Bool, )
pub type CommandOptionType {
SubCommandOption
SubCommandGroupOption
StringOption
IntOption
BoolOption
UserOption
ChannelOption
RoleOption
MentionableOption
FloatOption
AttachmentOption
}
Constructors
-
SubCommandOption -
SubCommandGroupOption -
StringOption -
IntOption -
BoolOption -
UserOption -
ChannelOption -
RoleOption -
MentionableOption -
FloatOption -
AttachmentOption
pub type SlashCommand {
SlashCommand(
name: String,
description: String,
options: List(CommandOption),
)
}
Constructors
-
SlashCommand( name: String, description: String, options: List(CommandOption), )
Functions
pub fn command_to_string(raw: SlashCommand) -> String
pub fn make_basic_text_reply(
message: String,
ephemeral: Bool,
) -> String
pub fn options_to_string(option: CommandOption) -> Json
pub fn type_to_int(type_: CommandOptionType) -> Int