From 229072cdddbc011767aaed633f6d6c10abc09438 Mon Sep 17 00:00:00 2001 From: Swee Date: Sat, 12 Oct 2024 17:18:12 -0700 Subject: [PATCH] add multiline perms to cc --- sweebot.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sweebot.py b/sweebot.py index 2c312be..952ee98 100644 --- a/sweebot.py +++ b/sweebot.py @@ -543,7 +543,7 @@ while True: multiline(str(ex), channel) else: - if command[0][:3] == "$.." or command[0][:2] == "$/": + if ".." in command[0][:3]: irc.send_irc(channel, nick + ": Nice try.") block+=1 run-=1 @@ -551,15 +551,18 @@ while True: else: if path.isfile("cc/" + command[0][1:]): try: - com = ['python3'] - comm = command - com.append("cc/" + comm[0][1:]) - com.append(nick) - com.append(username) - comm.pop(0) - for i in comm: - com.append(i) - system(com, channel) + if sbconfig.cflagexist(channel, "-multiline") and "#require-multiline" in open("cc/" + command[0][1:]).read(): + irc.send_irc(channel, "Multiline commands are disabled in this channel.") + else: + com = ['python3'] + comm = command + com.append("cc/" + comm[0][1:]) + com.append(nick) + com.append(username) + comm.pop(0) + for i in comm: + com.append(i) + system(com, channel) except Exception as ex: irc.send_irc(channel, nick + ": " + ex.__class__.__name__) elif path.isdir("cc/" + command[0][1:]):