update serenity

This commit is contained in:
jude
2022-07-20 17:10:16 +01:00
parent 5ade3f83a8
commit 31b6f7a0ab
6 changed files with 85 additions and 40 deletions

View File

@ -3,8 +3,8 @@ use std::{collections::HashMap, env};
use poise::{
serenity::{
model::{
application::interaction::{Interaction, InteractionResponseType},
channel::Channel,
interactions::{Interaction, InteractionResponseType},
},
prelude::Context,
utils::shard_id,
@ -126,6 +126,13 @@ SELECT name, id, public, server_id, uploader_id
poise::Event::InteractionCreate { interaction } => match interaction {
Interaction::MessageComponent(component) => {
if component.guild_id.is_some() {
component
.create_interaction_response(ctx, |r| {
r.kind(InteractionResponseType::DeferredUpdateMessage)
})
.await
.unwrap();
play_from_query(
&ctx,
&data,
@ -135,13 +142,6 @@ SELECT name, id, public, server_id, uploader_id
false,
)
.await;
component
.create_interaction_response(ctx, |r| {
r.kind(InteractionResponseType::DeferredUpdateMessage)
})
.await
.unwrap();
}
}
_ => {}