From 8180815b38fa09fb8cd778551305bd68c7dd5500 Mon Sep 17 00:00:00 2001 From: bg Date: Thu, 25 Jan 2024 07:55:51 +0000 Subject: [PATCH] Add example to illustrate the `continue_after_match` feature. --- samples/your-opinion.yaml | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 samples/your-opinion.yaml diff --git a/samples/your-opinion.yaml b/samples/your-opinion.yaml new file mode 100644 index 0000000..c9ed543 --- /dev/null +++ b/samples/your-opinion.yaml @@ -0,0 +1,44 @@ +templates: + reaction: + type: m.reaction + variables: + react_to_event: '{{event.content.get_reply_to() or event.event_id}}' + content: + m.relates_to: + rel_type: m.annotation + event_id: $${react_to_event} + key: $${reaction} + + +default_flags: +- ignorecase +antispam: + room: + max: 60 + delay: 60 + user: + max: 60 + delay: 60 + +rules: + opinon_up: + raw: false + matches: '#youropinion\b(?!`)' + template: reaction + continue_after_match: true + variables: + reaction: 👍 + opinion_down: + raw: false + matches: '#youropinion\b(?!`)' + template: reaction + continue_after_match: true + variables: + reaction: 👎 + opinon_shrug: + raw: false + matches: '#youropinion\b(?!`)' + template: reaction + variables: + reaction: 🤷 +