mirror of
https://github.com/kurbezz/discord-bot.git
synced 2026-03-03 13:10:48 +01:00
Fix autocomplete
This commit is contained in:
@@ -93,9 +93,11 @@ impl EventHandler for Handler {
|
|||||||
games
|
games
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|game| game.to_lowercase().contains(&query.to_lowercase()))
|
.filter(|game| game.to_lowercase().contains(&query.to_lowercase()))
|
||||||
|
.take(25)
|
||||||
.map(|game| {
|
.map(|game| {
|
||||||
AutocompleteChoice::new(game.to_string(), game.to_string())
|
AutocompleteChoice::new(game.to_string(), game.to_string())
|
||||||
}).collect()
|
})
|
||||||
|
.collect()
|
||||||
);
|
);
|
||||||
|
|
||||||
let _ = interaction.create_response(&ctx.http, serenity::builder::CreateInteractionResponse::Autocomplete(autocompolete_response)).await.unwrap();
|
let _ = interaction.create_response(&ctx.http, serenity::builder::CreateInteractionResponse::Autocomplete(autocompolete_response)).await.unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user