From 8f1ba2e5d1d14dedbbd7f519d8b3de5f47e13a18 Mon Sep 17 00:00:00 2001 From: sudoskys Date: Wed, 6 Sep 2023 13:26:10 +0800 Subject: [PATCH] 0.07 --- plugins/bilibili.py | 4 ++-- plugins/search.py | 4 ++-- task/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/bilibili.py b/plugins/bilibili.py index cb92265..064114a 100644 --- a/plugins/bilibili.py +++ b/plugins/bilibili.py @@ -71,8 +71,8 @@ def pre_check(self): try: import bilibili_api return True - except ImportError: - logger.error("plugin:package not installed") + except ImportError as e: + logger.error(f"plugin:package not installed:{e}") return False def func_message(self, message_text): diff --git a/plugins/search.py b/plugins/search.py index b571a59..d53005a 100644 --- a/plugins/search.py +++ b/plugins/search.py @@ -77,8 +77,8 @@ def pre_check(self): from duckduckgo_search import DDGS from middleware.filter.sublimate import Sublimate return True - except ImportError: - logger.warning("plugin:package not found,please install it first") + except ImportError as e: + logger.warning(f"plugin:package not found,please install it first:{e}") return False def func_message(self, message_text): diff --git a/task/__init__.py b/task/__init__.py index 11bf7c1..e1910d2 100644 --- a/task/__init__.py +++ b/task/__init__.py @@ -29,7 +29,7 @@ async def send_task(self, task: TaskHeader): async with connection: channel = await connection.channel() message = Message( - task.json().encode(), delivery_mode=DeliveryMode.PERSISTENT, + task.json().encode("utf-8"), delivery_mode=DeliveryMode.PERSISTENT, ) await channel.declare_queue( self.queue_name, durable=True,