Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@nonebot.scheduler.scheduled_job('cron', hour='23', minute='0', second='0', misfire_grace_time=60) # = UTC+8 1445
async def need_sleep():
try:
group_list = await bot.get_group_list()
msg = '现在23点,骑士君该睡觉了!'
groups = [group['group_id'] for group in group_list]
for group in groups:
await bot.send_group_msg(group_id=group, message=msg)
except:
pass