Add capture group example

This commit is contained in:
Tulir Asokan 2021-07-18 19:45:35 +03:00
parent 873cae5821
commit 45e22185dc
2 changed files with 17 additions and 0 deletions

View file

@ -9,6 +9,8 @@ A [maubot](https://github.com/maubot/maubot) that responds to messages that matc
* [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.
* [samples/nitter.yaml](samples/nitter.yaml) has an example of matching tweet links
and responding with a corresponding nitter.net link.
## Config format
### Templates

15
samples/nitter.yaml Normal file
View file

@ -0,0 +1,15 @@
templates:
nitter:
type: m.room.message
content:
msgtype: m.text
body: https://nitter.net/$${1}/status/$${2}
default_flags:
- ignorecase
rules:
twitter:
matches:
- https://twitter.com/(.+?)/status/(\d+)
template: nitter