ZeroBot-Plugin/run/runner.go
2021-03-22 13:08:20 +08:00

18 lines
395 B
Go

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