Skip to content

Commit

Permalink
Ignore empty strings in yelling.py (CloudBotIRC#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon authored Apr 8, 2018
1 parent 8fc4ba1 commit 7030b08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/yelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def YELL_CHECK(event, conn):
return
TESTY = URL_RE.sub('', event.content)
TESTY = YELL_RE.sub('', TESTY)
if not TESTY:
# Ignore empty strings
return

CAPS_COUNT = sum(1 for c in TESTY if c.isupper())
if CAPS_COUNT / len(TESTY) < .75:
KICK_THEM = "KICK {} {} :USE MOAR CAPS YOU TROGLODYTE!".format(event.chan, event.nick)
Expand Down

0 comments on commit 7030b08

Please sign in to comment.