pub struct CreateAutocompleteResponse { /* private fields */ }builder only.Expand description
Implementations§
Source§impl CreateAutocompleteResponse
impl CreateAutocompleteResponse
Sourcepub fn new() -> Self
pub fn new() -> Self
Equivalent to Self::default.
Sourcepub fn set_choices(self, choices: Vec<AutocompleteChoice>) -> Self
pub fn set_choices(self, choices: Vec<AutocompleteChoice>) -> Self
For autocomplete responses this sets their autocomplete suggestions.
See the official docs on Application Command Option Choices for more information.
Sourcepub fn add_int_choice(self, name: impl Into<String>, value: i64) -> Self
pub fn add_int_choice(self, name: impl Into<String>, value: i64) -> Self
Add an int autocomplete choice.
Note: There can be no more than 25 choices set. Name must be between 1 and 100 characters. Value must be between -2^53 and 2^53.
Sourcepub fn add_string_choice(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn add_string_choice( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a string autocomplete choice.
Note: There can be no more than 25 choices set. Name must be between 1 and 100 characters. Value must be up to 100 characters.
Sourcepub fn add_number_choice(self, name: impl Into<String>, value: f64) -> Self
pub fn add_number_choice(self, name: impl Into<String>, value: f64) -> Self
Adds a number autocomplete choice.
Note: There can be no more than 25 choices set. Name must be between 1 and 100 characters. Value must be between -2^53 and 2^53.
Trait Implementations§
Source§impl Builder for CreateAutocompleteResponse
impl Builder for CreateAutocompleteResponse
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a response to an autocomplete interaction.
§Errors
Returns an Error::Http if the API returns an error.
Source§type Context<'ctx> = (InteractionId, &'ctx str)
type Context<'ctx> = (InteractionId, &'ctx str)
type Built = ()
Source§impl Clone for CreateAutocompleteResponse
impl Clone for CreateAutocompleteResponse
Source§fn clone(&self) -> CreateAutocompleteResponse
fn clone(&self) -> CreateAutocompleteResponse
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateAutocompleteResponse
impl Debug for CreateAutocompleteResponse
Source§impl Default for CreateAutocompleteResponse
impl Default for CreateAutocompleteResponse
Source§fn default() -> CreateAutocompleteResponse
fn default() -> CreateAutocompleteResponse
Auto Trait Implementations§
impl Freeze for CreateAutocompleteResponse
impl RefUnwindSafe for CreateAutocompleteResponse
impl Send for CreateAutocompleteResponse
impl Sync for CreateAutocompleteResponse
impl Unpin for CreateAutocompleteResponse
impl UnwindSafe for CreateAutocompleteResponse
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)