def main(api_key): global bot bot = telepot.Bot(api_key) bot.message_loop(handle) print('Listening ...') while True: time.sleep(10)