{"action":"created","issue":{"url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62","repository_url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc","labels_url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62/comments","events_url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62/events","html_url":"https://github.com/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62","id":172970923,"number":62,"title":"Removing bot name from string for processing needs to be centralized in utils","user":{"login":"CiaranHannigan","id":13645183,"avatar_url":"https://avatars.githubusercontent.com/u/13645183?v=3","gravatar_id":"","url":"https://api.github.com/users/CiaranHannigan","html_url":"https://github.com/CiaranHannigan","followers_url":"https://api.github.com/users/CiaranHannigan/followers","following_url":"https://api.github.com/users/CiaranHannigan/following{/other_user}","gists_url":"https://api.github.com/users/CiaranHannigan/gists{/gist_id}","starred_url":"https://api.github.com/users/CiaranHannigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiaranHannigan/subscriptions","organizations_url":"https://api.github.com/users/CiaranHannigan/orgs","repos_url":"https://api.github.com/users/CiaranHannigan/repos","events_url":"https://api.github.com/users/CiaranHannigan/events{/privacy}","received_events_url":"https://api.github.com/users/CiaranHannigan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"CiaranHannigan","id":13645183,"avatar_url":"https://avatars.githubusercontent.com/u/13645183?v=3","gravatar_id":"","url":"https://api.github.com/users/CiaranHannigan","html_url":"https://github.com/CiaranHannigan","followers_url":"https://api.github.com/users/CiaranHannigan/followers","following_url":"https://api.github.com/users/CiaranHannigan/following{/other_user}","gists_url":"https://api.github.com/users/CiaranHannigan/gists{/gist_id}","starred_url":"https://api.github.com/users/CiaranHannigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiaranHannigan/subscriptions","organizations_url":"https://api.github.com/users/CiaranHannigan/orgs","repos_url":"https://api.github.com/users/CiaranHannigan/repos","events_url":"https://api.github.com/users/CiaranHannigan/events{/privacy}","received_events_url":"https://api.github.com/users/CiaranHannigan/received_events","type":"User","site_admin":false},"assignees":[{"login":"CiaranHannigan","id":13645183,"avatar_url":"https://avatars.githubusercontent.com/u/13645183?v=3","gravatar_id":"","url":"https://api.github.com/users/CiaranHannigan","html_url":"https://github.com/CiaranHannigan","followers_url":"https://api.github.com/users/CiaranHannigan/followers","following_url":"https://api.github.com/users/CiaranHannigan/following{/other_user}","gists_url":"https://api.github.com/users/CiaranHannigan/gists{/gist_id}","starred_url":"https://api.github.com/users/CiaranHannigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiaranHannigan/subscriptions","organizations_url":"https://api.github.com/users/CiaranHannigan/orgs","repos_url":"https://api.github.com/users/CiaranHannigan/repos","events_url":"https://api.github.com/users/CiaranHannigan/events{/privacy}","received_events_url":"https://api.github.com/users/CiaranHannigan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-08-24T14:43:14Z","updated_at":"2016-08-29T18:22:55Z","closed_at":null,"body":"Removing the bots name from strings is done several different ways in multiple places in the repo.\r\n\r\nnlc.confidence.high\r\n```\r\n// Obtain statement from res removing the bot name\r\nvar text = res.message.text.replace(robot.name, '').trim();\r\n```\r\n\r\nnlc.receive.js\r\n```\r\n// Remove the bot name from the bot statement\r\nif (text.indexOf(botName) >= 0){\r\n\tlet botnameIndex = text.indexOf(botName);\r\n\ttext = text.substring(botnameIndex + botName.length);\r\n}\r\n```\r\n\r\nnlc.catchall.js\r\n```\r\nfunction stripBotName(text) {\r\n\tvar nameToken = new RegExp('(^|\\\\s)@?' + botName + ':?\\\\s', 'g');\r\n\treturn text.replace(nameToken, ' ').trim();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/comments/243209513","html_url":"https://github.com/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62#issuecomment-243209513","issue_url":"https://api.github.com/repos/ibm-cloud-solutions/hubot-ibmcloud-nlc/issues/62","id":243209513,"user":{"login":"CiaranHannigan","id":13645183,"avatar_url":"https://avatars.githubusercontent.com/u/13645183?v=3","gravatar_id":"","url":"https://api.github.com/users/CiaranHannigan","html_url":"https://github.com/CiaranHannigan","followers_url":"https://api.github.com/users/CiaranHannigan/followers","following_url":"https://api.github.com/users/CiaranHannigan/following{/other_user}","gists_url":"https://api.github.com/users/CiaranHannigan/gists{/gist_id}","starred_url":"https://api.github.com/users/CiaranHannigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiaranHannigan/subscriptions","organizations_url":"https://api.github.com/users/CiaranHannigan/orgs","repos_url":"https://api.github.com/users/CiaranHannigan/repos","events_url":"https://api.github.com/users/CiaranHannigan/events{/privacy}","received_events_url":"https://api.github.com/users/CiaranHannigan/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T18:22:55Z","updated_at":"2016-08-29T18:22:55Z","body":"We should remove all instances of bot name from the string, here is the list of permutations I can think of in Slack.\r\n\r\n`botname`\r\n`@botname`\r\n`botname:`\r\n`@botname:`"}}
{"actor":{"display_login":"CiaranHannigan"}}