{"action":"created","issue":{"url":"https://api.github.com/repos/Chatie/wechaty/issues/1527","repository_url":"https://api.github.com/repos/Chatie/wechaty","labels_url":"https://api.github.com/repos/Chatie/wechaty/issues/1527/labels{/name}","comments_url":"https://api.github.com/repos/Chatie/wechaty/issues/1527/comments","events_url":"https://api.github.com/repos/Chatie/wechaty/issues/1527/events","html_url":"https://github.com/Chatie/wechaty/issues/1527","id":347779064,"node_id":"MDU6SXNzdWUzNDc3NzkwNjQ=","number":1527,"title":"Incorrect message type judgment with Wechaty-Puppet-Puppeteer","user":{"login":"JesseWeb","id":23567445,"node_id":"MDQ6VXNlcjIzNTY3NDQ1","avatar_url":"https://avatars0.githubusercontent.com/u/23567445?v=4","gravatar_id":"","url":"https://api.github.com/users/JesseWeb","html_url":"https://github.com/JesseWeb","followers_url":"https://api.github.com/users/JesseWeb/followers","following_url":"https://api.github.com/users/JesseWeb/following{/other_user}","gists_url":"https://api.github.com/users/JesseWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/JesseWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JesseWeb/subscriptions","organizations_url":"https://api.github.com/users/JesseWeb/orgs","repos_url":"https://api.github.com/users/JesseWeb/repos","events_url":"https://api.github.com/users/JesseWeb/events{/privacy}","received_events_url":"https://api.github.com/users/JesseWeb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-06T05:00:19Z","updated_at":"2018-08-07T02:56:46Z","closed_at":null,"author_association":"NONE","body":"**Where is the location of your server? (i.e. City, or In/Out China)**\r\nChina\r\n\r\n**Which cloud platform(AliYun/Qcloud/DigitalOcean/etc) are you using?**\r\nown machine\r\n\r\n**Run npm run doctor or wechaty run doctor(for docker user), paste output here**\r\nnpm run start\r\n\r\n**Library&Version**\r\n\"wechaty\": \"^0.18.3\",\r\n\"wechaty-puppet-puppeteer\": \"^0.8.8\"\r\n\r\n**Expected behavior**\r\n```\r\nbot.on('message', onMessage)\r\nasync function onMessage(msg) {\r\n  console.log(`RECV: ${msg}`)\r\n  console.log(`message_type:${msg.type()}`)\r\n  console.log(`text_message_type_code:${Message.Type.Text}`)\r\n  if (msg.type() !== Message.Type.Text) {\r\n    const file = await msg.toFileBox()\r\n    const name = file.name\r\n    console.log('Save file to: ' + name)\r\n    file.toFile(name)\r\n  }\r\n}\r\n```\r\nthen send a` .txt`file to bot\r\nit should judge message as attachment and save the file\r\n**Actual behavior**\r\n`console.log(message_type:${msg.type()}) `return 6 which means this message be judged as text type ,also don't save the file to local.\r\n\r\n**Expectations**\r\ncorrectly judge the message type and save `.txt .doc .docx .xls` types file\r\n\r\n**Full Output Logs**\r\n```\r\nmessage_type:6\r\ntext_message_type_code:6\r\n```"},"comment":{"url":"https://api.github.com/repos/Chatie/wechaty/issues/comments/410917045","html_url":"https://github.com/Chatie/wechaty/issues/1527#issuecomment-410917045","issue_url":"https://api.github.com/repos/Chatie/wechaty/issues/1527","id":410917045,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDkxNzA0NQ==","user":{"login":"zixia","id":1361891,"node_id":"MDQ6VXNlcjEzNjE4OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/1361891?v=4","gravatar_id":"","url":"https://api.github.com/users/zixia","html_url":"https://github.com/zixia","followers_url":"https://api.github.com/users/zixia/followers","following_url":"https://api.github.com/users/zixia/following{/other_user}","gists_url":"https://api.github.com/users/zixia/gists{/gist_id}","starred_url":"https://api.github.com/users/zixia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zixia/subscriptions","organizations_url":"https://api.github.com/users/zixia/orgs","repos_url":"https://api.github.com/users/zixia/repos","events_url":"https://api.github.com/users/zixia/events{/privacy}","received_events_url":"https://api.github.com/users/zixia/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T02:56:46Z","updated_at":"2018-08-07T02:56:46Z","author_association":"MEMBER","body":"This bug was introduced when we de-couple the Wechaty system: we split puppeteer puppet out with refactoring.\r\n\r\nThe `Attachment` type message was not deal right after then. I had fixed it in the latest v0.8.9, please try this version and let me the result.\r\n\r\nThank you very much for reporting this."}}
{"actor":{"display_login":"zixia"}}