diff --git a/defs/character.py b/defs/character.py index a222303..9283f35 100644 --- a/defs/character.py +++ b/defs/character.py @@ -106,10 +106,14 @@ async def get_character(name: str): f"称号:{data['title']}\n" \ f"CV:{data['cv']['chinese']}\n" \ f"简介:{data['description']}" - try: + if "card" in data["images"]: url = data["images"]["card"] - except KeyError: + elif "cover2" in data["images"]: + url = data["images"]["cover2"] + elif "icon" in data["images"]: url = data["images"]["icon"] + else: + url = None return result, url diff --git a/plugins/start.py b/plugins/start.py index 52f7336..60396dc 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -1,8 +1,4 @@ -from configparser import RawConfigParser -from os import getcwd, sep - from ci import admin_id -from defs.redis_load import redis, redis_status from pyrogram import Client from pyrogram.types import Message, CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton