{"action":"created","issue":{"url":"https://api.github.com/repos/nickoala/telepot/issues/46","repository_url":"https://api.github.com/repos/nickoala/telepot","labels_url":"https://api.github.com/repos/nickoala/telepot/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/nickoala/telepot/issues/46/comments","events_url":"https://api.github.com/repos/nickoala/telepot/issues/46/events","html_url":"https://github.com/nickoala/telepot/issues/46","id":145155871,"number":46,"title":"Async example doubles all the messages","user":{"login":"par-n-go","id":7044999,"avatar_url":"https://avatars.githubusercontent.com/u/7044999?v=3","gravatar_id":"","url":"https://api.github.com/users/par-n-go","html_url":"https://github.com/par-n-go","followers_url":"https://api.github.com/users/par-n-go/followers","following_url":"https://api.github.com/users/par-n-go/following{/other_user}","gists_url":"https://api.github.com/users/par-n-go/gists{/gist_id}","starred_url":"https://api.github.com/users/par-n-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/par-n-go/subscriptions","organizations_url":"https://api.github.com/users/par-n-go/orgs","repos_url":"https://api.github.com/users/par-n-go/repos","events_url":"https://api.github.com/users/par-n-go/events{/privacy}","received_events_url":"https://api.github.com/users/par-n-go/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-01T11:33:45Z","updated_at":"2016-04-04T07:48:41Z","closed_at":null,"body":"When running the code below I get double the messages for every message I send:\r\nNormal Message: text private 888888888\r\nNormal Message: text private 888888888\r\n\r\nWhat am I doing wrong?\r\n\r\n```\r\nimport sys\r\nimport asyncio\r\nimport telepot\r\nimport telepot.async\r\n\r\ndef on_chat_message(msg):\r\n    content_type, chat_type, chat_id = telepot.glance(msg)\r\n    print('Normal Message:', content_type, chat_type, chat_id)\r\n\r\ndef on_inline_query(msg):\r\n    query_id, from_id, query_string = telepot.glance(msg, flavor='inline_query')\r\n    print('Inline Query:', query_id, from_id, query_string)\r\n\r\n    def compute_answer():\r\n        articles = [{'type': 'article',\r\n                        'id': 'abc', 'title': query_string, 'message_text': query_string}]\r\n\r\n        return articles\r\n\r\n    answerer.answer(msg, compute_answer)\r\n\r\ndef on_chosen_inline_result(msg):\r\n    result_id, from_id, query_string = telepot.glance(msg, flavor='chosen_inline_result')\r\n    print('Chosen Inline Result:', result_id, from_id, query_string)\r\n\r\n\r\nTOKEN = sys.argv[1]  # get token from command-line\r\n\r\nbot = telepot.async.Bot(TOKEN)\r\nanswerer = telepot.async.helper.Answerer(bot)\r\n\r\nloop = asyncio.get_event_loop()\r\nloop.create_task(bot.messageLoop({'normal': on_chat_message,\r\n                                  'inline_query': on_inline_query,\r\n                                  'chosen_inline_result': on_chosen_inline_result}))\r\nprint('Listening ...')\r\n\r\nloop.run_forever()\r\n```"},"comment":{"url":"https://api.github.com/repos/nickoala/telepot/issues/comments/205178354","html_url":"https://github.com/nickoala/telepot/issues/46#issuecomment-205178354","issue_url":"https://api.github.com/repos/nickoala/telepot/issues/46","id":205178354,"user":{"login":"nickoala","id":13035417,"avatar_url":"https://avatars.githubusercontent.com/u/13035417?v=3","gravatar_id":"","url":"https://api.github.com/users/nickoala","html_url":"https://github.com/nickoala","followers_url":"https://api.github.com/users/nickoala/followers","following_url":"https://api.github.com/users/nickoala/following{/other_user}","gists_url":"https://api.github.com/users/nickoala/gists{/gist_id}","starred_url":"https://api.github.com/users/nickoala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickoala/subscriptions","organizations_url":"https://api.github.com/users/nickoala/orgs","repos_url":"https://api.github.com/users/nickoala/repos","events_url":"https://api.github.com/users/nickoala/events{/privacy}","received_events_url":"https://api.github.com/users/nickoala/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T07:48:40Z","updated_at":"2016-04-04T07:48:40Z","body":"Can you modify the code to print out the actual messages? That way, we can be more sure that it is doubly-received."}}