Skip to content

Commit ce231cf

Browse files
authored
Merge pull request CloudBotIRC#169 from iownall555/patch-1
Add a check for blank or entirely whitespace strings.
2 parents 165724c + 5bc11f3 commit ce231cf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

plugins/correction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def correction(match, conn, nick, chan, message):
1919
replace = groups[1]
2020
if find == replace:
2121
return "really dude? you want me to replace {} with {}?".format(find, replace)
22+
23+
if not find.strip(): # Replacing empty or entirely whitespace strings is spammy
24+
return "really dude? you want me to replace nothing with {}?".format(replace)
2225

2326
for item in conn.history[chan].__reversed__():
2427
name, timestamp, msg = item

0 commit comments

Comments
 (0)