Add docs for scheduler

This commit is contained in:
Richard Chien
2018-08-26 12:35:53 +08:00
parent 72abed9cb0
commit 3b67b79ffc
12 changed files with 249 additions and 0 deletions

View File

@ -0,0 +1,16 @@
from datetime import datetime
import none
import pytz
from aiocqhttp.exceptions import Error as CQHttpError
@none.scheduler.scheduled_job('cron', hour='*')
async def _():
bot = none.get_bot()
now = datetime.now(pytz.timezone('Asia/Shanghai'))
try:
await bot.send_group_msg(group_id=672076603,
message=f'现在{now.hour}点整啦!')
except CQHttpError:
pass