diff --git a/plugin/ai_false/ai_false.go b/plugin/ai_false/ai_false.go index 74fce3231c..93c8ef0481 100644 --- a/plugin/ai_false/ai_false.go +++ b/plugin/ai_false/ai_false.go @@ -6,6 +6,7 @@ import ( "errors" "image" "math" + "math/rand" "runtime" "strconv" "strings" @@ -70,7 +71,7 @@ func init() { // 插件主体 } engine.OnFullMatchGroup([]string{"检查身体", "自检", "启动自检", "系统状态"}, zero.AdminPermission).SetBlock(true). Handle(func(ctx *zero.Ctx) { - img, err := drawstatus(ctx.State["manager"].(*ctrl.Control[*zero.Ctx]), ctx.Event.SelfID, zero.BotConfig.NickName[0]) + img, err := drawstatus(ctx.State["manager"].(*ctrl.Control[*zero.Ctx]), ctx.Event.SelfID, zero.BotConfig.NickName[rand.Intn(len(zero.BotConfig.NickName))]) if err != nil { ctx.SendChain(message.Text("ERROR: ", err)) return @@ -607,7 +608,7 @@ func moreinfo(m *ctrl.Control[*zero.Ctx]) (stateinfo []*status, err error) { stateinfo = []*status{ {name: "OS", text: []string{ /*hostinfo.Platform*/ "Microsoft Windows ⑨"}}, {name: "CPU", text: []string{cpuinfo[0].ModelName}}, - {name: "Version", text: []string{ /*hostinfo.PlatformVersion*/ "99.0.99999.9999 Bulid 99999.9999"}}, + {name: "Version", text: []string{ /*hostinfo.PlatformVersion*/ "Maximum number ⑨ Build Crino"}}, {name: "Plugin", text: []string{"共 " + strconv.Itoa(count) + " 个"}}, } return diff --git a/plugin/bfhelper/bf1/model/playerdb.go b/plugin/bfhelper/bf1/model/playerdb.go index 5798260b84..18f9a771a0 100644 --- a/plugin/bfhelper/bf1/model/playerdb.go +++ b/plugin/bfhelper/bf1/model/playerdb.go @@ -60,9 +60,6 @@ func (r *PlayerRepository) GetByQID(qid int64) (*Player, error) { var player Player if err := r.db.Where("qid = ?", qid).First(&player).Error; err != nil { - if gorm.IsRecordNotFoundError(err) { - return nil, errors.New("Player not found") - } return nil, err } return &player, nil @@ -75,9 +72,6 @@ func (r *PlayerRepository) GetByName(name string) (*Player, error) { } var player Player if err := r.db.Where("display_name = ?", name).First(&player).Error; err != nil { - if gorm.IsRecordNotFoundError(err) { - return nil, errors.New("Player not found") - } return nil, err } return &player, nil diff --git a/plugin/bfhelper/request/bf1/request.go b/plugin/bfhelper/request/bf1/request.go index bb82f10dc1..e5c9aa9558 100644 --- a/plugin/bfhelper/request/bf1/request.go +++ b/plugin/bfhelper/request/bf1/request.go @@ -17,7 +17,7 @@ type Post struct { // Param parameters type Param struct { Game string `json:"game"` - PersonaID string `json:"personaID"` + PersonaID string `json:"personaId"` PersonaIds []string `json:"personaIds"` GameID string `json:"gameID"` ServerID string `json:"serverID"` diff --git a/plugin/bfhelper/utils.go b/plugin/bfhelper/utils.go index 1f8d30016c..2b3a4b376b 100644 --- a/plugin/bfhelper/utils.go +++ b/plugin/bfhelper/utils.go @@ -122,7 +122,7 @@ func ID2PID(qid int64, id string) (string, string, error) { } // 若绑定账号时未获取到pid,重新获取并写入数据库 if data.PersonalID == "" { - pid, err := api.GetPersonalID(id) + pid, err := api.GetPersonalID(data.DisplayName) if err != nil { return "", id, errors.New("获取pid失败,请重试") }