misskey2telegram/modules/timeline.py

15 lines
407 B
Python
Raw Normal View History

2023-07-05 12:10:41 +00:00
import contextlib
2022-12-22 14:18:43 +00:00
from init import bot
2023-07-05 12:10:41 +00:00
from misskey_init import init_misskey_bot, misskey_bot_map
from models.services.scheduler import scheduler
2022-12-24 13:19:24 +00:00
2023-01-27 12:36:41 +00:00
bot.loop.create_task(init_misskey_bot())
2023-07-05 12:10:41 +00:00
@scheduler.scheduled_job("cron", hour=1, id="daily_status")
async def daily_status():
for m_bot in misskey_bot_map.values():
with contextlib.suppress(Exception):
await m_bot.core.api.get_me()