Add example for random reactions
This commit is contained in:
parent
e89a5773d8
commit
05e479bb88
2 changed files with 27 additions and 0 deletions
|
@ -7,6 +7,8 @@ A [maubot](https://github.com/maubot/maubot) that responds to messages that matc
|
|||
and an image response for "alot".
|
||||
* [samples/jesari.yaml](samples/jesari.yaml) contains a replacement for [jesaribot](https://github.com/maubot/jesaribot).
|
||||
* [samples/stallman.yaml](samples/stallman.yaml) contains a Stallman interject bot.
|
||||
* [samples/random-reaction.yaml](samples/random-reaction.yaml) has an example of
|
||||
a randomized reaction to matching messages.
|
||||
|
||||
## Config format
|
||||
### Templates
|
||||
|
|
25
samples/random-reaction.yaml
Normal file
25
samples/random-reaction.yaml
Normal 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:
|
||||
- 🤔
|
||||
- 🧐
|
||||
- 🤨
|
Loading…
Reference in a new issue