Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rules: drop draft/bot tag #2272

Merged
merged 1 commit into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
)
half-duplex marked this conversation as resolved.
Show resolved Hide resolved
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