Skip to content

Commit

Permalink
rules: drop draft/bot tag
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dgw committed Apr 26, 2022
1 parent ace53dd commit 939c718
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions sopel/plugins/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
8 changes: 1 addition & 7 deletions test/plugins/test_plugins_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,16 +658,10 @@ def test_rule_match_privmsg_bot_tag(mockbot):
regex = re.compile(r'.*')
rule = rules.Rule([regex])

line = '@draft/bot :[email protected] 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 :[email protected] 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'
)


Expand Down

0 comments on commit 939c718

Please sign in to comment.