🐛 Error message when trying to end hangman game when there's not one

This commit is contained in:
NikolajDanger
2021-04-06 15:07:49 +02:00
parent f4587b324c
commit cb05caded7

View File

@ -62,6 +62,11 @@ class Hangman():
async def stop(self, ctx):
channel = str(ctx.channel.id)
game = self.bot.database["hangman games"].find_one({"_id": channel})
if game is None:
await ctx.send("There's no game going on")
else:
self.bot.database["hangman games"].delete_one({"_id":channel})
with open(f"resources/games/oldImages/hangman{channel}", "r") as f: