A few questions numbered for easy reference:
- If I am using virtualenv, and I'm activated in the environment, and if I run my code via python -m myteleapp (code nearly identical to https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py ) ... which starts polling, I can't seem to exit out of polling with ctrl+c. Only way is to kill -9 my app and I don't think this is good for a shutdown. Is there any other way to break out of start_polling()? Perhaps I am doing something wrong.
- Or, is there a way to shutdown start_polling if I send the bot a specific message (which I would valid against a certain chat_id)? I tried sys.exit(0) in echo-like function from here https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py
- Does start_polling() poll every second? Or what's the delay? It looks like default is 0 from the code. Does that mean that it's immediate? This is partly why I went with webhooks, I thought it would be quicker, but this may be my misunderstanding.
- The reason I'm wanting to break out of start_polling() is because if I import another mod from my echo-like module, and if I update this other module that's included, I want to make sure start_polling() calls functions with the latest code. I believe I have to do this, I don't believe start_polling() would account for updates to code alone (since the process would stay active).
Thank you.
A few questions numbered for easy reference:
Thank you.