Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature alipayvoice #449

Merged
merged 14 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,14 @@ print("run[CQ:image,file="+j["img"]+"]")

- [x] waifu | 随机waifu(从[100000个AI生成的waifu](https://www.thiswaifudoesnotexist.net/)中随机一位)

</details>
<details>
<summary>支付宝到账语音</summary>

`import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice"`

- [x] 支付宝到账 1

</details>
<details>
<summary>base16384加解密</summary>
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/ai_false" // 服务器监控
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/base64gua" // base64卦加解密
Expand Down
32 changes: 32 additions & 0 deletions plugin/alipayvoice/alipayvoice.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Package alipayvoice 支付宝到账语音
package alipayvoice

import (
"fmt"
"strings"

ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)

const (
alipayvoiceURL = "https://mm.cqu.cc/share/zhifubaodaozhang/mp3/%v.mp3"
)

func init() { // 插件主体
engine := control.Register("alipayvoice", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
Help: "支付宝到账语音\n" +
"- 支付宝到账 1",
PrivateDataFolder: "alipayvoice",
})

// 开启
engine.OnPrefix(`支付宝到账`).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
args := ctx.State["args"].(string)
ctx.SendChain(message.Record(fmt.Sprintf(alipayvoiceURL, strings.TrimSpace(args))))
})
}