From ceaf0a1b098c41bf270c7a1c7d94489550036fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Tue, 6 Jun 2023 17:03:08 +0800 Subject: [PATCH] :bug: Fixed the issue where some commands did not run in a non-blocking manner --- plugins/admin/refresh_metadata.py | 2 +- plugins/genshin/daily/material.py | 2 +- plugins/genshin/map.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/admin/refresh_metadata.py b/plugins/admin/refresh_metadata.py index a1194a43..557d28a8 100644 --- a/plugins/admin/refresh_metadata.py +++ b/plugins/admin/refresh_metadata.py @@ -11,7 +11,7 @@ __all__ = ("MetadataPlugin",) class MetadataPlugin(Plugin): - @handler.command("refresh_metadata", admin=True) + @handler.command("refresh_metadata", admin=True, block=False) async def refresh(self, update: Update, _: CallbackContext) -> None: message = update.effective_message user = update.effective_user diff --git a/plugins/genshin/daily/material.py b/plugins/genshin/daily/material.py index afb6c4a9..05a4b2db 100644 --- a/plugins/genshin/daily/material.py +++ b/plugins/genshin/daily/material.py @@ -340,7 +340,7 @@ class DailyMaterial(Plugin): logger.debug("角色、武器培养素材图发送成功") - @handler.command("refresh_daily_material", block=False) + @handler.command("refresh_daily_material", admin=True, block=False) async def refresh(self, update: Update, context: CallbackContext): user = update.effective_user message = update.effective_message diff --git a/plugins/genshin/map.py b/plugins/genshin/map.py index d01391b7..2e139433 100644 --- a/plugins/genshin/map.py +++ b/plugins/genshin/map.py @@ -185,7 +185,7 @@ class Map(Plugin): except MapException as e: await message.reply_text(e.message) - @handler.command("refresh_map", admin=True) + @handler.command("refresh_map", admin=True, block=False) async def refresh_map(self, update: Update, _: CallbackContext): message = update.effective_message msg = await message.reply_text("正在刷新地图数据,请耐心等待...")