From 057975c686e0d4d4da98a8f30020e7ec008354ce Mon Sep 17 00:00:00 2001 From: Kleinrotti Date: Sat, 3 Oct 2020 20:08:34 +0200 Subject: [PATCH] leave discord channel when another users moves me --- TeamCord.Core/Discord/ConnectionHandler.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TeamCord.Core/Discord/ConnectionHandler.cs b/TeamCord.Core/Discord/ConnectionHandler.cs index dbce613..0c966b5 100644 --- a/TeamCord.Core/Discord/ConnectionHandler.cs +++ b/TeamCord.Core/Discord/ConnectionHandler.cs @@ -114,9 +114,12 @@ public ConnectionHandler(PluginUserCredential token) private Task _client_UserVoiceStateUpdated(SocketUser arg1, SocketVoiceState arg2, SocketVoiceState arg3) { - if (arg2.VoiceChannel?.Id != arg3.VoiceChannel?.Id) + //handle voice channel moving of user + if (arg2.VoiceChannel != null && arg3.VoiceChannel != null) { - //handle voice channel moving of user + //leave discord channel when another users moves me + LeaveChannel(); + arg3.VoiceChannel.DisconnectAsync(); } return Task.CompletedTask; }