How to use the nonebot.scheduler.scheduled_job function in nonebot

To help you get started, we’ve selected a few nonebot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Joenothing-lst / kkl-Android-2.0 / kkl_bot / kkl / plugins / scheduler.py View on Github external
@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

nonebot

An asynchronous QQ bot framework based on CoolQ.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis