维护guessmusic和qqwife插件 (#385)

* 优化error输出,新增猜歌结束后分享歌曲

* 添加反并发,防止被多娶

* Update main.go
This commit is contained in:
方柳煜
2022-08-26 18:44:47 +08:00
committed by GitHub
parent 941d6d2884
commit 0943023a19
2 changed files with 26 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ import (
ctrl "github.com/FloatTech/zbpctrl"
control "github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/ctxext"
"github.com/wdvxdr1123/ZeroBot/extension/single"
// 数据库
sql "github.com/FloatTech/sqlite"
@@ -290,7 +291,16 @@ func init() {
"- 娶群友\n- 群老婆列表\n" +
"--------------------------------\n以下技能每人只能三选一\n CD12H不跨天刷新\n--------------------------------\n" +
"- (娶|嫁)@对方QQ\n- 当[对方Q号|@对方QQ]的小三\n- 闹离婚",
})
}).ApplySingle(single.New(
single.WithKeyFn(func(ctx *zero.Ctx) int64 { return ctx.Event.GroupID }),
single.WithPostFn[int64](func(ctx *zero.Ctx) {
ctx.Send(
message.ReplyWithMessage(ctx.Event.MessageID,
message.Text("民政局门口排长队了!你们一个个来,别着急......"),
),
)
}),
))
getdb := fcext.DoOnceOnSuccess(func(ctx *zero.Ctx) bool {
民政局.db.DBPath = engine.DataFolder() + "结婚登记表.db"
// 如果数据库不存在则下载