Skip to content

Commit

Permalink
leave channel on quit
Browse files Browse the repository at this point in the history
  • Loading branch information
mralext20 committed Sep 12, 2023
1 parent 9fac8ab commit fa56e49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions alexBot/cogs/voiceTTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fa56e49

Please sign in to comment.