mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-25 09:35:03 +08:00
17 lines
427 B
Python
17 lines
427 B
Python
|
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
|