Skip to content

Commit

Permalink
Add capture group example
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 18, 2021
1 parent 873cae5 commit 45e2218
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions samples/nitter.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 45e2218

Please sign in to comment.