mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-08 04:55:51 +08:00
🎨 将部分函数移出启动执行列表 (#499)
This commit is contained in:
parent
821be7c4f5
commit
7ecbf7646e
@ -3,26 +3,22 @@ import threading
|
|||||||
|
|
||||||
from gsuid_core.logger import logger
|
from gsuid_core.logger import logger
|
||||||
|
|
||||||
|
from ..utils.database import get_sqla
|
||||||
from ..genshinuid_resource import startup
|
from ..genshinuid_resource import startup
|
||||||
from ..genshinuid_xkdata import draw_xk_abyss_img
|
from ..genshinuid_xkdata import draw_xk_abyss_img
|
||||||
from ..genshinuid_help.draw_help_card import draw_help_img
|
from ..genshinuid_help.draw_help_card import draw_help_img
|
||||||
from ..genshinuid_guide.get_abyss_data import generate_data
|
from ..genshinuid_guide.get_abyss_data import generate_data
|
||||||
from ..utils.resource.generate_char_card import create_all_char_card
|
from ..utils.resource.generate_char_card import create_all_char_card
|
||||||
from ..genshinuid_xkdata.get_all_char_data import (
|
|
||||||
save_all_char_info,
|
|
||||||
save_all_abyss_rank,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def all_start():
|
async def all_start():
|
||||||
try:
|
try:
|
||||||
|
get_sqla('TEMP')
|
||||||
await draw_help_img()
|
await draw_help_img()
|
||||||
await startup()
|
await startup()
|
||||||
await create_all_char_card()
|
await create_all_char_card()
|
||||||
await draw_xk_abyss_img()
|
await draw_xk_abyss_img()
|
||||||
await generate_data()
|
await generate_data()
|
||||||
await save_all_char_info()
|
|
||||||
await save_all_abyss_rank()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
|
|
||||||
|
@ -16,12 +16,6 @@ from ..utils.get_assets import get_assets_from_ambr
|
|||||||
from ..utils.map.name_covert import name_to_avatar_id
|
from ..utils.map.name_covert import name_to_avatar_id
|
||||||
from ..utils.image.convert import str_lenth, convert_img
|
from ..utils.image.convert import str_lenth, convert_img
|
||||||
from ..utils.resource.RESOURCE_PATH import CHAR_PATH, WIKI_COST_CHAR_PATH
|
from ..utils.resource.RESOURCE_PATH import CHAR_PATH, WIKI_COST_CHAR_PATH
|
||||||
from ..utils.image.image_tools import (
|
|
||||||
get_star_png,
|
|
||||||
get_simple_bg,
|
|
||||||
get_unknown_png,
|
|
||||||
draw_pic_with_ring,
|
|
||||||
)
|
|
||||||
from ..utils.fonts.genshin_fonts import (
|
from ..utils.fonts.genshin_fonts import (
|
||||||
gs_font_24,
|
gs_font_24,
|
||||||
gs_font_26,
|
gs_font_26,
|
||||||
@ -29,6 +23,12 @@ from ..utils.fonts.genshin_fonts import (
|
|||||||
gs_font_36,
|
gs_font_36,
|
||||||
gs_font_44,
|
gs_font_44,
|
||||||
)
|
)
|
||||||
|
from ..utils.image.image_tools import (
|
||||||
|
get_star_png,
|
||||||
|
get_simple_bg,
|
||||||
|
get_unknown_png,
|
||||||
|
draw_pic_with_ring,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def get_char_cost_wiki_img(name: str) -> Union[str, bytes]:
|
async def get_char_cost_wiki_img(name: str) -> Union[str, bytes]:
|
||||||
|
@ -8,6 +8,7 @@ from gsuid_core.aps import scheduler
|
|||||||
|
|
||||||
from ..utils.image.convert import convert_img
|
from ..utils.image.convert import convert_img
|
||||||
from .draw_abyss_total import TOTAL_IMG, draw_xk_abyss_img
|
from .draw_abyss_total import TOTAL_IMG, draw_xk_abyss_img
|
||||||
|
from .get_all_char_data import save_all_char_info, save_all_abyss_rank
|
||||||
|
|
||||||
sv_get_abyss_database = SV('查询深渊数据库', priority=4)
|
sv_get_abyss_database = SV('查询深渊数据库', priority=4)
|
||||||
|
|
||||||
@ -18,6 +19,14 @@ async def scheduled_draw_abyss():
|
|||||||
await draw_xk_abyss_img()
|
await draw_xk_abyss_img()
|
||||||
|
|
||||||
|
|
||||||
|
@scheduler.scheduled_job('interval', hours=11)
|
||||||
|
async def scheduled_get_xk_data():
|
||||||
|
await asyncio.sleep(random.randint(0, 60))
|
||||||
|
await save_all_char_info()
|
||||||
|
await asyncio.sleep(random.randint(2, 60))
|
||||||
|
await save_all_abyss_rank()
|
||||||
|
|
||||||
|
|
||||||
@sv_get_abyss_database.on_fullmatch(('深渊概览', '深渊统计', '深渊使用率'), block=True)
|
@sv_get_abyss_database.on_fullmatch(('深渊概览', '深渊统计', '深渊使用率'), block=True)
|
||||||
async def send_abyss_pic(bot: Bot, ev: Event):
|
async def send_abyss_pic(bot: Bot, ev: Event):
|
||||||
img = await convert_img(TOTAL_IMG)
|
img = await convert_img(TOTAL_IMG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user