Files
bl/modules/config/controller/robot/boss.go
xinian f8b8a87331
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix: 修复日志输出与代码格式错误
2026-03-25 01:22:44 +08:00

49 lines
1.1 KiB
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/cool"
"blazing/modules/config/service"
"strings"
"time"
"github.com/gogf/gf/v2/util/gconv"
zero "github.com/wdvxdr1123/ZeroBot"
)
func init() {
zero.OnCommand("勇者").
Handle(func(ctx *zero.Ctx) {
msgs := strings.Fields(ctx.Event.Message.String())
//eids := dict.NewDictInfoService().GetData("eid")
if len(msgs) > 1 {
count := gconv.Uint32(msgs[1])
if count != 0 {
var buf strings.Builder
r := service.NewTower500Service().Boss(count) //获取第一个配置因为塔只绑定一组bossbossid也是0
if len(r) > 0 {
for _, v := range service.NewBossService().Get(r[0].BossIds[0]) {
buf.WriteString("【" + xmlres.PetMAP[int(v.MonID)].DefName + "】" + "\n")
for _, effs := range service.NewEffectService().Args(v.Effect) {
buf.WriteString(effs.Desc + "\n")
}
//cdks = append(cdks, buf.String())
}
}
msg := ctx.Send(buf.String())
cool.Cron.AfterFunc(10*time.Second, func() {
ctx.DeleteMessage(msg)
})
}
}
})
}