mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update __init__.py
This commit is contained in:
parent
72cd1c700a
commit
d8a997e568
@ -32,13 +32,11 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
|||||||
|
|
||||||
@super_cmd.handle()
|
@super_cmd.handle()
|
||||||
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||||
try:
|
if await update_image():
|
||||||
await update_image()
|
|
||||||
await super_cmd.send('更新成功...')
|
await super_cmd.send('更新成功...')
|
||||||
logger.info(f'更新每日天赋素材成功...')
|
logger.info(f'更新每日天赋素材成功...')
|
||||||
except Exception as e:
|
else:
|
||||||
await super_cmd.send(f'更新出错e:{e}')
|
await super_cmd.send(f'更新失败...')
|
||||||
logger.error(f'更新每日天赋素材出错 e:{e}')
|
|
||||||
|
|
||||||
|
|
||||||
@driver.on_startup
|
@driver.on_startup
|
||||||
@ -56,9 +54,10 @@ async def update_image():
|
|||||||
card = await card.bounding_box()
|
card = await card.bounding_box()
|
||||||
await page.screenshot(path=f'{IMAGE_PATH}/genshin/daily_material.png', clip=card, timeout=100000)
|
await page.screenshot(path=f'{IMAGE_PATH}/genshin/daily_material.png', clip=card, timeout=100000)
|
||||||
await page.close()
|
await page.close()
|
||||||
except Exception:
|
return True
|
||||||
logger.warning('win环境下 使用playwright失败....请替换环境至linux')
|
except Exception as e:
|
||||||
pass
|
logger.error(f'原神每日素材更新出错... {type(e)}: {e}')
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
@scheduler.scheduled_job(
|
@scheduler.scheduled_job(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user