Esempio n. 1
0
def polling(skip_updates: bool):
    """
    start bot in polling mode
    """
    from app.utils.executor import runner

    runner.skip_updates = skip_updates
    runner.start_polling(reset_webhook=True)
Esempio n. 2
0
    def polling(skip_updates: bool):
        """
        Start application
        """
        from app.utils.executor import runner
        logger.info("starting polling...")

        runner.skip_updates = skip_updates
        runner.start_polling(reset_webhook=True)
Esempio n. 3
0
    def polling(skip_updates: bool):
        """
        Запуск бота на лонгпуллинге
        """
        from app.utils.executor import runner

        logger.info("Starting polling...")

        runner.skip_updates = skip_updates
        runner.start_polling()
Esempio n. 4
0
def cli(config: Config):

    parser = create_parser()
    namespace = parser.parse_args()

    from app import misc
    from app.utils.executor import runner

    misc.setup(config)
    if namespace.polling:
        logger.info("starting polling...")

        runner.skip_updates = namespace.skip_updates
        runner.start_polling(reset_webhook=True)
    else:
        logger.info("starting webhook...")
        runner.start_webhook(**config.webhook.listener_kwargs)
Esempio n. 5
0
from app import settings
from app.misc import setup

if __name__ == "__main__":
    setup()
    if hasattr(settings, "RUN_POLLING") and settings.RUN_POLLING:
        from app.utils.executor import runner

        runner.start_polling()