feat: 新增繁殖和融合查询命令
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-24 01:12:06 +08:00
committed by cnb
parent 133d15e392
commit 707142bd49
5 changed files with 91 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
package robot
import (
"blazing/common/data/xmlres"
"blazing/modules/config/service"
"strings"
zero "github.com/wdvxdr1123/ZeroBot"
)
func init() {
zero.OnCommand("繁殖").
Handle(func(ctx *zero.Ctx) {
var cdks []string
for _, v := range service.NewEggService().All() {
var buf strings.Builder
buf.WriteString("\n父亲")
for _, v := range v.FemalePetIDs {
buf.WriteString(xmlres.PetMAP[int(v)].DefName + "|")
}
buf.WriteString("母亲:")
for _, v := range v.MalePetIDs {
buf.WriteString(xmlres.PetMAP[int(v)].DefName + "|")
}
buf.WriteString("子代:")
for _, v := range v.OutputMons {
buf.WriteString(xmlres.PetMAP[int(v)].DefName + "|")
}
cdks = append(cdks, buf.String())
}
ctx.Send(strings.Join(cdks, "\n"))
})
}