Update
This commit is contained in:
parent
f16d245723
commit
c2b033097b
2 changed files with 11 additions and 7 deletions
|
@ -211,16 +211,16 @@ async def _(msg: Bot.MessageSession, plate: str, username: str = None):
|
||||||
await msg.finish(msg.locale.t("maimai.message.no_username"))
|
await msg.finish(msg.locale.t("maimai.message.no_username"))
|
||||||
payload = {'username': username}
|
payload = {'username': username}
|
||||||
|
|
||||||
if plate == '真将':
|
if plate == '真将' or (plate[1] == '者' and plate[0] != '霸'):
|
||||||
await msg.finish(msg.locale.t('maimai.message.plate.plate_not_found'))
|
await msg.finish(msg.locale.t('maimai.message.plate.plate_not_found'))
|
||||||
|
|
||||||
output, songs_diff, songs = await get_plate_process(msg, payload, plate)
|
output, get_img = await get_plate_process(msg, payload, plate)
|
||||||
|
|
||||||
if songs <= 10 or songs >= 50 or songs_diff <= 10 or songs_diff >= 50:
|
if get_img:
|
||||||
await msg.finish(output.strip())
|
|
||||||
else:
|
|
||||||
img = await msgchain2image([Plain(output)])
|
img = await msgchain2image([Plain(output)])
|
||||||
await msg.finish([BImage(img)])
|
await msg.finish([BImage(img)])
|
||||||
|
else:
|
||||||
|
await msg.finish(output.strip())
|
||||||
|
|
||||||
|
|
||||||
@mai.handle('process <level> <goal> [<username>] {{maimai.help.process}}')
|
@mai.handle('process <level> <goal> [<username>] {{maimai.help.process}}')
|
||||||
|
|
|
@ -383,6 +383,8 @@ async def get_plate_process(msg, payload, plate):
|
||||||
if verlist[record_index]['fs']:
|
if verlist[record_index]['fs']:
|
||||||
self_record = syncRank[sync_rank.index(verlist[record_index]['fs'])]
|
self_record = syncRank[sync_rank.index(verlist[record_index]['fs'])]
|
||||||
output += f"{s[0]}\u200B. {s[1]}{' (DX)' if s[4] == 'DX' else ''} {s[2]} {s[3]} {self_record}".strip() + '\n'
|
output += f"{s[0]}\u200B. {s[1]}{' (DX)' if s[4] == 'DX' else ''} {s[2]} {s[3]} {self_record}".strip() + '\n'
|
||||||
|
if len(song_remain_difficult) > 10:
|
||||||
|
get_img = True
|
||||||
else:
|
else:
|
||||||
output += msg.locale.t('maimai.message.plate.greater_13p', song_remain=len(song_remain_difficult))
|
output += msg.locale.t('maimai.message.plate.greater_13p', song_remain=len(song_remain_difficult))
|
||||||
elif len(song_remain) > 0:
|
elif len(song_remain) > 0:
|
||||||
|
@ -406,9 +408,11 @@ async def get_plate_process(msg, payload, plate):
|
||||||
if verlist[record_index]['fs']:
|
if verlist[record_index]['fs']:
|
||||||
self_record = syncRank[sync_rank.index(verlist[record_index]['fs'])]
|
self_record = syncRank[sync_rank.index(verlist[record_index]['fs'])]
|
||||||
output += f"{m.id}\u200B. {m.title}{' (DX)' if m.type == 'DX' else ''} {diffs[s[1]]} {m.ds[s[1]]} {self_record}".strip() + '\n'
|
output += f"{m.id}\u200B. {m.title}{' (DX)' if m.type == 'DX' else ''} {diffs[s[1]]} {m.ds[s[1]]} {self_record}".strip() + '\n'
|
||||||
|
if len(song_remain) > 10:
|
||||||
|
get_img = True
|
||||||
else:
|
else:
|
||||||
output += msg.locale.t('maimai.message.plate.greater_13p.complete')
|
output += msg.locale.t('maimai.message.plate.greater_13p.complete')
|
||||||
else:
|
else:
|
||||||
output += msg.locale.t('maimai.message.plate.completed')
|
output += msg.locale.t('maimai.message.plate.completed', plate=plate)
|
||||||
|
|
||||||
return output, len(song_remain_difficult), len(song_remain)
|
return output, get_img
|
Reference in a new issue