|
|
@@ -12,6 +12,12 @@ grey = "\x0314"
|
|
|
def do_command(self, connection, event):
|
|
|
cmdtype, trigger, command, replyto = CH.disect_command(self, event)
|
|
|
|
|
|
+ # Bot crashes once in a while when a user joins a channel, with "IndexError: list index out of range" on "command.split()[0] == "joins"".
|
|
|
+ try:
|
|
|
+ command.split()[0]
|
|
|
+ except:
|
|
|
+ return # Stop, there is no command.
|
|
|
+
|
|
|
# The actual commands:
|
|
|
if command == "test":
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
@@ -24,7 +30,7 @@ def do_command(self, connection, event):
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
connection.privmsg(replyto, "Displays a list of commands.")
|
|
|
elif cmdtype == "cmd":
|
|
|
- connection.privmsg(replyto, grey + "Commands: " + CH.ccc(self, "cmd") + CH.ccc(self, "help") + CH.ccc(self, "joins")[:-2] + ".")
|
|
|
+ connection.privmsg(replyto, grey + "Commands: " + CH.ccc(self, "cmd") + CH.ccc(self, "help") + CH.ccc(self, "joins") + CH.ccc(self, "stopgreet")[:-2] + ".")
|
|
|
|
|
|
elif command == "help":
|
|
|
if cmdtype == "help": #Display help text.
|
|
|
@@ -88,3 +94,14 @@ def do_command(self, connection, event):
|
|
|
except:
|
|
|
pass
|
|
|
connection.privmsg(replyto, "tBKwtWS Was wondering if this programming was sloppy. When you see this message, it was.")
|
|
|
+
|
|
|
+ elif command.split()[0] == "stopgreet":
|
|
|
+ if cmdtype == "help": #Display help text.
|
|
|
+ connection.privmsg(replyto, "Stops the bot from greeting you or a specific user. Channel and user optional.")
|
|
|
+ connection.privmsg(replyto, grey + "Usage: " + blue + "!stopgreet " + red + italic + "channel user")
|
|
|
+ elif cmdtype == "cmd":
|
|
|
+ if len(command.splt()) == 1: # No arguments.
|
|
|
+ if self.db.one("SELECT id FROM")
|
|
|
+ if len(command.splt()) == 2: # One argument.
|
|
|
+ if len(command.splt()) == 3: # Two arguments.
|
|
|
+ if len(command.splt()) < 3: # Too many arguments.
|