mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
18 lines
395 B
Go
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)
|
|
})
|
|
}
|