From 1a69610785a015a6529f34240635ea4a44d8b525 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 14 Jun 2011 22:40:45 -0500 Subject: [PATCH] Alias: fix ^!alias$ == crash bug --- BUGS | 1 - DrBotIRC.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/BUGS b/BUGS index e16dd72..ff4d266 100644 --- a/BUGS +++ b/BUGS @@ -13,7 +13,6 @@ dr.botzo --- BUGS ends up sending the reply to the bot itself (as that is the target of the incoming privmsg, same as in a channel, but the bot is supposed to overwrite the nick case with the sender's) - * line saying only '!alias' == crash * if a trigger text replacement happens, the original text is unavailable to modules f.x., saying (this text will be replaced with a trigger)++ will cause (replacement)++ to be seen by the karma module. fix: pass along the original text as an argument diff --git a/DrBotIRC.py b/DrBotIRC.py index 6bc5ff1..0949508 100644 --- a/DrBotIRC.py +++ b/DrBotIRC.py @@ -162,6 +162,10 @@ class DrBotIRC(irclib.IRC): # first see if the aliases are being directly manipulated via add/remove whats = what.split(' ') + + if len(whats) <= 1: + return + try: if whats[0] == '!alias' and whats[1] == 'add' and len(whats) >= 4: if not self.config.has_section('Alias'):