1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-06 09:30:25 +08:00
This commit is contained in:
源文雨
2022-06-10 19:58:48 +08:00
parent e3c0d5efd6
commit 72390b4c09
14 changed files with 845 additions and 20 deletions

View File

@@ -1,18 +1,21 @@
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.OnMessagePrefix("echo").SetBlock(true).
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
}
msg := ctx.Value.(*tgba.Message)
_, _ = ctx.Caller.Send(tgba.NewMessage(msg.Chat.ID, args))
_, _ = ctx.Caller.Send(tgba.NewMessage(ctx.Message.Chat.ID, args))
})
}