{"action":"created","issue":{"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/209","repository_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot","labels_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/209/comments","events_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/209/events","html_url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/209","id":142006265,"number":209,"title":"start_polling(), no clean way to exit? (etc)","user":{"login":"zefoo","id":17110349,"avatar_url":"https://avatars.githubusercontent.com/u/17110349?v=3","gravatar_id":"","url":"https://api.github.com/users/zefoo","html_url":"https://github.com/zefoo","followers_url":"https://api.github.com/users/zefoo/followers","following_url":"https://api.github.com/users/zefoo/following{/other_user}","gists_url":"https://api.github.com/users/zefoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zefoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zefoo/subscriptions","organizations_url":"https://api.github.com/users/zefoo/orgs","repos_url":"https://api.github.com/users/zefoo/repos","events_url":"https://api.github.com/users/zefoo/events{/privacy}","received_events_url":"https://api.github.com/users/zefoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"jh0ker","id":3945220,"avatar_url":"https://avatars.githubusercontent.com/u/3945220?v=3","gravatar_id":"","url":"https://api.github.com/users/jh0ker","html_url":"https://github.com/jh0ker","followers_url":"https://api.github.com/users/jh0ker/followers","following_url":"https://api.github.com/users/jh0ker/following{/other_user}","gists_url":"https://api.github.com/users/jh0ker/gists{/gist_id}","starred_url":"https://api.github.com/users/jh0ker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jh0ker/subscriptions","organizations_url":"https://api.github.com/users/jh0ker/orgs","repos_url":"https://api.github.com/users/jh0ker/repos","events_url":"https://api.github.com/users/jh0ker/events{/privacy}","received_events_url":"https://api.github.com/users/jh0ker/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-03-19T00:14:00Z","updated_at":"2016-03-22T02:18:13Z","closed_at":"2016-03-22T02:18:13Z","body":"A few questions numbered for easy reference:\r\n\r\n1. 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. \r\n\r\n2. 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\r\n\r\n3. 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.\r\n\r\n4. 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).\r\n\r\nThank you. "},"comment":{"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/comments/199587105","html_url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/209#issuecomment-199587105","issue_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/209","id":199587105,"user":{"login":"jh0ker","id":3945220,"avatar_url":"https://avatars.githubusercontent.com/u/3945220?v=3","gravatar_id":"","url":"https://api.github.com/users/jh0ker","html_url":"https://github.com/jh0ker","followers_url":"https://api.github.com/users/jh0ker/followers","following_url":"https://api.github.com/users/jh0ker/following{/other_user}","gists_url":"https://api.github.com/users/jh0ker/gists{/gist_id}","starred_url":"https://api.github.com/users/jh0ker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jh0ker/subscriptions","organizations_url":"https://api.github.com/users/jh0ker/orgs","repos_url":"https://api.github.com/users/jh0ker/repos","events_url":"https://api.github.com/users/jh0ker/events{/privacy}","received_events_url":"https://api.github.com/users/jh0ker/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T02:18:13Z","updated_at":"2016-03-22T02:18:13Z","body":"Pinging @tsnoam about that thing, apart from that I'll close this now as you suggested"}}