Add example to illustrate the continue_after_match feature.

This commit is contained in:
bg 2024-01-25 07:55:51 +00:00
parent 2e5d9424b9
commit 8180815b38

44
samples/your-opinion.yaml Normal file
View file

@ -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: 🤷