Skip to content

Commit

Permalink
Add example to illustrate the continue_after_match feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
nerilex committed Jan 25, 2024
1 parent 2e5d942 commit 8180815
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions samples/your-opinion.yaml
Original file line number Diff line number Diff line change
@@ -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: 🤷

0 comments on commit 8180815

Please sign in to comment.