Struct SlashCommand
zaun_bot::SlashCommand · Struct
pub struct SlashCommand(…)Builds an [ApplicationCommand]: a slash command, or a user or message context command.
Methods
Section titled “Methods”pub fn new<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> SelfA slash command. name: 1–32 lowercase letters, digits, - or _; description:
1–100.
pub fn user<impl Into<String>>(name: impl Into<String>) -> SelfA user context-menu command (“Apps → name” on a member).
message
Section titled “message”pub fn message<impl Into<String>>(name: impl Into<String>) -> SelfA message context-menu command.
option
Section titled “option”pub fn option(self, option: CommandOptionBuilder) -> SelfAdds an option (≤ 25; required ones first).
sub_command
Section titled “sub_command”pub fn sub_command(self, sub: SubCommand) -> SelfAdds a sub-command.
pub fn group(self, group: SubCommandGroup) -> SelfAdds a group of sub-commands.
default_member_permissions
Section titled “default_member_permissions”pub fn default_member_permissions(self, bits: u64) -> SelfBits the invoker needs in the channel; 0 makes it owner-only.
localized_name
Section titled “localized_name”pub fn localized_name(self, locale: &str, name: &str) -> SelfAdds a translated name (BCP 47 locale).
pub fn build(self) -> ApplicationCommandThe finished command.
Trait implementations
Section titled “Trait implementations”Clone, Debug