updated songbird. removed the track thing because it wasnt useful

This commit is contained in:
2021-04-12 21:40:28 +01:00
parent 29dd3532bb
commit 900fe6a4f0
4 changed files with 11 additions and 109 deletions

View File

@ -1,11 +1,7 @@
use serenity::async_trait;
use serenity::model::id::GuildId;
use songbird::Event;
use songbird::EventContext;
use songbird::EventHandler as SongbirdEventHandler;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::RwLock;
pub struct RestartTrack;
@ -19,22 +15,3 @@ impl SongbirdEventHandler for RestartTrack {
None
}
}
pub struct UpdateTrackCount {
pub guild_id: GuildId,
pub track_count: Arc<RwLock<HashMap<GuildId, u32>>>,
}
#[async_trait]
impl SongbirdEventHandler for UpdateTrackCount {
async fn act(&self, _ctx: &EventContext<'_>) -> Option<Event> {
{
let mut write_lock = self.track_count.write().await;
let current = write_lock.get(&self.guild_id).cloned();
write_lock.insert(self.guild_id, current.unwrap_or(1) - 1);
}
None
}
}