Update to serenity 12
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use poise::serenity_prelude::AutocompleteChoice;
|
||||
|
||||
use crate::{models::sound::SoundCtx, Context};
|
||||
|
||||
pub mod favorite;
|
||||
@@ -8,34 +10,22 @@ pub mod search;
|
||||
pub mod settings;
|
||||
pub mod stop;
|
||||
|
||||
pub async fn autocomplete_sound(
|
||||
ctx: Context<'_>,
|
||||
partial: &str,
|
||||
) -> Vec<poise::AutocompleteChoice<String>> {
|
||||
pub async fn autocomplete_sound(ctx: Context<'_>, partial: &str) -> Vec<AutocompleteChoice> {
|
||||
ctx.data()
|
||||
.autocomplete_user_sounds(&partial, ctx.author().id, ctx.guild_id().unwrap())
|
||||
.await
|
||||
.unwrap_or(vec![])
|
||||
.iter()
|
||||
.map(|s| poise::AutocompleteChoice {
|
||||
name: s.name.clone(),
|
||||
value: s.id.to_string(),
|
||||
})
|
||||
.map(|s| AutocompleteChoice::new(s.name.clone(), s.id.to_string()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub async fn autocomplete_favorite(
|
||||
ctx: Context<'_>,
|
||||
partial: &str,
|
||||
) -> Vec<poise::AutocompleteChoice<String>> {
|
||||
pub async fn autocomplete_favorite(ctx: Context<'_>, partial: &str) -> Vec<AutocompleteChoice> {
|
||||
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(),
|
||||
})
|
||||
.map(|s| AutocompleteChoice::new(s.name.clone(), s.id.to_string()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user