diff --git a/alexBot/cogs/voiceTTS.py b/alexBot/cogs/voiceTTS.py index e544aa0..fbdd69c 100644 --- a/alexBot/cogs/voiceTTS.py +++ b/alexBot/cogs/voiceTTS.py @@ -193,6 +193,9 @@ async def vc_tts(self, interaction: discord.Interaction, model: str): if interaction.user.id in self.runningTTS[interaction.guild_id].users and model == "QUIT": del self.runningTTS[interaction.guild_id].users[interaction.user.id] await interaction.response.send_message("ended your voice tts session.", ephemeral=True) + if len(self.runningTTS[interaction.guild_id].users) == 0: + await self.runningTTS[interaction.guild_id].voiceClient.disconnect() + del self.runningTTS[interaction.guild_id] return if interaction.user.voice.channel.id != self.runningTTS[interaction.guild_id].voiceClient.channel.id: await interaction.response.send_message(