1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-06 01:20:24 +08:00
Files
ReiBot/example/echo/main.go
源文雨 72390b4c09 add more
2022-06-10 19:58:48 +08:00

22 lines
501 B
Go

package echo
import (
ctrl "github.com/FloatTech/zbpctrl"
rei "github.com/fumiama/ReiBot"
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
func init() {
rei.Register("echo", &ctrl.Options[*rei.Ctx]{
DisableOnDefault: false,
Help: "- echo xxx",
}).OnMessagePrefix("echo").SetBlock(true).
Handle(func(ctx *rei.Ctx) {
args := ctx.State["args"].(string)
if args == "" {
return
}
_, _ = ctx.Caller.Send(tgba.NewMessage(ctx.Message.Chat.ID, args))
})
}