Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
Fixed error when attempting to join a channel when already in one
Browse files Browse the repository at this point in the history
  • Loading branch information
Roboguy99 authored and Roboguy99 committed Apr 20, 2016
1 parent bace980 commit c1d53a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/bot/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ private void stopSound(GuildMessageReceivedEvent event)

private void joinChannel(String channelName, GuildMessageReceivedEvent event)
{
event.getGuild().getAudioManager().closeAudioConnection();
//Scans through the VoiceChannels in this Guild, looking for one with a case-insensitive matching name.
VoiceChannel channel = event.getGuild().getVoiceChannels().stream().filter(vChan -> vChan.getName().equalsIgnoreCase(channelName)).findFirst().orElse(null);
if (channel == null)
Expand Down

0 comments on commit c1d53a2

Please sign in to comment.