We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d83b516 + af93e0d commit bb6b5b2Copy full SHA for bb6b5b2
tux/cogs/utility/temp_vc.py
@@ -43,6 +43,20 @@ async def on_voice_state_update(
43
f"Deleted temporary channel {before.channel.name} as it has no members."
44
)
45
46
+ # search all lost temporary channels and delete them
47
+ for channel in category.voice_channels:
48
+ # checks if the channel is a temporary channel
49
+ if (
50
+ not channel.name.startswith(self.base_vc_name)
51
+ or len(channel.members) != 0
52
+ or channel.id == int(CONST.TEMPVC_CHANNEL_ID or "0")
53
+ ):
54
+ continue
55
+
56
+ if len(channel.members) == 0:
57
+ await channel.delete()
58
+ logger.info(f"Deleted temporary channel {channel.name} as it has no members.")
59
60
61
async def setup(bot: commands.Bot) -> None:
62
await bot.add_cog(TempVc(bot))
0 commit comments