🐛 Fix check for EnkaNetworkResponse.characters

This commit is contained in:
洛水居室 2023-07-08 14:02:09 +08:00
parent 1d05969cd5
commit 17c66e2142
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -221,9 +221,9 @@ class PlayerCards(Plugin):
if isinstance(data, str): if isinstance(data, str):
await callback_query.answer(text=data, show_alert=True) await callback_query.answer(text=data, show_alert=True)
return return
if data.characters is None: if len(data.characters) == 0:
await message.delete()
await callback_query.answer("请先将角色加入到角色展柜并允许查看角色详情后再使用此功能,如果已经添加了角色,请等待角色数据更新后重试", show_alert=True) await callback_query.answer("请先将角色加入到角色展柜并允许查看角色详情后再使用此功能,如果已经添加了角色,请等待角色数据更新后重试", show_alert=True)
await message.delete()
return return
buttons = self.gen_button(data, user.id, uid, update_button=False) buttons = self.gen_button(data, user.id, uid, update_button=False)
render_data = await self.parse_holder_data(data) render_data = await self.parse_holder_data(data)
@ -286,9 +286,9 @@ class PlayerCards(Plugin):
if isinstance(data, str): if isinstance(data, str):
await message.reply_text(data) await message.reply_text(data)
return return
if data.characters is None: if len(data.characters) == 0:
await message.delete()
await callback_query.answer("请先将角色加入到角色展柜并允许查看角色详情后再使用此功能,如果已经添加了角色,请等待角色数据更新后重试", show_alert=True) await callback_query.answer("请先将角色加入到角色展柜并允许查看角色详情后再使用此功能,如果已经添加了角色,请等待角色数据更新后重试", show_alert=True)
await message.delete()
return return
if page: if page:
buttons = self.gen_button(data, user.id, uid, page, not await self.cache.ttl(uid) > 0) buttons = self.gen_button(data, user.id, uid, page, not await self.cache.ttl(uid) > 0)