refactor: 移除查bl图命令相关的注册逻辑,并在 LastDiffToImage 函数中处理头像为 nil 的情况以避免潜在错误
This commit is contained in:
parent
9e2b6b3162
commit
2ada30d859
@ -20,8 +20,6 @@ import (
|
||||
func init() {
|
||||
handler.RegisterHandler("查bl", getMyBLPic, constants.LEVEL_USER)
|
||||
handler.RegisterHelpInform("查bl", "beatleader", "查bl 查看您的最新分数")
|
||||
// handler.RegisterHandler("查bl图", getMyBLPic, constants.LEVEL_USER)
|
||||
// handler.RegisterHelpInform("查bl图", "beatleader", "查bl图 查看您的最新分数截图")
|
||||
handler.RegisterHandler("绑定bl", bindBL, constants.LEVEL_USER)
|
||||
handler.RegisterHelpInform("绑定bl", "beatleader", "绑定bl 绑定您的beatleader账号")
|
||||
handler.RegisterHandler("解绑bl", unbindBL, constants.LEVEL_USER)
|
||||
|
@ -530,16 +530,6 @@ func (p PlayerDataLite) LastDiffToImage(lastDayQueryData PlayerDataLite) string
|
||||
log.Default().Printf("下载头像失败,url:%s,err:%v", p.Avatar, err)
|
||||
}
|
||||
defer os.Remove(filePath)
|
||||
// outFile, err := util.ResizeImageByMaxHeight2File(filePath, 20)
|
||||
// if err != nil {
|
||||
// log.Default().Printf("缩放头像失败,url:%s,err:%v", p.Avatar, err)
|
||||
// }
|
||||
// picMsg := message.ImageMessage{
|
||||
// Type: message.TypeImage,
|
||||
// Data: message.ImageMessageData{
|
||||
// File: outFile,
|
||||
// },
|
||||
// }
|
||||
|
||||
baseboard := sprite.NewNamedSpriteBoard()
|
||||
|
||||
@ -552,6 +542,9 @@ func (p PlayerDataLite) LastDiffToImage(lastDayQueryData PlayerDataLite) string
|
||||
Image: avatar,
|
||||
Index: 1,
|
||||
}
|
||||
if avatar == nil {
|
||||
avatarSpirit.Image = image.NewRGBA(image.Rect(0, 0, 0, 0))
|
||||
}
|
||||
baseboard.AddSprite(&avatarSpirit)
|
||||
|
||||
var sb strings.Builder
|
||||
|
Loading…
x
Reference in New Issue
Block a user