Fix autocompletes
This commit is contained in:
@@ -23,3 +23,19 @@ pub async fn autocomplete_sound(
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub async fn autocomplete_favorite(
|
||||
ctx: Context<'_>,
|
||||
partial: &str,
|
||||
) -> Vec<poise::AutocompleteChoice<String>> {
|
||||
ctx.data()
|
||||
.autocomplete_favorite_sounds(&partial, ctx.author().id)
|
||||
.await
|
||||
.unwrap_or(vec![])
|
||||
.iter()
|
||||
.map(|s| poise::AutocompleteChoice {
|
||||
name: s.name.clone(),
|
||||
value: s.id.to_string(),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user