MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / init

Function init

plugin/ottoshout/ottoshout.go:21–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19)
20
21func init() { // 插件主体
22 engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{
23 DisableOnDefault: false,
24 Brief: "otto鬼叫",
25 Help: "- 电棍说 xxx",
26 PrivateDataFolder: "ottoshout",
27 })
28 // 开启
29 engine.OnPrefix(`电棍说`).SetBlock(true).
30 Handle(func(ctx *zero.Ctx) {
31 args := ctx.State["args"].(string)
32 data, err := web.PostData(makeURL, "application/x-www-form-urlencoded", strings.NewReader("text="+url.QueryEscape(args)+"&inYsddMode=true&norm=true&reverse=false&speedMult=1&pitchMult=1"))
33 if err != nil {
34 ctx.SendChain(message.Text("ERROR:", err))
35 }
36 ctx.SendChain(message.Record(websiteURL + "/get/" + gjson.ParseBytes(data).Get("id").String() + ".mp3"))
37 })
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected