Skip to content

Commit 3115233

Browse files
committed
docs: add regex examples
1 parent 3a3efe5 commit 3115233

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

saltify-docs/content/guide/plugin.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ val myPlugin = SaltifyPlugin("my-awesome-plugin", ::MyPluginConfig) { config ->
2828
on<Event.GroupMemberIncrease> { event ->
2929
event.respond { text(config.reply) }
3030
}
31+
32+
// 监听以正则表达式匹配的消息
33+
regex("""BV1\w{9}""") { event, matches ->
34+
event.respond {
35+
text(matches.joinToString { it.value })
36+
}
37+
}
3138
}
3239
```
3340

0 commit comments

Comments
 (0)