mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 01:29:42 +00:00
🐛 Fix bug
This commit is contained in:
parent
12ee237c1b
commit
f3fe7139f7
@ -68,7 +68,7 @@ class PluginFuncs:
|
|||||||
except Forbidden as exc:
|
except Forbidden as exc:
|
||||||
logger.warning("删除消息 %s message_id[%s] 失败 %s", chat_info, message_id, exc.message)
|
logger.warning("删除消息 %s message_id[%s] 失败 %s", chat_info, message_id, exc.message)
|
||||||
except Exception as exc:
|
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:
|
async def get_chat(self, chat_id: Union[str, int], redis_db: Optional[RedisDB] = None, expire: int = 86400) -> Chat:
|
||||||
application = self.application
|
application = self.application
|
||||||
|
@ -17,7 +17,7 @@ class HelpRawPlugin(Plugin):
|
|||||||
self.help_raw: Optional[str] = None
|
self.help_raw: Optional[str] = None
|
||||||
|
|
||||||
async def initialize(self):
|
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:
|
async with aiofiles.open(file_path, mode="r", encoding="utf-8") as f:
|
||||||
html_content = await f.read()
|
html_content = await f.read()
|
||||||
soup = BeautifulSoup(html_content, "lxml")
|
soup = BeautifulSoup(html_content, "lxml")
|
||||||
|
@ -51,9 +51,8 @@ class PlayerInfoSystem(Plugin):
|
|||||||
player_info = await self.player_info_service.get(player)
|
player_info = await self.player_info_service.get(player)
|
||||||
name_card: Optional[str] = None
|
name_card: Optional[str] = None
|
||||||
try:
|
try:
|
||||||
if player_info is not None:
|
if player_info is not None and player_info.name_card is not None:
|
||||||
if player_info.name_card is not None:
|
name_card = (await self.assets_service.namecard(int(player_info.name_card)).navbar()).as_uri()
|
||||||
name_card = (await self.assets_service.namecard(int(player_info.name_card)).navbar()).as_uri()
|
|
||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
logger.error("卡片信息请求失败 %s", str(exc))
|
logger.error("卡片信息请求失败 %s", str(exc))
|
||||||
if name_card is None: # 默认
|
if name_card is None: # 默认
|
||||||
|
Loading…
Reference in New Issue
Block a user