Skip to content

Commit

Permalink
Fix stage channels
Browse files Browse the repository at this point in the history
  • Loading branch information
bombies committed Oct 7, 2023
1 parent 32b87ff commit 82e3a69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/main/audiohandlers/RobertifyAudioManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import net.dv8tion.jda.api.entities.Guild
import net.dv8tion.jda.api.entities.GuildVoiceState
import net.dv8tion.jda.api.entities.Message
import net.dv8tion.jda.api.entities.User
import net.dv8tion.jda.api.entities.channel.ChannelType
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException
Expand Down Expand Up @@ -262,7 +263,10 @@ object RobertifyAudioManager {
}
}

musicManager.link.connectAudio(channel.idLong.toULong())
if (channel.type == ChannelType.STAGE) {
guild.jda.directAudioController.connect(channel)
} else musicManager.link.connect(channel.id)

musicManager.scheduler.scheduleDisconnect()
return true
}
Expand Down

0 comments on commit 82e3a69

Please sign in to comment.