Add APScheduler as builtin scheduler

This commit is contained in:
Richard Chien
2018-08-26 10:05:42 +08:00
parent 2884a58a52
commit 01d6a8cb3c
5 changed files with 41 additions and 1 deletions

View File

@ -4,7 +4,18 @@ import none
from demo import config
none.init(config)
app = none.get_bot().asgi
@none.scheduler.scheduled_job('interval', seconds=3)
async def cb():
bot_ = none.get_bot()
try:
await bot_.send_private_msg(self_id=3281334718,
user_id=1002647525,
message='')
except Exception as e:
none.logger.exception(e)
if __name__ == '__main__':
none.load_builtin_plugins()