From 284ca9659b4d6cefd20bdae5d891accd5de30055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 22 Oct 2018 10:51:07 +0300 Subject: [PATCH] Ignore messages with zwsp, ^O, or ^B^B in the beginning --- botcmd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/botcmd.py b/botcmd.py index ea7c68d..9192b91 100644 --- a/botcmd.py +++ b/botcmd.py @@ -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