Struct twilight_util::builder::command::IntegerBuilder
source · [−]pub struct IntegerBuilder(_);builder only.Expand description
Create a integer option with a builder.
Implementations
sourceimpl IntegerBuilder
impl IntegerBuilder
sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Create a new default IntegerBuilder.
sourcepub fn build(self) -> CommandOption
pub fn build(self) -> CommandOption
Consume the builder, returning the built command option.
sourcepub const fn autocomplete(self, autocomplete: bool) -> Self
pub const fn autocomplete(self, autocomplete: bool) -> Self
Set whether this option supports autocomplete.
Defaults to false.
sourcepub fn choice_localizations<K: Into<String>, V: Into<String>>(
self,
choice_name: &str,
name_localizations: impl IntoIterator<Item = (K, V)>
) -> Self
pub fn choice_localizations<K: Into<String>, V: Into<String>>(
self,
choice_name: &str,
name_localizations: impl IntoIterator<Item = (K, V)>
) -> Self
Set localization for a particular choice, by name.
Choices must be set with the choices method before updating their
localization.
sourcepub fn choices<K: Into<String>>(
self,
choices: impl IntoIterator<Item = (K, i64)>
) -> Self
pub fn choices<K: Into<String>>(
self,
choices: impl IntoIterator<Item = (K, i64)>
) -> Self
Set the list of choices for an option.
Accepts tuples of (String, i64) corresponding to the name and value.
Localization may be added with choice_localizations.
Defaults to no choices.
sourcepub fn description_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
pub fn description_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
Set the localization dictionary for the option description.
Defaults to None.
sourcepub const fn max_value(self, value: i64) -> Self
pub const fn max_value(self, value: i64) -> Self
Set the maximum value permitted.
Defaults to no limit.
sourcepub const fn min_value(self, value: i64) -> Self
pub const fn min_value(self, value: i64) -> Self
Set the minimum value permitted.
Defaults to no limit.
sourcepub fn name_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
pub fn name_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
Set the localization dictionary for the option name.
Defaults to None.
Trait Implementations
sourceimpl Clone for IntegerBuilder
impl Clone for IntegerBuilder
sourcefn clone(&self) -> IntegerBuilder
fn clone(&self) -> IntegerBuilder
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more