diff --git a/LittlePaimon/manager/plugin_manager/__init__.py b/LittlePaimon/manager/plugin_manager/__init__.py index e778042..e49e7ec 100644 --- a/LittlePaimon/manager/plugin_manager/__init__.py +++ b/LittlePaimon/manager/plugin_manager/__init__.py @@ -137,7 +137,7 @@ async def _(): @run_preprocessor async def _(event: MessageEvent, matcher: Matcher): - if matcher.plugin_name in hidden_plugins: + if not matcher.plugin_name or matcher.plugin_name in hidden_plugins: return if isinstance(event, PrivateMessageEvent): session_id = event.user_id diff --git a/LittlePaimon/plugins/Paimon_Gacha_Log/data_source.py b/LittlePaimon/plugins/Paimon_Gacha_Log/data_source.py index 04a08cb..0da1d32 100644 --- a/LittlePaimon/plugins/Paimon_Gacha_Log/data_source.py +++ b/LittlePaimon/plugins/Paimon_Gacha_Log/data_source.py @@ -173,13 +173,12 @@ async def get_gacha_log_img(user_id: str, uid: str, nickname: str): def create_import_command(user_id: int): def file_rule(event: NoticeEvent): - if event.get_user_id() != str(user_id): - return False - if isinstance(event, GroupUploadNoticeEvent): - return True - return event.notice_type == 'offline_file' + if isinstance(event, GroupUploadNoticeEvent) or event.notice_type == 'offline_file': + return event.get_user_id() == str(user_id) + return False import_cmd = on_notice(priority=12, rule=Rule(file_rule), expire_time=datetime.timedelta(minutes=5), temp=True) + import_cmd.plugin_name = 'Paimon_Gacha_Log' @import_cmd.handle() async def _(event: NoticeEvent):