{"action":"created","issue":{"url":"https://api.github.com/repos/howdyai/botkit/issues/172","repository_url":"https://api.github.com/repos/howdyai/botkit","labels_url":"https://api.github.com/repos/howdyai/botkit/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/howdyai/botkit/issues/172/comments","events_url":"https://api.github.com/repos/howdyai/botkit/issues/172/events","html_url":"https://github.com/howdyai/botkit/issues/172","id":145464757,"number":172,"title":"Crash on DM message with only attachment","user":{"login":"SomeoneWeird","id":665754,"avatar_url":"https://avatars.githubusercontent.com/u/665754?v=3","gravatar_id":"","url":"https://api.github.com/users/SomeoneWeird","html_url":"https://github.com/SomeoneWeird","followers_url":"https://api.github.com/users/SomeoneWeird/followers","following_url":"https://api.github.com/users/SomeoneWeird/following{/other_user}","gists_url":"https://api.github.com/users/SomeoneWeird/gists{/gist_id}","starred_url":"https://api.github.com/users/SomeoneWeird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SomeoneWeird/subscriptions","organizations_url":"https://api.github.com/users/SomeoneWeird/orgs","repos_url":"https://api.github.com/users/SomeoneWeird/repos","events_url":"https://api.github.com/users/SomeoneWeird/events{/privacy}","received_events_url":"https://api.github.com/users/SomeoneWeird/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-03T07:35:25Z","updated_at":"2016-05-23T21:16:28Z","closed_at":"2016-05-23T21:16:28Z","body":"Code tries to use `message.text` when only `message.attachments` exists\r\n\r\n```\r\n/Users/adam/code/project/node_modules/botkit/lib/CoreBot.js:421\r\n                                        message.text[Math.floor(Math.random() * message.text.length)]\r\n                                                                                            ^\r\n\r\nTypeError: Cannot read property 'length' of undefined\r\n    at Conversation.tick (/Users/adam/code/project/node_modules/botkit/lib/CoreBot.js:421:93)\r\n    at Task.tick (/Users/adam/code/project/node_modules/botkit/lib/CoreBot.js:609:36)\r\n    at Object.Botkit.botkit.tick (/Users/adam/code/project/node_modules/botkit/lib/CoreBot.js:840:29)\r\n    at Timeout._repeat (/Users/adam/code/project/node_modules/botkit/lib/CoreBot.js:790:24)\r\n    at Timeout.wrapper [as _onTimeout] (timers.js:408:11)\r\n    at tryOnTimeout (timers.js:224:11)\r\n    at Timer.listOnTimeout (timers.js:198:5)\r\n```\r\n\r\nWorks:\r\n```js\r\nbot.reply(message, {\r\n  attachments: [ {\r\n    title: \"blah\",\r\n    text: \"foo\"\r\n  } ]\r\n})\r\n```\r\n\r\nDoesn't work:\r\n\r\n```js\r\nbot.startPrivateConversation(message, function (err, dm) {\r\n  dm.say({\r\n    attachments: [ {\r\n      title: \"blah\",\r\n      text: \"foo\"\r\n    } ]\r\n  })\r\n})\r\n```\r\n\r\nThe above works if i also pass `text: 'foo'` in the parent `dm.say` object."},"comment":{"url":"https://api.github.com/repos/howdyai/botkit/issues/comments/221098755","html_url":"https://github.com/howdyai/botkit/issues/172#issuecomment-221098755","issue_url":"https://api.github.com/repos/howdyai/botkit/issues/172","id":221098755,"user":{"login":"benbrown","id":729873,"avatar_url":"https://avatars.githubusercontent.com/u/729873?v=3","gravatar_id":"","url":"https://api.github.com/users/benbrown","html_url":"https://github.com/benbrown","followers_url":"https://api.github.com/users/benbrown/followers","following_url":"https://api.github.com/users/benbrown/following{/other_user}","gists_url":"https://api.github.com/users/benbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/benbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbrown/subscriptions","organizations_url":"https://api.github.com/users/benbrown/orgs","repos_url":"https://api.github.com/users/benbrown/repos","events_url":"https://api.github.com/users/benbrown/events{/privacy}","received_events_url":"https://api.github.com/users/benbrown/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T21:16:28Z","updated_at":"2016-05-23T21:16:28Z","body":"This has been fixed. Thank you!"}}
{"actor":{"display_login":"benbrown"}}