🐛 Fix bug

This commit is contained in:
洛水居室 2023-05-10 17:30:28 +08:00
parent 12ee237c1b
commit f3fe7139f7
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
3 changed files with 4 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class PluginFuncs:
except Forbidden as exc:
logger.warning("删除消息 %s message_id[%s] 失败 %s", chat_info, message_id, exc.message)
except Exception as exc:
logger.error("删除消息 %s message_id[%s] 失败 %s", chat_info, message_id, exc_info=exc)
logger.error("删除消息 %s message_id[%s] 失败", chat_info, message_id, exc_info=exc)
async def get_chat(self, chat_id: Union[str, int], redis_db: Optional[RedisDB] = None, expire: int = 86400) -> Chat:
application = self.application

View File

@ -17,7 +17,7 @@ class HelpRawPlugin(Plugin):
self.help_raw: Optional[str] = None
async def initialize(self):
file_path = os.path.join(os.getcwd(), "resources", "bot", "help", "help.html") # resources/bot/help/help.html
file_path = os.path.join(os.getcwd(), "resources", "bot", "help", "help.jinja2")
async with aiofiles.open(file_path, mode="r", encoding="utf-8") as f:
html_content = await f.read()
soup = BeautifulSoup(html_content, "lxml")

View File

@ -51,8 +51,7 @@ class PlayerInfoSystem(Plugin):
player_info = await self.player_info_service.get(player)
name_card: Optional[str] = None
try:
if player_info is not None:
if player_info.name_card is not None:
if player_info is not None and player_info.name_card is not None:
name_card = (await self.assets_service.namecard(int(player_info.name_card)).navbar()).as_uri()
except Exception as exc: # pylint: disable=W0703
logger.error("卡片信息请求失败 %s", str(exc))