1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-06 01:20:24 +08:00
This commit is contained in:
源文雨
2022-06-02 14:36:43 +08:00
parent 7c90c8b7d3
commit 8b6817acea
13 changed files with 802 additions and 17 deletions

18
example/echo/main.go Normal file
View File

@@ -0,0 +1,18 @@
package echo
import (
rei "github.com/fumiama/ReiBot"
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
func init() {
rei.OnMessagePrefix("echo").SetBlock(true).SecondPriority().
Handle(func(ctx *rei.Ctx) {
args := ctx.State["args"].(string)
if args == "" {
return
}
msg := ctx.Value.(*tgba.Message)
ctx.Caller.Send(tgba.NewMessage(msg.Chat.ID, args))
})
}