From dcd37206bcd4eaff6c9f79504aefff5161ff747e Mon Sep 17 00:00:00 2001 From: jona605a Date: Fri, 25 Sep 2020 19:00:58 +0200 Subject: [PATCH] :sparkles: --- cogs/GamesCog.py | 2 +- funcs/games/gameLoops.py | 6 +++--- funcs/games/hex.py | 1 - funcs/games/loveletter.py | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cogs/GamesCog.py b/cogs/GamesCog.py index 86ecdff..6d44d6d 100644 --- a/cogs/GamesCog.py +++ b/cogs/GamesCog.py @@ -103,7 +103,7 @@ class GamesCog(commands.Cog): # Runs a game of Love Letter @commands.command(aliases = ["ll"]) async def loveletter(self, ctx, *, content = ""): - await self.client.gameLoops.runLoveletter(ctx.message.channel,content,"#"+str(ctx.message.author.id)) + await self.client.gameLoops.runLoveletter(ctx.message.channel,content,"#"+str(ctx.message.author.id),ctx.message.author) def setup(client): client.add_cog(GamesCog(client)) \ No newline at end of file diff --git a/funcs/games/gameLoops.py b/funcs/games/gameLoops.py index 08066eb..fdafa77 100644 --- a/funcs/games/gameLoops.py +++ b/funcs/games/gameLoops.py @@ -176,6 +176,7 @@ class GameLoops(): logThis("Error parsing command (error code 1510)") await channel.send(response) + logThis(response,str(channel.id)) if showImage: if deleteImage: @@ -214,10 +215,9 @@ class GameLoops(): # Runs Love letter - - async def runLoveletter(self,channel,command,user): + async def runLoveletter(self,channel,command,user,userchannel): try: - response, showImage, deleteImage = self.bot.hex.parseLove(command,str(channel.id),user) + response, showImage, deleteImage = self.bot.loveletter.parseLove(command,str(channel.id),user,userchannel) except: logThis("Error parsing command (error code 1810)") diff --git a/funcs/games/hex.py b/funcs/games/hex.py index dbdf5e5..4fc819c 100644 --- a/funcs/games/hex.py +++ b/funcs/games/hex.py @@ -22,7 +22,6 @@ class HexGame(): def parseHex(self, command, channel, user): commands = command.lower().split() game = self.bot.database["hex games"].find_one({"_id":channel}) - if command == "" or command == " ": return "I didn't get that. Use \"!hex start [opponent]\" to start a game.", False, False, False, False diff --git a/funcs/games/loveletter.py b/funcs/games/loveletter.py index 4bc3a03..b42a88e 100644 --- a/funcs/games/loveletter.py +++ b/funcs/games/loveletter.py @@ -9,12 +9,12 @@ class LoveLetter(): self.draw = DrawLove(bot) # Parses command - def parseLove(self, command, channel, user): + def parseLove(self, command, channel, user, userchannel): commands = command.lower().split() game = self.bot.database["loveletter games"].find_one({"_id":channel}) if command == "" or command == " ": - logThis(str(user)+" started a Love Letter game with loveStart(). ") + logThis(str(user)+" created a Love Letter game with loveStart(). ") return self.loveStart(channel) # If using a command with no game, return error @@ -30,6 +30,7 @@ class LoveLetter(): username = self.bot.funcs.getName(user) game["player hands"][username] = card game["discard piles"][username] = [] + game["user channel"][username] = userchannel # Used for direct (private) messages to the users self.bot.database["loveletter games"].replace_one({"_id":channel},game) return username+" joined the game! Type \"!loveletter begin\" once all players have joined.", False, False else: