🐞 fix: 增加netease解析健壮性

This commit is contained in:
zhiyu1998 2023-03-16 18:31:09 +08:00
parent fd271ec0ed
commit 4e6fe09e4f

View File

@ -166,8 +166,8 @@ export class neteasepro extends plugin {
} else {
// 非小程序
const title = await getSongDetail(id).then(res => {
const song = res.songs[0];
return `${song?.name}-${song?.ar?.[0].name}`.replace(/[\/\?<>\\:\*\|".… ]/g, "");
const song = res?.songs[0];
return song.length > 0 ? `${song?.name}-${song?.ar?.[0].name}`.replace(/[\/\?<>\\:\*\|".… ]/g, "") : "暂无信息";
});
e.reply(`识别:网易云音乐,${title}`);
}