summary refs log tree commit diff
path: root/stuff.py
diff options
context:
space:
mode:
authorPawky Languish2025-04-19 19:07:38 +0000
committerPawky Languish2025-04-19 19:07:38 +0000
commitf4fb34dde6b03fdb49f71476d587c5c7f986b565 (patch)
treeef8cc174c413dcd766754bc51c52b9a2fc328e5c /stuff.py
parent12062621d6d67adb8abee962f4201e2d5196f55b (diff)
idk some changes lol, formatting and stuff HEAD master
Diffstat (limited to 'stuff.py')
-rw-r--r--stuff.py39
1 files changed, 8 insertions, 31 deletions
diff --git a/stuff.py b/stuff.py
index 299555b..1a873c1 100644
--- a/stuff.py
+++ b/stuff.py
@@ -39,11 +39,7 @@ def stuff(bot, sock):
             if nickserv_auth:
                 nick_override = True
                 if config.server.nickserv_squery:
-                    util.send(
-                        irctokens.build(
-                            "SQUERY", ["NickServ", f"IDENTIFY {nick} {passwd}"]
-                        ).format()
-                    )
+                    util.send(irctokens.build("SQUERY", ["NickServ", f"IDENTIFY {nick} {passwd}"]).format())
                     util.send(
                         irctokens.build(
                             "SQUERY",
@@ -94,11 +90,7 @@ def stuff(bot, sock):
     send = util.send
 
     send(irctokens.build("NICK", [config.self.nick]).format())
-    send(
-        irctokens.build(
-            "USER", [config.self.username, "0", "*", config.self.realname]
-        ).format()
-    )
+    send(irctokens.build("USER", [config.self.username, "0", "*", config.self.realname]).format())
     while True:
         self_nick = server.nickname
         recv_data = sock.recv(1024)
@@ -126,9 +118,7 @@ def stuff(bot, sock):
                             auth()
                 if line.command == "433":  # 433 is ERR_NICKNAMEINUSE
                     util.nick(config.self.nick + "_")
-                if (
-                    line.command == "376" or line.command == "422"
-                ):  # 376 is RPL_ENDOFMOTD and 422 is ERR_NOMOTD
+                if line.command == "376" or line.command == "422":  # 376 is RPL_ENDOFMOTD and 422 is ERR_NOMOTD
                     if config.server.nickserv_auth == True:
                         auth()
                     send(irctokens.build("CAP", ["LS", "302"]).format())
@@ -215,10 +205,7 @@ def stuff(bot, sock):
                                 command.prefix = prefix
                             cmd = cmd.strip()
                             try:
-                                is_adm = (
-                                    line.tags["account"] in admin_accounts
-                                    or line.source in admin_users
-                                )
+                                is_adm = line.tags["account"] in admin_accounts or line.source in admin_users
                             except (
                                 KeyError,
                                 TypeError,
@@ -259,28 +246,18 @@ def stuff(bot, sock):
                                 command.util = util
                                 command.util.target = target
                                 mesg("reloaded")
-                            elif (
-                                cmd.startswith("eval ")
-                                and "eval" not in config.cmd.disabled
-                            ):
+                            elif cmd.startswith("eval ") and "eval" not in config.cmd.disabled:
                                 if is_adm:
                                     try:
-                                        result = eval(
-                                            cmd[len("eval ") :].strip() or "None"
-                                        )
+                                        result = eval(cmd[len("eval ") :].strip() or "None")
                                     except Exception as e:
                                         mesg("Error: " + str(e))
                                 else:
                                     mesg("Error: you're not authorized to eval")
-                            elif (
-                                cmd.startswith("exec ")
-                                and "exec" not in config.cmd.disabled
-                            ):
+                            elif cmd.startswith("exec ") and "exec" not in config.cmd.disabled:
                                 if is_adm:
                                     try:
-                                        result = exec(
-                                            cmd[len("exec ") :].strip() or "None"
-                                        )
+                                        result = exec(cmd[len("exec ") :].strip() or "None")
                                     except Exception as e:
                                         mesg("Error: " + str(e))
                                 else: