I was developing a telegram bot, running from my personal machine (Mac) The bot is running on python, in a specific environment with modules installed on that environment
Now that the bot is fine, I'd like to put it on a web server, running Apache. But I have some questions.
1) I have to install each module at the server to everybody or I can create an environment for this specific bot and apache runs that bot on that environment?
2) I was using getUpdates (makes my machine very slow, but is better to debug errors) and now I want to run using webhook. What a have to change exactly to make him work if webhook instead of getUpdates going to telegram server? Today the code to start and keep running is that:
def main():
updater = Updater(bot_token)
dp = updater.dispatcher
# Commands
dp.add_handler(CommandHandler("info", ranking_putaria))
dp.add_handler(CommandHandler("start", start))
# Start checking updates
dp.add_handler(MessageHandler(Filters.text,echo_msg))
dp.add_handler(MessageHandler(Filters.video | Filters.photo | Filters.document, echo_file))
dp.add_handler(MessageHandler(Filters.sticker, echo_sticker))
# Log errors
#dp.add_error_handler(error)
# start the bot
updater.start_polling()
# Run the bot until you press Ctrl-C or the process receives SIGINT,
# SIGTERM or SIGABRT. This should be used most of the time, since
# start_polling() is non-blocking and will stop the bot gracefully.
updater.idle()
if __name__ == '__main__':
main()