using regex test
This commit is contained in:
parent
3f97194d36
commit
d7d69a17fa
3
bot.py
3
bot.py
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue