From fa28e10f274ebd1e0a892a402318bc6c35d3d19e Mon Sep 17 00:00:00 2001 From: Elnath Date: Fri, 11 Jun 2021 00:00:17 +0200 Subject: [PATCH] DeleteGame: added a try catch --- SecretBot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SecretBot.py b/SecretBot.py index 1dc8ec8..2443663 100755 --- a/SecretBot.py +++ b/SecretBot.py @@ -127,7 +127,10 @@ class SecretBot(commands.Cog): gm_role = game.get_gm_role() await game.delete() await ctx.guild.get_member(self.bot.user.id).remove_roles(gm_role) - await ctx.reply(":white_check_mark: Game deleted!") + try: + await ctx.reply(":white_check_mark: Game deleted!") + except discord.NotFound: # If the command is executed in a game channel, then the channel won't exist anymore for the reply + pass @commands.command("StartVote") async def start_vote(self, ctx: commands.Context, president: discord.Member, chancellor: discord.Member):