调整级别信息
This commit is contained in:
@@ -99,6 +99,11 @@ def points_reward_decorator(points_calculator: Union[int, Callable], source_type
|
||||
if ok and isinstance(lvl, dict) and "level" in lvl and "exp" in lvl:
|
||||
title = levels_db.level_title(int(lvl['level']))
|
||||
level_msg = f"🔰 当前等级: {lvl['level']}({title}) 经验: {lvl['exp']}"
|
||||
_, cur_t, next_t, pct, remain = levels_db.get_progress(int(lvl['exp']))
|
||||
if next_t is None:
|
||||
level_msg += "\n📈 进度: 已满级"
|
||||
else:
|
||||
level_msg += f"\n📈 进度: {int(pct*100)}%(还差 {remain})"
|
||||
client_msg_id, create_time, new_msg_id = await bot.send_at_message(
|
||||
(roomid if roomid else sender),
|
||||
level_msg, [sender]
|
||||
@@ -178,6 +183,11 @@ def points_reward_decorator(points_calculator: Union[int, Callable], source_type
|
||||
if ok and isinstance(lvl, dict) and "level" in lvl and "exp" in lvl:
|
||||
title = levels_db.level_title(int(lvl['level']))
|
||||
response += f"\n🔰 当前等级: {lvl['level']}({title}) 经验: {lvl['exp']}"
|
||||
_, cur_t, next_t, pct, remain = levels_db.get_progress(int(lvl['exp']))
|
||||
if next_t is None:
|
||||
response += "\n📈 进度: 已满级"
|
||||
else:
|
||||
response += f"\n📈 进度: {int(pct*100)}%(还差 {remain})"
|
||||
else:
|
||||
logger.warning(f"用户 {sender} 积分奖励失败: {reward_result}")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user