refactor: 在 getMyBLPic 函数中优化用户ID获取逻辑,支持从消息中提取用户ID,提升代码灵活性

This commit is contained in:
lixiangwuxian 2025-05-10 16:04:48 +08:00
parent 2ada30d859
commit f20edf3e78

View File

@ -173,7 +173,13 @@ func getMyBLPic(msg model.Message) (reply *model.Reply) {
attempts = 0
)
userIdStr := strconv.Itoa(int(msg.UserId))
tokens := util.SplitN(msg.RawMsg, 2)
var userIdStr string
if len(tokens) == 2 {
userIdStr = tokens[1]
} else {
userIdStr = strconv.Itoa(int(msg.UserId))
}
var data *beatleader.PlayerDataLite
var lastData *beatleader.PlayerDataLite
for attempts < maxRetries {