🐛 Error message when trying to end hangman game when there's not one
This commit is contained in:
@@ -62,6 +62,11 @@ class Hangman():
|
|||||||
|
|
||||||
async def stop(self, ctx):
|
async def stop(self, ctx):
|
||||||
channel = str(ctx.channel.id)
|
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})
|
self.bot.database["hangman games"].delete_one({"_id":channel})
|
||||||
|
|
||||||
with open(f"resources/games/oldImages/hangman{channel}", "r") as f:
|
with open(f"resources/games/oldImages/hangman{channel}", "r") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user