1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-06 17:40:25 +08:00
Files
ReiBot/example/echo/main.go
源文雨 131fd9727c add more
2022-06-02 19:33:20 +08:00

19 lines
385 B
Go

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).
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))
})
}