Esempio n. 1
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='Telegram gcloner first call, start.')
    updater.idle()
Esempio n. 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()