{"action":"created","issue":{"url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/165","labels_url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/165/comments","events_url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/165/events","html_url":"https://github.com/kesne/jeopardy-bot/pull/165","id":126985580,"number":165,"title":"Integrate Hipchat - W.I.P.","user":{"login":"pstephenson02","id":6306934,"avatar_url":"https://avatars.githubusercontent.com/u/6306934?v=3","gravatar_id":"","url":"https://api.github.com/users/pstephenson02","html_url":"https://github.com/pstephenson02","followers_url":"https://api.github.com/users/pstephenson02/followers","following_url":"https://api.github.com/users/pstephenson02/following{/other_user}","gists_url":"https://api.github.com/users/pstephenson02/gists{/gist_id}","starred_url":"https://api.github.com/users/pstephenson02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pstephenson02/subscriptions","organizations_url":"https://api.github.com/users/pstephenson02/orgs","repos_url":"https://api.github.com/users/pstephenson02/repos","events_url":"https://api.github.com/users/pstephenson02/events{/privacy}","received_events_url":"https://api.github.com/users/pstephenson02/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-16T00:22:43Z","updated_at":"2016-01-19T01:04:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kesne/jeopardy-bot/pulls/165","html_url":"https://github.com/kesne/jeopardy-bot/pull/165","diff_url":"https://github.com/kesne/jeopardy-bot/pull/165.diff","patch_url":"https://github.com/kesne/jeopardy-bot/pull/165.patch"},"body":"Still a few issues to sort out:\r\n\r\n1. Occasionally, the app fails to create a game and throws this stack trace:\r\n\r\n```\r\nerror: Unable to generate game. undefined TypeError: Cannot read property '1' of null\r\n    at Object.<anonymous> (/var/www/html/jeopardy-bot/src/japi.js:51:22)\r\n    at [object Object].exports.each (/var/www/html/jeopardy-bot/node_modules/cheerio/lib/api/traversing.js:293:24)\r\n    at loadEpisode$ (/var/www/html/jeopardy-bot/src/japi.js:44:30)\r\n    at tryCatch (/var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:72:40)\r\n    at GeneratorFunctionPrototype.invoke [as _invoke] (/var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:334:22)\r\n    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:105:21)\r\n    at tryCatch (/var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:72:40)\r\n    at invoke (/var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:146:20)\r\n    at /var/www/html/jeopardy-bot/node_modules/babel-runtime/regenerator/runtime.js:154:13\r\n    at run (/var/www/html/jeopardy-bot/node_modules/babel/node_modules/babel-core/node_modules/core-js/modules/es6.promise.js:104:47)\r\n    at /var/www/html/jeopardy-bot/node_modules/babel/node_modules/babel-core/node_modules/core-js/modules/es6.promise.js:115:28\r\n    at flush (/var/www/html/jeopardy-bot/node_modules/babel/node_modules/babel-core/node_modules/core-js/modules/$.microtask.js:19:5)\r\n    at doNTCallback0 (node.js:419:9)\r\n    at process._tickDomainCallback (node.js:389:13)\r\n```\r\n\r\nI haven't dug into it too much yet, but must be related to generating the game from jarchive.\r\n\r\n2. The bot does not respect when a player \"owns\" the game board, for example if I answer a question correctly. Despite saying I own the board for 4 seconds, any player can chime in and select a catagory. Need to investigate here.\r\n\r\n3. Would like to change the way the @ mentions are formatted. As you mentioned, slack uses `<@user_id>`. Hipchat just uses @user_name. I started to work on this, but after a correct answer the mention is populated from Game.lastContestant, which is just the user_id string. It would be great if Game.Schema.lastContestant pointed to Contestant.slackid, so that in newclue.js I can just do something like `@game.lastContestant.name` without having to use mongoose to go get that Contestant first. I'm a bit unclear though how schema changes are handled with mongo(ose). I assume we'd need to write a migration? This is less important but just nitpicky: Contestant.slackid should probably just be Contestant.id or _id\r\n\r\n4. More nice to haves: \r\nSelect Hipchat or Slack from admin panel.\r\nEnter hipchat webhook callback url in admin panel\r\nUse Hipchat's API [\"installation flow\"](https://developer.atlassian.com/hipchat/guide/installation-flow) (this would provide more features to the bot I think)\r\nProvide an interface to Command.say such that I can use different color notifications for right and wrong answers to clues.\r\nCreate a webhook for room joins\r\n\r\n5. Finally, need to figure out how to properly format the help:\r\n![selection_106](https://cloud.githubusercontent.com/assets/6306934/12368841/6b5af0e8-bba4-11e5-95b0-6d9d053a69cc.png)\r\n"},"comment":{"url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/comments/172695968","html_url":"https://github.com/kesne/jeopardy-bot/pull/165#issuecomment-172695968","issue_url":"https://api.github.com/repos/kesne/jeopardy-bot/issues/165","id":172695968,"user":{"login":"kesne","id":498479,"avatar_url":"https://avatars.githubusercontent.com/u/498479?v=3","gravatar_id":"","url":"https://api.github.com/users/kesne","html_url":"https://github.com/kesne","followers_url":"https://api.github.com/users/kesne/followers","following_url":"https://api.github.com/users/kesne/following{/other_user}","gists_url":"https://api.github.com/users/kesne/gists{/gist_id}","starred_url":"https://api.github.com/users/kesne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kesne/subscriptions","organizations_url":"https://api.github.com/users/kesne/orgs","repos_url":"https://api.github.com/users/kesne/repos","events_url":"https://api.github.com/users/kesne/events{/privacy}","received_events_url":"https://api.github.com/users/kesne/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T01:04:22Z","updated_at":"2016-01-19T01:04:22Z","body":"Hmm. I should probably look into that. I'll try to mess with it on a fresh ubuntu box later today."}}