From acc233a06c5601438daf3072535b5c566b92c452 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 13 Sep 2015 00:54:00 -0500 Subject: [PATCH] Make sure command split happens before we parse it. --- earwigbot/irc/data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/earwigbot/irc/data.py b/earwigbot/irc/data.py index cf4d025..25fb7e5 100644 --- a/earwigbot/irc/data.py +++ b/earwigbot/irc/data.py @@ -81,6 +81,11 @@ class Data(object): except IndexError: 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("."): # e.g. "!command arg1 arg2" self._is_command = True @@ -105,11 +110,6 @@ class Data(object): except IndexError: 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" if self.args and self.args[0].startswith(">"): self._reply_nick = self.args.pop(0)[1:]