patch for multiline perms

This commit is contained in:
Swee 2024-10-12 16:22:17 -07:00
parent e23c9d31af
commit d67a44fa6b

View file

@ -414,31 +414,40 @@ while True:
irc.send_irc(channel, "This is SweeBot " + __version__)
elif command[0] == "$figlet":
if len(command) > 1:
try:
system(['figlet'] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
if not sbconfig.cflagexist(channel, "-multiline"):
if len(command) > 1:
try:
system(['figlet'] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
else:
irc.send_irc(channel, nick + ": What text should I enlarge?")
else:
irc.send_irc(channel, nick + ": What text should I enlarge?")
multiline("Multiline commands are disabled in this channel.", channel)
elif command[0] == "$tdfiglet":
if len(command) > 1:
try:
system(['tdfiglet', '-cm', "-r"] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
if not sbconfig.cflagexist(channel, "-multiline"):
if len(command) > 1:
try:
system(['tdfiglet', '-cm', "-r"] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
else:
irc.send_irc(channel, nick + ": What text should I enlarge?")
else:
irc.send_irc(channel, nick + ": What text should I enlarge?")
multiline("Multiline commands are disabled in this channel.", channel)
elif command[0] == "$cowsay":
if len(command) > 1:
try:
system(['cowsay'] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
if not sbconfig.cflagexist(channel, "-multiline"):
if len(command) > 1:
try:
system(['cowsay'] + command[1:], channel)
except Exception as ex:
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
else:
irc.send_irc(channel, nick + ": What should the cow say?")
else:
irc.send_irc(channel, nick + ": What should the cow say?")
multiline("Multiline commands are disabled in this channel.", channel)
elif command[0] == "$uptime":
try:
@ -533,9 +542,6 @@ while True:
except ex:
multiline(str(ex), channel)
else:
if command[0][:3] == "$.." or command[0][:2] == "$/":
irc.send_irc(channel, nick + ": Nice try.")
@ -596,9 +602,9 @@ while True:
print(traceback.format_exc())
elif "JOIN" in text and "#nixsanctuary" in text:
nick = text.split(":")[1].split("!")[0]
if not "swee" in nick:
if not "swe" in nick:
irc.send_irc("##hiya", "hiya: " + nick + " has joined #nixsanctuary")
pass
except Exception as ex:
print(traceback.format_exc())
print(traceback.format_exc())