snipe

bot for a simple IRC game to make people say words
git clone https://a3nm.net/git/snipe/
Log | Files | Refs

commit 698aaa21c4ca3bef91219baefbffc99bcfa0bdf6
parent e1e84b1d651502d743a3fa44e885a9fb89d4cacb
Author: Antoine Amarilli <ant.amarilli@free.fr>
Date:   Sat, 21 May 2011 02:33:36 -0400

correct bug for whitespace line parsing

Diffstat:
snipe.py | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/snipe.py b/snipe.py @@ -26,7 +26,7 @@ help = [ "Commandes : \"help\", \"info\", \"rank\""] def parse(line): - m = re.match("\[([^]]*?)\] <([^>]*?)> (.*)", line.rstrip()) + m = re.match("\[([^]]*?)\] <([^>]*?)> (.*)", line) chan = m.group(1) speaker = m.group(2) message = m.group(3).lstrip() @@ -37,7 +37,7 @@ def parse(line): message = message[len(address):].lstrip() if chan == speaker or chan == name: to_us = True - return chan, speaker, message, to_us + return chan, speaker, message.rstrip(), to_us def split(message): return re.split("[^\w']+", message, flags=re.UNICODE)