Converted all hangman functionality to slash commands

This commit is contained in:
NikolajDanger
2021-04-04 15:12:34 +02:00
parent 75e90d4166
commit e4a44fffef
5 changed files with 133 additions and 115 deletions

View File

@ -100,7 +100,7 @@ class databaseFuncs():
else:
return False, 0
def hangmanReactionTest(self, channel,message):
def hangmanReactionTest(self, channel, message, user):
try:
with open("resources/games/oldImages/hangman"+str(channel.id), "r") as f:
oldMessages = f.read().splitlines()
@ -111,8 +111,11 @@ class databaseFuncs():
for oldMessage in oldMessages:
oldMessageID = int(oldMessage)
if message.id == oldMessageID:
self.bot.log("They reacted to the hangman game")
gameMessage = True
game = self.bot.database["hangman games"].find_one({"_id":str(channel.id)})
if user == game["player"]:
gameMessage = True
break
return gameMessage