Yuri-YuzuChaN / maimaiDX

基于HoshinoBot V2的舞萌DX查询插件,移植自mai-bot开源项目
MIT License
200 stars 32 forks source link

数据类型不匹配导致条件判断失效 #147

Closed zeke-mai closed 5 months ago

zeke-mai commented 5 months ago

maimaidx_model.py

class PlayInfoDefault(PlayInfo):

    song_id: int = Field(alias='id')

maimaidx_music_info.py

async def draw_plate_table(qqid: int, version: str, plan: str) -> Union[str, MessageSegment]:
    """绘制完成表"""
        ···
        playerdata: List[PlayInfoDefault] = list(filter(lambda x: x.song_id not in ignore_music, [PlayInfoDefault(**v, ds=mai.total_list.by_id(str(v['id'])).ds[v['level_index']]) for v in obj['verlist']]))
        ···

x.song_id为int,ignore_music中数据类型为str

Yuri-YuzuChaN commented 5 months ago

在修,准备pr

Yuri-YuzuChaN commented 5 months ago

已修复