From b467408ff99b0fd1d980328ad8adf5ca421e2669 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 24 Dec 2023 21:53:05 +0800 Subject: [PATCH] :bug: Fix missing start handlers --- plugins/account/cookies_export.py | 3 +++ plugins/genshin/pay_log.py | 5 +++-- plugins/genshin/wish_log.py | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/account/cookies_export.py b/plugins/account/cookies_export.py index 74e068c4..27dff2e3 100644 --- a/plugins/account/cookies_export.py +++ b/plugins/account/cookies_export.py @@ -11,6 +11,7 @@ from telegram import ( InputTextMessageContent, InlineQueryResultsButton, ) +from telegram.ext import filters from telegram.error import BadRequest from telegram.helpers import create_deep_linked_url @@ -99,6 +100,7 @@ class CookiesExport(Plugin): return cookies_list @handler.command("cookies_export", block=False) + @handler.command("start", filters=filters.Regex("cookies_export$"), block=False) async def cookies_export(self, update: "Update", _: "ContextTypes.DEFAULT_TYPE"): message = update.effective_message user = update.effective_user @@ -137,6 +139,7 @@ class CookiesExport(Plugin): ] @handler.command("cookies_import", block=False) + @handler.command("start", filters=filters.Regex("cookies_import$"), block=False) async def cookies_import(self, update: "Update", _: "ContextTypes.DEFAULT_TYPE"): message = update.effective_message user = update.effective_user diff --git a/plugins/genshin/pay_log.py b/plugins/genshin/pay_log.py index c2349404..52c1f6d0 100644 --- a/plugins/genshin/pay_log.py +++ b/plugins/genshin/pay_log.py @@ -75,8 +75,9 @@ class PayLogPlugin(Plugin.Conversation): return "派蒙没有找到您所绑定的账号信息,请先私聊派蒙绑定账号" @conversation.entry_point - @handler(CommandHandler, command="pay_log_import", filters=filters.ChatType.PRIVATE, block=False) - @handler(MessageHandler, filters=filters.Regex("^导入充值记录$") & filters.ChatType.PRIVATE, block=False) + @handler.command(command="pay_log_import", filters=filters.ChatType.PRIVATE, block=False) + @handler.message(filters=filters.Regex("^导入充值记录$") & filters.ChatType.PRIVATE, block=False) + @handler.command(command="start", filters=filters.Regex("pay_log_import$"), block=False) async def command_start(self, update: "Update", _: "ContextTypes.DEFAULT_TYPE") -> int: message = update.effective_message user = update.effective_user diff --git a/plugins/genshin/wish_log.py b/plugins/genshin/wish_log.py index fdf687e1..b4186189 100644 --- a/plugins/genshin/wish_log.py +++ b/plugins/genshin/wish_log.py @@ -203,6 +203,7 @@ class WishLogPlugin(Plugin.Conversation): @handler.command(command="wish_log_import", filters=filters.ChatType.PRIVATE, block=False) @handler.command(command="gacha_log_import", filters=filters.ChatType.PRIVATE, block=False) @handler.message(filters=filters.Regex("^导入抽卡记录(.*)") & filters.ChatType.PRIVATE, block=False) + @handler.command(command="start", filters=filters.Regex("gacha_log_import$"), block=False) async def command_start(self, update: "Update", _: "ContextTypes.DEFAULT_TYPE") -> int: message = update.effective_message user = update.effective_user