from __future__ import annotations import asyncio from datetime import date, datetime, time async def main ( ) -> None: # キリ番祝ひ ... # 投稿報知 ... # クエリ処理 ... async def schedule_task ( dt_tuple: tuple[int | None, int | None, int | None, int | None, int | None, int | None], ) -> None: ... def dt_to_tuple ( dt: datetime | date | time, ) -> tuple[int | None, int | None, int | None, int | None, int | None, int | None]: year: int | None = None month: int | None = None day: int | None = None hour: int | None = None minute: int | None = None second: int | None = None if not isinstance (dt, time): year = dt.year month = dt.month day = dt.day if not isinstance (dt, date): hour = dt.hour minute = dt.minute second = dt.second return (year, month, day, hour, minute, second) if __name__ == '__main__': asyncio.run (main ())