From a7fb575a5561e6d49f091c41d5395b37c213cc1b Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 9 Oct 2019 18:35:38 -0400 Subject: [PATCH] bugfix --- bot.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index fff5255..9ecbe19 100755 --- a/bot.py +++ b/bot.py @@ -38,7 +38,7 @@ class Fulvia(irc.IRCClient): """The path to the bot's static file directory.""" self.log_path = "logs" - os.makedirs(self.static, exist_ok=True) + os.makedirs(self.log_path, exist_ok=True) """The path to the bot's log files.""" self._log_dump = tools.FulviaMemoryDefault(list) @@ -373,7 +373,7 @@ class Fulvia(irc.IRCClient): line = f"-!- you are now known as {nick}" for channel_name, channel in self.channels.items(): - self.log(key, line) + self.log(channel_name, line) user = channel.users.pop(self.nickname) user.nick = nick @@ -390,8 +390,8 @@ class Fulvia(irc.IRCClient): line = f"-!- {nick} [{host}] has joined {channel}" self.log(channel, line) - user = tools.User(nick) - self.channels[channel].users[nick] = user + new_user = tools.User(nick) + self.channels[channel].users[nick] = new_user for func in self._user_joined: trigger = Trigger(user, channel, f"{user} has joined", "PRIVMSG") @@ -413,12 +413,12 @@ class Fulvia(irc.IRCClient): def userQuit(self, user, quitMessage): """Called when the bot sees another user disconnect from the network.""" nick, _, host = user.partition("!") - line = "-!- {nick} [{host}] has quit [{quitMessage}]" + line = f"-!- {nick} [{host}] has quit [{quitMessage}]" for channel_name, channel in self.channels.items(): if not nick in channel.users: continue - self.log(channel, line) + self.log(channel_name, line) channel.users.pop(nick) @@ -514,7 +514,7 @@ class Fulvia(irc.IRCClient): line = f"<{opSym}{self.nickname}> {message}" self.log(user, line) - irc.IRCClient.msg(self, user, message, length=None) + super().msg(user, message, length) def reply(self, text, dest, reply_to, notice=False):