mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-05 10:40:24 +08:00
21 lines
455 B
Go
21 lines
455 B
Go
package echo
|
|
|
|
import (
|
|
ctrl "github.com/FloatTech/zbpctrl"
|
|
nano "github.com/fumiama/NanoBot"
|
|
)
|
|
|
|
func init() {
|
|
nano.Register("echo", &ctrl.Options[*nano.Ctx]{
|
|
DisableOnDefault: false,
|
|
Help: "- echo xxx",
|
|
}).OnMessagePrefix("echo").SetBlock(true).
|
|
Handle(func(ctx *nano.Ctx) {
|
|
args := ctx.State["args"].(string)
|
|
if args == "" {
|
|
return
|
|
}
|
|
_, _ = ctx.SendChain(nano.ReplyTo(ctx.Message.Author.ID), nano.Text(args))
|
|
})
|
|
}
|