From 84a06e915b3545b7ef6a416f0bf90ec01ba6a525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Thu, 8 Sep 2022 09:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BF=AE=E6=94=B9=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=91=BD=E4=BB=A4=E5=B9=B6=E6=9B=B4=E6=96=B0=20`help`?= =?UTF-8?q?=20=E5=91=BD=E4=BB=A4=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/{adduser.py => cookies.py} | 6 +++--- plugins/genshin/{set_uid.py => uid.py} | 7 ++++--- resources/bot/help/help.html | 9 ++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) rename plugins/genshin/{adduser.py => cookies.py} (98%) rename plugins/genshin/{set_uid.py => uid.py} (95%) diff --git a/plugins/genshin/adduser.py b/plugins/genshin/cookies.py similarity index 98% rename from plugins/genshin/adduser.py rename to plugins/genshin/cookies.py index d362c472..e85f02a7 100644 --- a/plugins/genshin/adduser.py +++ b/plugins/genshin/cookies.py @@ -32,15 +32,15 @@ class AddUserCommandData(TelegramObject): CHECK_SERVER, CHECK_COOKIES, COMMAND_RESULT = range(10100, 10103) -class AddUser(Plugin.Conversation, BasePlugin.Conversation): - """用户绑定""" +class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation): + """Cookie绑定""" def __init__(self, user_service: UserService = None, cookies_service: CookiesService = None): self.cookies_service = cookies_service self.user_service = user_service @conversation.entry_point - @handler.command(command='adduser', filters=filters.ChatType.PRIVATE, block=True) + @handler.command(command='setcookies', filters=filters.ChatType.PRIVATE, block=True) @restricts() @error_callable async def command_start(self, update: Update, context: CallbackContext) -> int: diff --git a/plugins/genshin/set_uid.py b/plugins/genshin/uid.py similarity index 95% rename from plugins/genshin/set_uid.py rename to plugins/genshin/uid.py index 37aed289..2772b926 100644 --- a/plugins/genshin/set_uid.py +++ b/plugins/genshin/uid.py @@ -28,7 +28,7 @@ class AddUserCommandData(TelegramObject): CHECK_SERVER, CHECK_UID, COMMAND_RESULT = range(10100, 10103) -class SetUid(Plugin.Conversation, BasePlugin.Conversation): +class SetUserUid(Plugin.Conversation, BasePlugin.Conversation): """UID用户绑定""" def __init__(self, user_service: UserService = None, cookies_service: CookiesService = None, @@ -38,7 +38,7 @@ class SetUid(Plugin.Conversation, BasePlugin.Conversation): self.user_service = user_service @conversation.entry_point - @handler.command(command='set_uid', filters=filters.ChatType.PRIVATE, block=True) + @handler.command(command='setuid', filters=filters.ChatType.PRIVATE, block=True) @restricts() @error_callable async def command_start(self, update: Update, context: CallbackContext) -> int: @@ -49,7 +49,8 @@ class SetUid(Plugin.Conversation, BasePlugin.Conversation): if add_user_command_data is None: cookies_command_data = AddUserCommandData() context.chat_data["add_uid_command_data"] = cookies_command_data - text = f'你好 {user.mention_markdown_v2()} {escape_markdown("!请选择要绑定的服务器!或回复退出取消操作")}' + text = f'你好 {user.mention_markdown_v2()} ' \ + f'{escape_markdown("!本次绑定只绑定UID,未绑定Cookies部分功能无法使用。请选择要绑定的服务器!或回复退出取消操作")}' reply_keyboard = [['米游社', 'HoYoLab'], ["退出"]] await message.reply_markdown_v2(text, reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True)) return CHECK_SERVER diff --git a/resources/bot/help/help.html b/resources/bot/help/help.html index 641a1ed7..27d7c752 100644 --- a/resources/bot/help/help.html +++ b/resources/bot/help/help.html @@ -115,10 +115,13 @@ 派蒙的十万个为什么 -
-
/adduser
-
添加账号(请私聊BOT)
+
/setuid
+
添加UID(请私聊BOT)
+
+
+
/setcookies
+
添加Cookies(请私聊BOT)
/cancel