Skip to content

Commit 5bc11f3

Browse files
authored
Add a check for blank or entirely whitespace strings.
1 parent e645932 commit 5bc11f3

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)