From 5224a0ef58cb164aea62cac8eec7406acedefb56 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Tue, 23 Dec 2014 09:42:55 +0000 Subject: [PATCH] Only consider ! followed by a letter to be commands Avoids error spam to users --- tipbot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tipbot.py b/tipbot.py index c6ac55c..52c8903 100644 --- a/tipbot.py +++ b/tipbot.py @@ -15,6 +15,7 @@ import hashlib import json import httplib import time +import string tipbot_name = "monero-testnet-tipbot" irc_network = 'irc.freenode.net' @@ -843,7 +844,8 @@ while True: log_error('Failed to parse "who" line: %s: %s' % (data, str(e))) elif action == 'PRIVMSG': - if text.find('!') != -1: + exidx = text.find('!') + if exidx != -1 and len(text)>exidx+1 and text[exidx+1] in string.ascii_letters: cmd = text.split('!')[1] cmd = cmd.split(' ') cmd[0] = cmd[0].strip(' \t\n\r')