{"action":"opened","issue":{"url":"https://api.github.com/repos/Schmavery/facebook-chat-api/issues/110","labels_url":"https://api.github.com/repos/Schmavery/facebook-chat-api/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/Schmavery/facebook-chat-api/issues/110/comments","events_url":"https://api.github.com/repos/Schmavery/facebook-chat-api/issues/110/events","html_url":"https://github.com/Schmavery/facebook-chat-api/issues/110","id":120625713,"number":110,"title":"Cannot read property 'toString' of undefined","user":{"login":"lasseborly","id":2671660,"avatar_url":"https://avatars.githubusercontent.com/u/2671660?v=3","gravatar_id":"","url":"https://api.github.com/users/lasseborly","html_url":"https://github.com/lasseborly","followers_url":"https://api.github.com/users/lasseborly/followers","following_url":"https://api.github.com/users/lasseborly/following{/other_user}","gists_url":"https://api.github.com/users/lasseborly/gists{/gist_id}","starred_url":"https://api.github.com/users/lasseborly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasseborly/subscriptions","organizations_url":"https://api.github.com/users/lasseborly/orgs","repos_url":"https://api.github.com/users/lasseborly/repos","events_url":"https://api.github.com/users/lasseborly/events{/privacy}","received_events_url":"https://api.github.com/users/lasseborly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-06T10:50:33Z","updated_at":"2015-12-06T10:50:33Z","closed_at":null,"body":"```\r\nERR! ERROR in listen -->  TypeError: Cannot read property 'toString' of undefined\r\nERR! ERROR in listen -->      at Object.formatTyp (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/utils.js:294:23)\r\nERR! ERROR in listen -->      at parsePackets (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/src/listen.js:97:42)\r\nERR! ERROR in listen -->      at Array.forEach (native)\r\nERR! ERROR in listen -->      at /home/pc/Desktop/fbbot/node_modules/facebook-chat-api/src/listen.js:86:12\r\nERR! ERROR in listen -->      at tryCatcher (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/util.js:26:23)\r\nERR! ERROR in listen -->      at Promise._settlePromiseFromHandler (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:507:31)\r\nERR! ERROR in listen -->      at Promise._settlePromiseAt (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:581:18)\r\nERR! ERROR in listen -->      at Promise._settlePromises (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/promise.js:697:14)\r\nERR! ERROR in listen -->      at Async._drainQueue (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:123:16)\r\nERR! ERROR in listen -->      at Async._drainQueues (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:133:10)\r\nERR! ERROR in listen -->      at Immediate.Async.drainQueues [as _onImmediate] (/home/pc/Desktop/fbbot/node_modules/facebook-chat-api/node_modules/bluebird/js/main/async.js:15:14)\r\nERR! ERROR in listen -->      at processImmediate [as _immediateCallback] (timers.js:383:17)\r\n```\r\n\r\n\r\nI'm getting this error by doing something rather trivial. Is it me being totally off point or what is happening here?\r\n\r\n```javascript\r\nvar login = require(\"facebook-chat-api\");\r\n\r\nvar person02ID = 00000000;\r\nvar person01ID = 00000000;\r\n\r\nvar testreg = /(test)/ig;\r\n\r\nlogin({email: \"FB_EMAIL\", password: \"FB_PASS\"}, function callback (err, api) {\r\n    if(err) return console.error(err);\r\n\r\n    api.setOptions({\r\n        listenEvents: true,\r\n        selfListen: true\r\n    });\r\n\r\n\r\n    var stopListening = api.listen(function(err, event) {\r\n        if(err) return console.error(err);\r\n\r\n        if (typeof event !== \"undefined\") {\r\n\r\n            switch(event.type) {\r\n                case \"message\":\r\n\r\n                    //Stop\r\n                    if(event.body === '/stop') {\r\n                        api.sendMessage(\"Goodbye...\", event.threadID);\r\n                        return stopListening();\r\n                    }\r\n\r\n                    //Thea\r\n                    if (event.senderID == person01ID) {\r\n                        if (testreg.test(event.body)) {\r\n                            api.sendMessage('Hi...', event.threadID);\r\n                        }\r\n                    }\r\n\r\n                    //Robert\r\n                    if (event.senderID == person02ID) {\r\n                        if (testreg.test(event.body)) {\r\n                            api.message('Hey u...', event.threadID);\r\n                        }\r\n                    }\r\n\r\n\r\n                    break;\r\n\r\n                case \"event\":\r\n                    console.log(event);\r\n                    break;\r\n            }\r\n\r\n        }\r\n\r\n\r\n    });\r\n});\r\n\r\n```\r\n\r\nI'm sorry if this issue is same as [this](https://github.com/Schmavery/facebook-chat-api/issues/89) but a solution was not to be found from that issue. "}}