From: John Runyon Date: Mon, 4 Sep 2023 02:22:57 +0000 (-0600) Subject: urls - allow to block channels in config X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/87f0733f91df46f79982d5e3a66a1dfdf0e393f5 urls - allow to block channels in config --- diff --git a/modules/urls.py b/modules/urls.py index f2df04f..6e99530 100644 --- a/modules/urls.py +++ b/modules/urls.py @@ -77,6 +77,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): result.status = code return result +def _get_blocked_chans(): + return lib.parent.cfg.get('urls', 'blocked', '').split(',') + def process_line(line): responses = [] num_found = 0 @@ -101,6 +104,8 @@ def privmsg_hook(bot, textline): user = parser_hostmask(textline[1:textline.find(' ')]) chan = textline.split()[2] + if chan in _get_blocked_chans(): return + try: line = textline.split(None, 3)[3][1:] except IndexError: