Skip to content

Commit 20f0cb2

Browse files
authored
hotfix(DynamicVoiceChat): Don't care about bots connecting in voice chats (Together-Java#1387)
We don't want bots like VC Transcribe to have their own private dynamic rooms. Make it so that we shouldn't care about them. Signed-off-by: Chris Sdogkos <[email protected]>
1 parent 7063695 commit 20f0cb2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

application/src/main/java/org/togetherjava/tjbot/features/voicechat/DynamicVoiceChat.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.dv8tion.jda.api.entities.Member;
66
import net.dv8tion.jda.api.entities.MessageEmbed;
77
import net.dv8tion.jda.api.entities.MessageHistory;
8+
import net.dv8tion.jda.api.entities.User;
89
import net.dv8tion.jda.api.entities.channel.concrete.Category;
910
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
1011
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel;
@@ -51,6 +52,13 @@ public DynamicVoiceChat(Config config) {
5152

5253
@Override
5354
public void onVoiceUpdate(@NotNull GuildVoiceUpdateEvent event) {
55+
Member member = event.getMember();
56+
User user = member.getUser();
57+
58+
if (user.isBot()) {
59+
return;
60+
}
61+
5462
AudioChannelUnion channelJoined = event.getChannelJoined();
5563
AudioChannelUnion channelLeft = event.getChannelLeft();
5664

0 commit comments

Comments
 (0)