mirror of
https://github.com/fumiama/ReiBot.git
synced 2026-06-06 09:30:25 +08:00
add more
This commit is contained in:
@@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user