Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public async Task MoveChannelsAsync(IVoiceChannel voiceChannel)
  2. {
  3. if (!Players.TryGetValue(voiceChannel.GuildId, out var player))
  4. return;
  5.  
  6. if (player.VoiceChannel.Id == voiceChannel.Id)
  7. return;
  8.  
  9. bool waspalying = player.IsPlaying;
  10. if (waspalying)
  11. await player.PauseAsync();
  12.  
  13. await player.VoiceChannel.DisconnectAsync().ConfigureAwait(false);
  14. await voiceChannel.ConnectAsync(Configuration.SelfDeaf, false, true).ConfigureAwait(false);
  15.  
  16. if (waspalying)
  17. await player.ResumeAsync();
  18.  
  19. player.VoiceChannel = voiceChannel;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement