pub struct CreateAutocompleteResponse { /* private fields */ }
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more