diff --git a/run/runner.go b/run/runner.go new file mode 100644 index 00000000..da28e33b --- /dev/null +++ b/run/runner.go @@ -0,0 +1,17 @@ +package runner + +import ( + "strings" + + zero "github.com/wdvxdr1123/ZeroBot" +) + +func init() { // 插件主体 + zero.OnRegex(`^run(.*)$`, zero.SuperUserPermission).SetBlock(true).SetPriority(0). + Handle(func(ctx *zero.Ctx) { + var cmd = ctx.State["regex_matched"].([]string)[1] + cmd = strings.ReplaceAll(cmd, "[", "[") + cmd = strings.ReplaceAll(cmd, "]", "]") + ctx.Send(cmd) + }) +}