Struct serenity::builder::CreateApplicationCommand
source · [−]builder
only.Expand description
A builder for creating a new Command
.
Self::name
and Self::description
are required fields.
Tuple Fields
0: HashMap<&'static str, Value>
Implementations
sourceimpl CreateApplicationCommand
impl CreateApplicationCommand
sourcepub fn name<D: ToString>(&mut self, name: D) -> &mut Self
pub fn name<D: ToString>(&mut self, name: D) -> &mut Self
Specifies the name of the application command.
Note: Must be between 1 and 32 lowercase characters, matching r"^[\w-]{1,32}$"
. Two global commands of the same app cannot have the same name. Two guild-specific commands of the same app cannot have the same name.
sourcepub fn name_localized<D: ToString, E: ToString>(
&mut self,
locale: E,
name: D
) -> &mut Self
pub fn name_localized<D: ToString, E: ToString>(
&mut self,
locale: E,
name: D
) -> &mut Self
Specifies a localized name of the application command.
.name("birthday")
.name_localized("zh-CN", "生日")
.name_localized("el", "γενέθλια")
sourcepub fn kind(&mut self, kind: CommandType) -> &mut Self
pub fn kind(&mut self, kind: CommandType) -> &mut Self
Specifies the type of the application command.
sourcepub fn default_member_permissions(
&mut self,
permissions: Permissions
) -> &mut Self
pub fn default_member_permissions(
&mut self,
permissions: Permissions
) -> &mut Self
Specifies the default permissions required to execute the command.
sourcepub fn dm_permission(&mut self, enabled: bool) -> &mut Self
pub fn dm_permission(&mut self, enabled: bool) -> &mut Self
Specifies if the command is available in DMs.
sourcepub fn default_permission(&mut self, default_permission: bool) -> &mut Self
👎 Deprecated: replaced by default_member_permissions
pub fn default_permission(&mut self, default_permission: bool) -> &mut Self
replaced by default_member_permissions
Specifies if the command should not be usable by default
Note: Setting it to false will disable it for anyone, including administrators and guild owners.
sourcepub fn description<D: ToString>(&mut self, description: D) -> &mut Self
pub fn description<D: ToString>(&mut self, description: D) -> &mut Self
Specifies the description of the application command.
Note: Must be between 1 and 100 characters long.
sourcepub fn description_localized<D: ToString, E: ToString>(
&mut self,
locale: E,
description: D
) -> &mut Self
pub fn description_localized<D: ToString, E: ToString>(
&mut self,
locale: E,
description: D
) -> &mut Self
Specifies a localized description of the application command.
.description("Wish a friend a happy birthday")
.description_localized("zh-CN", "祝你朋友生日快乐")
sourcepub fn create_option<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateApplicationCommandOption) -> &mut CreateApplicationCommandOption,
pub fn create_option<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateApplicationCommandOption) -> &mut CreateApplicationCommandOption,
Creates an application command option for the application command.
Note: Application commands can have up to 25 options.
sourcepub fn add_option(&mut self, option: CreateApplicationCommandOption) -> &mut Self
pub fn add_option(&mut self, option: CreateApplicationCommandOption) -> &mut Self
Adds an application command option for the application command.
Note: Application commands can have up to 25 options.
sourcepub fn set_options(
&mut self,
options: Vec<CreateApplicationCommandOption>
) -> &mut Self
pub fn set_options(
&mut self,
options: Vec<CreateApplicationCommandOption>
) -> &mut Self
Sets all the application command options for the application command.
Note: Application commands can have up to 25 options.
Trait Implementations
sourceimpl Clone for CreateApplicationCommand
impl Clone for CreateApplicationCommand
sourcefn clone(&self) -> CreateApplicationCommand
fn clone(&self) -> CreateApplicationCommand
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CreateApplicationCommand
impl Debug for CreateApplicationCommand
sourceimpl Default for CreateApplicationCommand
impl Default for CreateApplicationCommand
sourcefn default() -> CreateApplicationCommand
fn default() -> CreateApplicationCommand
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CreateApplicationCommand
impl Send for CreateApplicationCommand
impl Sync for CreateApplicationCommand
impl Unpin for CreateApplicationCommand
impl UnwindSafe for CreateApplicationCommand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more