using regex test

This commit is contained in:
James Tomasino 2019-01-22 14:30:23 -05:00
parent 3f97194d36
commit d7d69a17fa
1 changed files with 2 additions and 1 deletions

3
bot.py
View File

@ -71,7 +71,8 @@ class CosmicBot(teambot.Handler):
line = re.sub("\s+"," ",line).split(" ",1)
self.say(channel,"{}: {} (by {})".format(nick,line[1],unhighlight_nick(line[0])))
def on_latest(self,channel,nick,count=5):
if isinstance(count, int):
if re.match(r"\d+",count):
count = int(count)
if count < 1:
count = 1 # ...nice try, smartass
if count > 5: