From 939c718d3a2e1e22a4d577b9c0a2dab60cdf8b98 Mon Sep 17 00:00:00 2001 From: dgw Date: Tue, 26 Apr 2022 18:29:55 -0500 Subject: [PATCH] rules: drop `draft/bot` tag Bot Mode spec has been ratified (ircv3/ircv3-specifications#495). Since we haven't published a release with support for this message tag yet, it's a very easy decision to take *right now* that we'll only support the finalized spec and not the WIP version. --- sopel/plugins/rules.py | 5 +---- test/plugins/test_plugins_rules.py | 8 +------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sopel/plugins/rules.py b/sopel/plugins/rules.py index bfc9f9689a..bb79ff196b 100644 --- a/sopel/plugins/rules.py +++ b/sopel/plugins/rules.py @@ -982,10 +982,7 @@ def match_preconditions(self, bot, pretrigger): intent = pretrigger.tags.get('intent') nick = pretrigger.nick is_bot_message = ( - ( - 'draft/bot' in pretrigger.tags or # can be removed...someday - 'bot' in pretrigger.tags - ) and + 'bot' in pretrigger.tags and event in ["PRIVMSG", "NOTICE"] ) is_echo_message = ( diff --git a/test/plugins/test_plugins_rules.py b/test/plugins/test_plugins_rules.py index 18a4b26fd0..b642f9a61c 100644 --- a/test/plugins/test_plugins_rules.py +++ b/test/plugins/test_plugins_rules.py @@ -658,16 +658,10 @@ def test_rule_match_privmsg_bot_tag(mockbot): regex = re.compile(r'.*') rule = rules.Rule([regex]) - line = '@draft/bot :TestBot!sopel@example.com PRIVMSG #sopel :Hi!' - pretrigger = trigger.PreTrigger(mockbot.nick, line) - assert not list(rule.match(mockbot, pretrigger)), ( - 'Line with `draft/bot` tag must be ignored' - ) - line = '@bot :TestBot!sopel@example.com PRIVMSG #sopel :Hi!' pretrigger = trigger.PreTrigger(mockbot.nick, line) assert not list(rule.match(mockbot, pretrigger)), ( - 'Line with final/ratified `bot` tag must be ignored' + 'Line with `bot` tag must be ignored' )