def main():
    log_file = init_logger()
    config.load_config()
    config.LOG_FILE = log_file

    telegram_pickle = PicklePersistence(filename='pickle_{}'.format(
        config.USER_IDS[0]),
                                        store_bot_data=True,
                                        store_user_data=True,
                                        store_chat_data=False)
    q = mq.MessageQueue()
    request = TGRequest(con_pool_size=8)
    my_bot = MQBot(config.TELEGRAM_TOKEN, request=request, mqueue=q)
    updater = Updater(bot=my_bot,
                      use_context=True,
                      persistence=telegram_pickle)

    updater.dispatcher.add_error_handler(error)

    load_handlers(updater.dispatcher)

    updater.start_polling()
    updater.bot.send_message(chat_id=config.USER_IDS[0],
                             text='Telegram gcloner first call, start.')
    updater.idle()
Exemple #2
0
def main():
    log_file = init_logger()
    config.load_config()
    config.LOG_FILE = log_file

    telegram_pickle = PicklePersistence(filename='pickle_{}'.format(
        config.USER_IDS[0]),
                                        store_bot_data=True,
                                        store_user_data=True,
                                        store_chat_data=False)
    q = mq.MessageQueue()
    request = TGRequest(con_pool_size=8)
    my_bot = MQBot(config.TELEGRAM_TOKEN, request=request, mqueue=q)
    updater = Updater(bot=my_bot,
                      use_context=True,
                      persistence=telegram_pickle)

    updater.dispatcher.add_error_handler(error)

    load_handlers(updater.dispatcher)

    updater.start_polling()
    updater.bot.send_message(
        chat_id=config.USER_IDS[0],
        text='⚡️ 𝒞𝓁𝑜𝓃𝑒𝐵𝑜𝓉"𝒶 𝒽𝑜ş 𝑔𝑒𝓁𝒹𝒾𝓃𝒾𝓏. 𝐵𝒶𝓏ı 𝓋𝑒𝓇𝒾𝓁𝑒𝓇𝒾 𝓀𝑜𝓅𝓎𝒶𝓁𝒶𝓎𝒶𝓁ı𝓂 !')
    updater.idle()