diff --git a/Cargo.toml b/Cargo.toml index 9adddc4..50a55d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,3 +26,4 @@ tokio = { version = "1.42.0", features = ["macros", "rt-multi-thread", "signal"] regex = "1.11.0" axum = "0.7.7" lazy_static = "1.5.0" +futures = "0.3.31" diff --git a/src/bot/commands/audio/play.rs b/src/bot/commands/audio/play.rs index cb7e4b0..511d225 100644 --- a/src/bot/commands/audio/play.rs +++ b/src/bot/commands/audio/play.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use serenity::all::{CommandInteraction, CommandOptionType, CreateCommand, CreateCommandOption}; use serenity::model::prelude::GuildId; -use serenity::{prelude::*, async_trait}; +use serenity::{prelude::*, async_trait, futures}; use songbird::input::{Input, YoutubeDl}; use songbird::tracks::TrackHandle; use songbird::{Event, EventHandler, Songbird, TrackEvent}; @@ -10,7 +10,7 @@ use songbird::{Event, EventHandler, Songbird, TrackEvent}; use crate::data::guilds::GuildCache; use crate::bot::ytdlp::{YtDlp, YtDlpItem}; use crate::error::{SirenResult, Error as SirenError}; -use crate::HttpKey; +use crate::{signal_shutdown, HttpKey}; use super::{get_songbird, is_valid_url, join_voice_channel}; diff --git a/src/bot/handler.rs b/src/bot/handler.rs index 484b2a9..447dbfd 100644 --- a/src/bot/handler.rs +++ b/src/bot/handler.rs @@ -1,4 +1,4 @@ -use serenity::all::{CreateInteractionResponse, Interaction}; +use serenity::all::{CreateInteractionResponse, Interaction, ResumedEvent}; use serenity::async_trait; use serenity::model::gateway::Ready; use serenity::model::channel::Message; @@ -85,11 +85,15 @@ impl EventHandler for Handler { } } + async fn resume(&self, _: Context, _: ResumedEvent) { + log::debug!("Resumed"); + } + async fn interaction_create(&self, ctx: Context, interaction: Interaction) { if let Interaction::Ping(ping) = interaction { - log::debug!("Received interaction ping: {:?}", ping); + log::trace!("Received interaction ping: {:?}", ping); } else if let Interaction::Command(command) = interaction { - log::debug!("Received command interaction: {command:#?}"); + log::trace!("Received command interaction: {command:#?}"); match command.data.name.as_str() { // Match commands without returns "play" => commands::audio::play::run(&ctx, &command).await, @@ -105,7 +109,7 @@ impl EventHandler for Handler { _ => {} } } else if let Interaction::Modal(modal) = interaction { - log::debug!("Received interaction modal: {:?}", modal); + log::trace!("Received interaction modal: {:?}", modal); create_modal_response(&ctx, &modal).await; } }