Cleanup in play, play not working now

This commit is contained in:
2024-12-19 00:09:29 -05:00
parent 2ecfa92d8b
commit 8eeadcfd54
3 changed files with 11 additions and 6 deletions

View File

@@ -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};

View File

@@ -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;
}
}