🐛 fix bug

This commit is contained in:
CMHopeSunshine 2022-09-07 19:10:00 +08:00
parent dbc97f8c5b
commit 493cbbcff0
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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):