-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2089 from sopel-irc/ignore-tagged-bots
coretasks: activate `message-tags` and use it to ignore other bots' tagged messages
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -654,6 +654,23 @@ def test_rule_match_privmsg_action(mockbot): | |
assert not list(rule.match(mockbot, pretrigger)) | ||
|
||
|
||
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' | ||
) | ||
|
||
|
||
def test_rule_match_privmsg_echo(mockbot): | ||
line = ':[email protected] PRIVMSG #sopel :Hi!' | ||
pretrigger = trigger.PreTrigger(mockbot.nick, line) | ||
|