Browse Source

Make sure command split happens before we parse it.

tags/v0.2
Ben Kurtovic 9 years ago
parent
commit
acc233a06c
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      earwigbot/irc/data.py

+ 5
- 5
earwigbot/irc/data.py View File

@@ -81,6 +81,11 @@ class Data(object):
except IndexError: except IndexError:
return return


# e.g. "!command>user arg1 arg2"
if ">" in self.command:
command_uc, self._reply_nick = command_uc.split(">", 1)
self._command = command_uc.lower()

if self.command.startswith("!") or self.command.startswith("."): if self.command.startswith("!") or self.command.startswith("."):
# e.g. "!command arg1 arg2" # e.g. "!command arg1 arg2"
self._is_command = True self._is_command = True
@@ -105,11 +110,6 @@ class Data(object):
except IndexError: except IndexError:
pass pass


# e.g. "!command>user arg1 arg2"
if ">" in self.command:
command_uc, self._reply_nick = command_uc.split(">", 1)
self._command = command_uc.lower()

# e.g. "!command >user arg1 arg2" # e.g. "!command >user arg1 arg2"
if self.args and self.args[0].startswith(">"): if self.args and self.args[0].startswith(">"):
self._reply_nick = self.args.pop(0)[1:] self._reply_nick = self.args.pop(0)[1:]


Loading…
Cancel
Save