|
1 | 1 | from typing import Union |
2 | 2 |
|
3 | | -from nonebot.internal.matcher import Matcher |
4 | | -from nonebot.params import CommandArg |
5 | | - |
6 | | -from .captcha.captcha import gain_num |
7 | | -from .handle.ssbq_handler import handle_ssbq, sub_list, get_subs |
8 | | -from .handle.coin_handle import mhy_bbs_coin, bbs_auto_coin |
9 | | -from .handle.sign_handle import mhy_bbs_sign, bbs_auto_sign |
10 | | -from .handle.sr_sign_handle import sr_bbs_auto_sign |
11 | | -from .config.config import config |
12 | | -from .utils.logger import Logger |
13 | | -from .web import web_api, web_page # noqa |
14 | | - |
15 | | -from LittlePaimon.database import MihoyoBBSSub, PrivateCookie, DailyNoteSub |
16 | | -from LittlePaimon.utils.message import CommandPlayer, CommandUID, CommandSwitch |
17 | | - |
18 | | -from nonebot import on_command, Bot |
19 | | -from nonebot.typing import T_State |
| 3 | +from LittlePaimon.database import DailyNoteSub, MihoyoBBSSub, PrivateCookie |
| 4 | +from LittlePaimon.utils.message import CommandPlayer, CommandSwitch, CommandUID |
| 5 | +from nonebot import Bot, on_command |
20 | 6 | from nonebot.adapters.onebot.v11 import ( |
21 | | - Message, |
22 | 7 | GroupMessageEvent, |
| 8 | + Message, |
23 | 9 | PrivateMessageEvent, |
24 | 10 | ) |
| 11 | +from nonebot.internal.matcher import Matcher |
| 12 | +from nonebot.params import CommandArg |
25 | 13 | from nonebot.permission import SUPERUSER |
26 | 14 | from nonebot.plugin import PluginMetadata |
27 | 15 | from nonebot.rule import to_me |
| 16 | +from nonebot.typing import T_State |
28 | 17 |
|
| 18 | +from .captcha.captcha import gain_num |
| 19 | +from .config.config import config |
| 20 | +from .handle.coin_handle import bbs_auto_coin, mhy_bbs_coin |
| 21 | +from .handle.sign_handle import bbs_auto_sign, mhy_bbs_sign |
| 22 | +from .handle.sr_sign_handle import sr_bbs_auto_sign |
| 23 | +from .handle.ssbq_handler import get_subs, handle_ssbq, sub_list |
| 24 | +from .utils.logger import Logger |
| 25 | +from .utils.update import do_update |
| 26 | +from .web import web_api, web_page # noqa |
29 | 27 |
|
30 | 28 | __plugin_meta__ = PluginMetadata( |
31 | 29 | name="加强小派蒙验证", |
|
144 | 142 | "pm_priority": 3, |
145 | 143 | }, |
146 | 144 | ) |
| 145 | +update_self = on_command( |
| 146 | + "验证签到插件更新", |
| 147 | + aliases={"签到插件更新"}, |
| 148 | + priority=10, |
| 149 | + block=True, |
| 150 | + permission=SUPERUSER, |
| 151 | + rule=to_me(), |
| 152 | + state={ |
| 153 | + "pm_name": "验证签到插件更新", |
| 154 | + "pm_description": "更新验证签到插件", |
| 155 | + "pm_usage": "@Bot 验证签到插件更新", |
| 156 | + "pm_priority": 10, |
| 157 | + }, |
| 158 | +) |
147 | 159 |
|
148 | 160 | signing_list = [] |
149 | 161 | coin_getting_list = [] |
@@ -520,3 +532,10 @@ async def _( |
520 | 532 | f"UID{sr_uid}尚未开启星铁自动签到,无需关闭!", at_sender=True |
521 | 533 | ) |
522 | 534 | await sr_sign.finish(config.hfu, at_sender=True) |
| 535 | + |
| 536 | + |
| 537 | +@update_self.handle() |
| 538 | +async def _(): |
| 539 | + await update_self.send("正在更新验证签到插件,请稍后", at_sender=True) |
| 540 | + result = await do_update() |
| 541 | + await update_self.finish(result, at_sender=True) |
0 commit comments