mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-30 04:00:31 +08:00
✨ 增加切换api
This commit is contained in:
parent
27bc2a6aa5
commit
61293fb072
@ -5,16 +5,30 @@ from pathlib import Path
|
||||
from .draw_char_card import *
|
||||
from .draw_char_card import draw_char_img
|
||||
from ..all_import import * # noqa: F401,F403
|
||||
from ..utils.enka_api.get_enka_data import switch_api
|
||||
from ..utils.enka_api.enka_to_data import enka_to_data
|
||||
from ..utils.db_operation.db_operation import get_all_uid
|
||||
from ..utils.message.error_reply import * # noqa: F401,F403
|
||||
from ..utils.mhy_api.convert_mysid_to_uid import convert_mysid
|
||||
from ..utils.alias.alias_to_char_name import alias_to_char_name
|
||||
|
||||
AUTO_REFRESH = False
|
||||
PLAYER_PATH = Path(__file__).parents[1] / 'player'
|
||||
|
||||
|
||||
@sv.on_fullmatch('切换api')
|
||||
async def send_change_api_info(bot: HoshinoBot, ev: CQEvent):
|
||||
if ev.sender:
|
||||
qid = int(ev.sender['user_id'])
|
||||
else:
|
||||
return
|
||||
|
||||
if qid not in bot.config.SUPERUSERS:
|
||||
return
|
||||
|
||||
im = await switch_api()
|
||||
await bot.send(ev, im)
|
||||
|
||||
|
||||
@sv.on_rex(
|
||||
r'^(\[CQ:at,qq=[0-9]+\])?( )?'
|
||||
r'(uid|查询|mys)([0-9]+)?'
|
||||
|
@ -24,6 +24,13 @@ async def get_sign_func(bot: HoshinoBot, ev: CQEvent):
|
||||
|
||||
@sv.on_fullmatch('全部重签')
|
||||
async def recheck(bot: HoshinoBot, ev: CQEvent):
|
||||
if ev.sender:
|
||||
qid = int(ev.sender['user_id'])
|
||||
else:
|
||||
return
|
||||
if qid not in bot.config.SUPERUSERS:
|
||||
return
|
||||
|
||||
logger.info('开始执行[全部重签]')
|
||||
await bot.send(ev, '已开始执行')
|
||||
await send_daily_sign()
|
||||
|
Loading…
x
Reference in New Issue
Block a user