优化wife

This commit is contained in:
源文雨 2023-03-25 21:51:52 +08:00
parent b4a1f93993
commit 4a15326977

View File

@ -3,6 +3,7 @@ package wife
import ( import (
"encoding/json" "encoding/json"
"strings"
fcext "github.com/FloatTech/floatbox/ctxext" fcext "github.com/FloatTech/floatbox/ctxext"
ctrl "github.com/FloatTech/zbpctrl" ctrl "github.com/FloatTech/zbpctrl"
@ -40,6 +41,7 @@ func init() {
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
card := cards[fcext.RandSenderPerDayN(ctx.Event.UserID, len(cards))] card := cards[fcext.RandSenderPerDayN(ctx.Event.UserID, len(cards))]
data, err := engine.GetLazyData("wives/"+card, true) data, err := engine.GetLazyData("wives/"+card, true)
card, _, _ = strings.Cut(card, ".")
if err != nil { if err != nil {
ctx.SendChain( ctx.SendChain(
message.At(ctx.Event.UserID), message.At(ctx.Event.UserID),