INNER CODE UNIT · Python

init

thevickypedia/Jarvis · jarvis/api/background_task/bot.py:38

async def init() -> None:
    """Initialize telegram API and decide to choose webhook vs long polling."""
    _flag = await telegram.telegram_api()
    if _flag:
        logger.info("Polling for incoming messages...")
    telegram_beat.poll_for_messages = _flag


async def restart_loop(after: int) -> None:
    """Restart telegram polling.

    Args:
        after: Delay in seconds.

    See Also:
        - Stops telegram polling immediately.
        - Sleeps for the mentioned delay.
        - Sets the restart_loop flag to true.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…