Add example for random reactions

This commit is contained in:
Tulir Asokan 2021-06-16 22:24:52 +03:00
parent e89a5773d8
commit 05e479bb88
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,25 @@
templates:
random_reaction:
type: m.reaction
variables:
react_to_event: '{{event.event_id}}'
reaction: '{{ variables.reaction_choices | random }}'
content:
m.relates_to:
rel_type: m.annotation
event_id: $${react_to_event}
key: $${reaction}
default_flags:
- ignorecase
rules:
random:
matches:
- hmm
template: random_reaction
variables:
reaction_choices:
- 🤔
- 🧐
- 🤨