Ignore messages with zwsp, ^O, or ^B^B in the beginning

This commit is contained in:
Juhani Krekelä 2018-10-22 10:51:07 +03:00
parent ff2b384579
commit 284ca9659b
1 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,11 @@ def sanitize(title):
# irc is the IRC API object
# All strings are bytestrings
def handle_message(*, prefix, message, nick, channel, irc):
# Ignore messages with a zwsp, ^O, or ^B^B in the beginning
for ignored in (b'\xe2\x80\x8b', b'\x0f', b'\x02\x02'):
if message[:len(ignored)] == ignored:
return
urls = find_urls(message.decode('utf-8'))
# Don't titlebot >3 urls