Files
bl/modules/config/controller/robot/fusion.go
xinian 707142bd49
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat: 新增繁殖和融合查询命令
2026-03-24 01:12:06 +08:00

36 lines
861 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package robot
import (
"blazing/common/data/xmlres"
"blazing/modules/config/service"
"strings"
"github.com/gogf/gf/v2/util/gconv"
zero "github.com/wdvxdr1123/ZeroBot"
)
func init() {
zero.OnCommand("融合").
Handle(func(ctx *zero.Ctx) {
var cdks []string
for _, v := range service.NewPetFusionService().All() {
var buf strings.Builder
buf.WriteString("\n主")
buf.WriteString(xmlres.PetMAP[int(v.MainPetID)].DefName + "|")
buf.WriteString("副:")
for _, v := range v.SubPetIDs {
buf.WriteString(xmlres.PetMAP[int(v)].DefName + "|")
}
buf.WriteString("结果:")
buf.WriteString(xmlres.PetMAP[int(v.ResultPetID)].DefName + "|")
buf.WriteString("概率:")
buf.WriteString(gconv.String(v.Probability))
cdks = append(cdks, buf.String())
}
ctx.Send(strings.Join(cdks, "\n"))
})
}