From bf03a2e9afb5f17bcb49f191adfb3a32df926ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Henrique=20Ivanchechen?= Date: Fri, 3 Feb 2023 16:40:57 -0300 Subject: [PATCH] daily changes --- Services/PlayerService.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Services/PlayerService.cs b/Services/PlayerService.cs index eaaeae4..338f9a8 100644 --- a/Services/PlayerService.cs +++ b/Services/PlayerService.cs @@ -89,7 +89,6 @@ namespace Kasbot.Services IVoiceChannel channel = (Context.User as IVoiceState).VoiceChannel; var audioClient = await channel.ConnectAsync(); - audioClient.ClientDisconnected += (id) => AudioClient_ClientDisconnected(Context.Guild.Id); audioClient.Disconnected += (ex) => AudioClient_ClientDisconnected(Context.Guild.Id); conn = CreateConnection(audioClient, Context.Guild.Id); @@ -112,7 +111,7 @@ namespace Kasbot.Services if (nextMedia == null) { - Clients[guildId].Queue.Dequeue(); + Clients[guildId].Queue.Clear(); await Stop(guildId); return; } @@ -242,17 +241,12 @@ namespace Kasbot.Services private async Task RemoveMediaMessages(Media media) { - try - { - if (media.Message != null) - await media.Message.DeleteAsync(); - } - catch { } try { if (media.PlayMessage != null) await media.PlayMessage.DeleteAsync(); - } catch { } + } + catch { } } }