From 73073ad8582dc13e8a3ce3a50918c69222b52c03 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 28 Feb 2019 17:22:49 +0100 Subject: [PATCH] Try to find out the cause of the ghost bot appearences --- discordbot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discordbot.py b/discordbot.py index 6e916915..8f085ce8 100644 --- a/discordbot.py +++ b/discordbot.py @@ -802,11 +802,13 @@ class RoyalDiscordBot(discord.Client): self.inactivity_timer -= 1 continue for voice_client in self.voice_clients: - if voice_client.is_connected(): + try: logger.info("Disconnecting due to inactivity.") await voice_client.disconnect() await self.change_presence(status=discord.Status.online, activity=None) await self.main_channel.send("💤 Mi sono disconnesso dalla cv per inattività.") + except Exception: + raise Exception("Ciao! Sono un errore intenzionale di Steffo per testare il countdown inattività!") async def create_activityreport(self): logger.debug("Fetching Discord users...")