mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 12:26:10 +01:00
0.5.0 embed, help, refractor
This commit is contained in:
20
src/commands/music/notifier.rs
Normal file
20
src/commands/music/notifier.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use serenity::async_trait;
|
||||
use songbird::events::{Event, EventContext, EventHandler as VoiceEventHandler};
|
||||
|
||||
pub struct TrackErrorNotifier;
|
||||
|
||||
#[async_trait]
|
||||
impl VoiceEventHandler for TrackErrorNotifier {
|
||||
async fn act(&self, ctx: &EventContext<'_>) -> Option<Event> {
|
||||
if let EventContext::Track(track_list) = ctx {
|
||||
for (state, handle) in *track_list {
|
||||
println!(
|
||||
"Track {:?} had an error: {:?}",
|
||||
handle.uuid(),
|
||||
state.playing
|
||||
);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user