mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
✨ 添加run功能
This commit is contained in:
parent
184b12628f
commit
f95838ff28
17
run/runner.go
Normal file
17
run/runner.go
Normal file
@ -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)
|
||||
})
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user