From 374ff215d64774cd978ae6b546c4e0676408d6d7 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Tue, 7 Nov 2023 09:19:57 -0600 Subject: [PATCH] Fix admin check, and fix a un-updated line --- bot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index 716045b..479331d 100644 --- a/bot.py +++ b/bot.py @@ -196,7 +196,7 @@ class bot: def sendraw(self, command: str) -> int: self.log(f"RAW sending {command}") command = f"{command}\n" - return self.send(command.replace("$BOTNICK", botnick)) + return self.send(command.replace("$BOTNICK", self.nick)) def mainloop(self) -> NoReturn: self.log("Starting connection..") @@ -269,7 +269,10 @@ class bot: triggers, cmds.data[cmd]["prefix"], ): - cmds.call[cmd](self, chan, name, message) + if ("admin" in cmds.data[cmd] and cmds.data[cmd]["admin"]) and name not in self.adminnames: + self.msg(f"Sorry {name}, you don't have permission to use {cmd}.", chan) + else: + cmds.call[cmd](self, chan, name, message) handled = True break if not handled: @@ -280,10 +283,7 @@ class bot: ), message, ): - if ("admin" in cmds.data[cmd] and cmds.data[cmd]["admin"]) and name not in self.adminnames: - self.msg(f"Sorry {name}, you don't have permission to use {cmd}.", chan) - else: - cmds.call[check](self, chan, name, message) + cmds.call[check](self, chan, name, message) handled = True break if not handled and mfind(message, ["reload"]):