From 400da8bb3c8f8357cdd864835f949abd93027cd8 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 28 Jan 2022 20:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20v0.3.2=20=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E5=91=BD=E4=BB=A4=E5=9C=A8=E7=A7=81=E8=81=8A?= =?UTF-8?q?=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mihoyo.py | 30 ++++++++++++++++++++++++++++++ plugins/mys2.py | 39 +++++++++++++++++++++++++++++++++++++++ plugins/start.py | 12 ++++++------ requirements.txt | 1 - 4 files changed, 75 insertions(+), 7 deletions(-) diff --git a/plugins/mihoyo.py b/plugins/mihoyo.py index bbe3c06..da6b114 100644 --- a/plugins/mihoyo.py +++ b/plugins/mihoyo.py @@ -62,6 +62,36 @@ async def mihoyo_msg(client: Client, message: Message): except Exception as e: traceback.print_exc() await message.reply("未找到uid绑定记录。", quote=True) + elif "签到" in text: + try: + uid = await selectDB(message.from_user.id, mode="uid") + uid = uid[0] + im = await sign(uid) + await message.reply(im, quote=True) + except Exception as e: + traceback.print_exc() + await message.reply('未找到绑定信息', quote=True) + elif "效验全部" in text: + im = await CheckDB() + await message.reply(im, quote=True) + elif "当前状态" in text: + try: + uid = await selectDB(message.from_user.id, mode="uid") + uid = uid[0] + mes = await daily("ask", uid) + im = mes[0]['message'] + except Exception as e: + traceback.print_exc() + im = "没有找到绑定信息。" + await message.reply(im, quote=True) + elif "绑定uid" in text: + uid = text.replace("绑定uid", "") # str + await connectDB(message.from_user.id, uid) + await message.reply('绑定uid成功!', quote=True) + elif "绑定mys" in text: + mys = text.replace("绑定mys", "") # str + await connectDB(message.from_user.id, None, mys) + await message.reply('绑定米游社id成功!', quote=True) async def mihoyo_qun_msg(client: Client, message: Message): diff --git a/plugins/mys2.py b/plugins/mys2.py index 6dca15c..cabfed3 100644 --- a/plugins/mys2.py +++ b/plugins/mys2.py @@ -70,6 +70,45 @@ async def mys2_msg(client: Client, message: Message): except Exception as e: traceback.print_exc() await message.reply("未找到uid绑定记录。", quote=True) + elif "每月统计" in text: + try: + uid = await selectDB(message.from_user.id, mode="uid") + uid = uid[0] + im = await award(uid) + await message.reply(im, quote=True) + except Exception as e: + traceback.print_exc() + await message.reply('未找到绑定信息', quote=True) + elif "签到" in text: + try: + uid = await selectDB(message.from_user.id, mode="uid") + uid = uid[0] + im = await sign(uid) + await message.reply(im, quote=True) + except Exception as e: + traceback.print_exc() + await message.reply('未找到绑定信息', quote=True) + elif "当前状态" in text: + try: + uid = await selectDB(message.from_user.id, mode="uid") + uid = uid[0] + mes = await daily("ask", uid) + im = mes[0]['message'] + except Exception as e: + traceback.print_exc() + im = "没有找到绑定信息。" + await message.reply(im, quote=True) + elif "绑定uid" in text: + uid = text.replace("绑定uid", "") # str + if is_chinese(uid): + await connectDB(message.from_user.id, uid) + await message.reply('绑定uid成功!', quote=True) + else: + await message.reply("非国区uid!", quote=True) + elif "绑定mys" in text: + mys = text.replace("绑定mys", "") # str + await connectDB(message.from_user.id, None, mys) + await message.reply('绑定米游社id成功!', quote=True) async def mys2_qun_msg(client: Client, message: Message): diff --git a/plugins/start.py b/plugins/start.py index 81af7ba..7807cca 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -2,7 +2,7 @@ from ci import admin_id from pyrogram import Client from pyrogram.types import Message, CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton -HELP_MSG_PRE = 'PaimonBot 0.3.1beta By Xtao-Labs\n\n' \ +HELP_MSG_PRE = 'PaimonBot 0.3.2beta By Xtao-Labs\n\n' \ '🔅 以下是小派蒙我学会了的功能(部分):\n' HELP_MSG = """① [武器/今日武器] 查看今日武器材料和武器 ② [天赋/今日天赋] 查看今日天赋材料和角色 @@ -32,11 +32,11 @@ HELP_MSG = """① [武器/今日武器] 查看今日武器材料和武器 💠 米游社添加(私聊) 💠 米游社推送开启/关闭 💠 米游社自动签到开启/关闭 - 💠 米游社每月统计(群聊) - 💠 米游社签到(群聊) - 💠 米游社当前状态(群聊) - 💠 米游社绑定uid+游戏uid(群聊) - 💠 米游社绑定mys+米游社id(群聊) + 💠 米游社每月统计 + 💠 米游社签到 + 💠 米游社当前状态 + 💠 米游社绑定uid+游戏uid + 💠 米游社绑定mys+米游社id 💠 米游社uid+游戏uid(支持自定义图片)(群聊) 💠 米游社mys+米游社id(支持自定义图片)(群聊) 💠 米游社查询(支持回复、自定义图片)(群聊) diff --git a/requirements.txt b/requirements.txt index c05cb37..9ee2bf4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,6 @@ beautifulsoup4>=4.9.3 requests>=2.27.1 xpinyin>=0.7.6 lxml>=4.6.3 -httpx>=0.21.3 pyyaml>=6.0 httpx>=0.18.1 apscheduler>=3.8.1