Archived
1
0
Fork 0
This commit is contained in:
多羅狼 2023-06-21 23:50:52 +08:00 committed by GitHub
parent f347467364
commit b3e68163db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -216,12 +216,12 @@ async def _(msg: Bot.MessageSession, process: str, goal: str, username: str = No
if 1 <= num < 8:
await msg.finish(msg.locale.t("maimai.message.process.level.less_than_8"))
elif num < 1 or num > 15:
await msg.finish(msg.locale.t("maimai.message.error.level_invalid"))
await msg.finish(msg.locale.t("maimai.message.process.error.goal_invalid"))
else:
await msg.finish(msg.locale.t("maimai.message.error.level_invalid"))
await msg.finish(msg.locale.t("maimai.message.process.error.goal_invalid"))
if goal.upper() not in goal_list:
await msg.finish(msg.locale.t("maimai.message.error.goal_invalid"))
await msg.finish(msg.locale.t("maimai.message.process.error.goal_invalid"))
output = await get_level_process(msg, payload, process, goal)

View file

@ -187,15 +187,13 @@ async def get_level_process(message, payload, process, goal):
music = (await total_list.get()).by_id(str(song[0]))
songs.append([music.id, music.title, diffs[song[1]], music.ds[song[1]], song[1], music.type])
songs = sorted(songs, key=lambda s: int(s[0]))
msg = ''
if len(song_remain) > 0:
if len(song_remain) < 50:
song_record = [[s['id'], s['level_index']] for s in verlist]
msg += f"{message.locale.t('maimai.message.process.level.last', process=process, goal=goal)}\n"
for i, s in enumerate(sorted(songs, key=lambda i: i[3])):
self_record = ''
goals = ''
if [int(s[0]), s[-1]] in song_record:
record_index = song_record.index([int(s[0]), s[-1]])
if goal in score_to_rank.values():
@ -206,7 +204,8 @@ async def get_level_process(message, payload, process, goal):
elif goal in sync_conversion.values():
if verlist[record_index]['fs']:
self_record = list(sync_conversion.values())[list(sync_conversion.keys()).index(verlist[record_index]['fs'])].upper()
msg += f"{s[0]}\u200B.{s[1]}{' (DX)' if s[5] == 'DX' else ''} {s[2]} {s[3]} {self_record}\n".strip()
goals += f"{s[0]}\u200B.{s[1]}{' (DX)' if s[5] == 'DX' else ''} {s[2]} {s[3]} {self_record}\n"
msg += f"{message.locale.t('maimai.message.process.level.last', process=process, goal=goal)}\n{goals.strip()}"
else:
msg = f"{message.locale.t('maimai.message.process.level', song_remain=len(song_remain), process=process, goal=goal)}"
else: