forked from swee/MeowNex
patch for multiline perms
This commit is contained in:
parent
e23c9d31af
commit
d67a44fa6b
1 changed files with 29 additions and 23 deletions
50
sweebot.py
50
sweebot.py
|
@ -414,31 +414,40 @@ while True:
|
||||||
irc.send_irc(channel, "This is SweeBot " + __version__)
|
irc.send_irc(channel, "This is SweeBot " + __version__)
|
||||||
|
|
||||||
elif command[0] == "$figlet":
|
elif command[0] == "$figlet":
|
||||||
if len(command) > 1:
|
if not sbconfig.cflagexist(channel, "-multiline"):
|
||||||
try:
|
if len(command) > 1:
|
||||||
system(['figlet'] + command[1:], channel)
|
try:
|
||||||
except Exception as ex:
|
system(['figlet'] + command[1:], channel)
|
||||||
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
except Exception as ex:
|
||||||
|
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
||||||
|
else:
|
||||||
|
irc.send_irc(channel, nick + ": What text should I enlarge?")
|
||||||
else:
|
else:
|
||||||
irc.send_irc(channel, nick + ": What text should I enlarge?")
|
multiline("Multiline commands are disabled in this channel.", channel)
|
||||||
|
|
||||||
elif command[0] == "$tdfiglet":
|
elif command[0] == "$tdfiglet":
|
||||||
if len(command) > 1:
|
if not sbconfig.cflagexist(channel, "-multiline"):
|
||||||
try:
|
if len(command) > 1:
|
||||||
system(['tdfiglet', '-cm', "-r"] + command[1:], channel)
|
try:
|
||||||
except Exception as ex:
|
system(['tdfiglet', '-cm', "-r"] + command[1:], channel)
|
||||||
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
except Exception as ex:
|
||||||
|
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
||||||
|
else:
|
||||||
|
irc.send_irc(channel, nick + ": What text should I enlarge?")
|
||||||
else:
|
else:
|
||||||
irc.send_irc(channel, nick + ": What text should I enlarge?")
|
multiline("Multiline commands are disabled in this channel.", channel)
|
||||||
|
|
||||||
elif command[0] == "$cowsay":
|
elif command[0] == "$cowsay":
|
||||||
if len(command) > 1:
|
if not sbconfig.cflagexist(channel, "-multiline"):
|
||||||
try:
|
if len(command) > 1:
|
||||||
system(['cowsay'] + command[1:], channel)
|
try:
|
||||||
except Exception as ex:
|
system(['cowsay'] + command[1:], channel)
|
||||||
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
except Exception as ex:
|
||||||
|
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
||||||
|
else:
|
||||||
|
irc.send_irc(channel, nick + ": What should the cow say?")
|
||||||
else:
|
else:
|
||||||
irc.send_irc(channel, nick + ": What should the cow say?")
|
multiline("Multiline commands are disabled in this channel.", channel)
|
||||||
|
|
||||||
elif command[0] == "$uptime":
|
elif command[0] == "$uptime":
|
||||||
try:
|
try:
|
||||||
|
@ -533,9 +542,6 @@ while True:
|
||||||
except ex:
|
except ex:
|
||||||
multiline(str(ex), channel)
|
multiline(str(ex), channel)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if command[0][:3] == "$.." or command[0][:2] == "$/":
|
if command[0][:3] == "$.." or command[0][:2] == "$/":
|
||||||
irc.send_irc(channel, nick + ": Nice try.")
|
irc.send_irc(channel, nick + ": Nice try.")
|
||||||
|
@ -596,7 +602,7 @@ while True:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
elif "JOIN" in text and "#nixsanctuary" in text:
|
elif "JOIN" in text and "#nixsanctuary" in text:
|
||||||
nick = text.split(":")[1].split("!")[0]
|
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")
|
irc.send_irc("##hiya", "hiya: " + nick + " has joined #nixsanctuary")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue