Only consider ! followed by a letter to be commands

Avoids error spam to users
This commit is contained in:
moneromooo 2014-12-23 09:42:55 +00:00
parent 72ddb11dff
commit 5224a0ef58
1 changed files with 3 additions and 1 deletions

View File

@ -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')