Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
leave discord channel when another users moves me
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleinrotti committed Oct 3, 2020
1 parent 0211a81 commit 057975c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions TeamCord.Core/Discord/ConnectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 057975c

Please sign in to comment.