{"action":"created","comment":{"url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/comments/77142143","id":77142143,"diff_hunk":"@@ -234,25 +242,31 @@ class BotController {\n     fun dropItem(\n             @PathVariable name: String,\n             @PathVariable id: Int,\n-            @PathVariable quantity: Int\n+            @PathVariable quantity: Int,\n+            httpResponse: HttpServletResponse\n     ): String {\n-\n         val itemBag: ItemBag = service.getBotContext(name).api.inventories.itemBag\n         val item: Item? = itemBag.items.find { it.itemId.number == id }\n \n         if (quantity > item!!.count) {\n-            return \"Not enough items to drop \" + item.count\n+            httpResponse.status = HttpServletResponse.SC_BAD_REQUEST\n+            return \"Not enough items to drop ${item.count}\"\n         } else {\n-            Log.magenta(\"REST API : dropping \" + quantity + \" \" + item.itemId.name)\n+            Log.magenta(\"REST API: Dropping ${quantity} ${item.itemId.name}\")\n             return itemBag.removeItem(item.itemId, quantity).toString()\n         }\n     }\n \n     @RequestMapping(value = \"/bot/{name}/useIncense\", method = arrayOf(RequestMethod.POST))\n-    fun useIncense(@PathVariable name: String): String {\n+    fun useIncense(\n+            @PathVariable name: String,\n+            httpResponse: HttpServletResponse\n+    ): String {\n         val itemBag = service.getBotContext(name).api.inventories.itemBag\n         val count = itemBag.items.find { it.itemId == ItemIdOuterClass.ItemId.ITEM_INCENSE_ORDINARY }?.count\n+\n         if (count == 0) {\n+            httpResponse.status = HttpServletResponse.SC_BAD_REQUEST\n             return \"Not enough incense\"\n         } else {\n             itemBag.useIncense()","path":"src/main/kotlin/ink/abb/pogo/scraper/controllers/BotController.kt","position":186,"original_position":186,"commit_id":"d8a575494ec2286754bf6f2e1d0d6ad12d8e5606","original_commit_id":"d8a575494ec2286754bf6f2e1d0d6ad12d8e5606","user":{"login":"FrancYescO","id":4574593,"avatar_url":"https://avatars.githubusercontent.com/u/4574593?v=3","gravatar_id":"","url":"https://api.github.com/users/FrancYescO","html_url":"https://github.com/FrancYescO","followers_url":"https://api.github.com/users/FrancYescO/followers","following_url":"https://api.github.com/users/FrancYescO/following{/other_user}","gists_url":"https://api.github.com/users/FrancYescO/gists{/gist_id}","starred_url":"https://api.github.com/users/FrancYescO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrancYescO/subscriptions","organizations_url":"https://api.github.com/users/FrancYescO/orgs","repos_url":"https://api.github.com/users/FrancYescO/repos","events_url":"https://api.github.com/users/FrancYescO/events{/privacy}","received_events_url":"https://api.github.com/users/FrancYescO/received_events","type":"User","site_admin":false},"body":"log if usage successfull? maybe also for luckyegg and location change request","created_at":"2016-09-01T09:31:15Z","updated_at":"2016-09-01T09:31:15Z","html_url":"https://github.com/jabbink/PokemonGoBot/pull/1264#discussion_r77142143","pull_request_url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264","_links":{"self":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/comments/77142143"},"html":{"href":"https://github.com/jabbink/PokemonGoBot/pull/1264#discussion_r77142143"},"pull_request":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264"}}},"pull_request":{"url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264","id":83540206,"html_url":"https://github.com/jabbink/PokemonGoBot/pull/1264","diff_url":"https://github.com/jabbink/PokemonGoBot/pull/1264.diff","patch_url":"https://github.com/jabbink/PokemonGoBot/pull/1264.patch","issue_url":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/1264","number":1264,"state":"open","locked":false,"title":"[REST API] Added HTTP status codes for bad auth/requests","user":{"login":"Sieberkev","id":3216851,"avatar_url":"https://avatars.githubusercontent.com/u/3216851?v=3","gravatar_id":"","url":"https://api.github.com/users/Sieberkev","html_url":"https://github.com/Sieberkev","followers_url":"https://api.github.com/users/Sieberkev/followers","following_url":"https://api.github.com/users/Sieberkev/following{/other_user}","gists_url":"https://api.github.com/users/Sieberkev/gists{/gist_id}","starred_url":"https://api.github.com/users/Sieberkev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sieberkev/subscriptions","organizations_url":"https://api.github.com/users/Sieberkev/orgs","repos_url":"https://api.github.com/users/Sieberkev/repos","events_url":"https://api.github.com/users/Sieberkev/events{/privacy}","received_events_url":"https://api.github.com/users/Sieberkev/received_events","type":"User","site_admin":false},"body":"**Fixed issue:** https://github.com/jabbink/PokemonGoBot/issues/1139#issuecomment-241186713\r\n\r\n**Changes made:**\r\n\r\n* Added status codes on [bad requests 400](http://stackoverflow.com/questions/3290182/rest-http-status-codes-for-failed-validation-or-invalid-duplicate) (`the server cannot or will not process the request due to something that is perceived to be a client error`)/ auth 401\r\n* Updated API.md file","created_at":"2016-08-31T22:22:01Z","updated_at":"2016-09-01T09:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6afb6ed2d8557bfd3dc4ace2163d11574bb9b164","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264/commits","review_comments_url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264/comments","review_comment_url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/1264/comments","statuses_url":"https://api.github.com/repos/jabbink/PokemonGoBot/statuses/d8a575494ec2286754bf6f2e1d0d6ad12d8e5606","head":{"label":"Sieberkev:rest_api_status_codes","ref":"rest_api_status_codes","sha":"d8a575494ec2286754bf6f2e1d0d6ad12d8e5606","user":{"login":"Sieberkev","id":3216851,"avatar_url":"https://avatars.githubusercontent.com/u/3216851?v=3","gravatar_id":"","url":"https://api.github.com/users/Sieberkev","html_url":"https://github.com/Sieberkev","followers_url":"https://api.github.com/users/Sieberkev/followers","following_url":"https://api.github.com/users/Sieberkev/following{/other_user}","gists_url":"https://api.github.com/users/Sieberkev/gists{/gist_id}","starred_url":"https://api.github.com/users/Sieberkev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sieberkev/subscriptions","organizations_url":"https://api.github.com/users/Sieberkev/orgs","repos_url":"https://api.github.com/users/Sieberkev/repos","events_url":"https://api.github.com/users/Sieberkev/events{/privacy}","received_events_url":"https://api.github.com/users/Sieberkev/received_events","type":"User","site_admin":false},"repo":{"id":66304970,"name":"PokemonGoBot","full_name":"Sieberkev/PokemonGoBot","owner":{"login":"Sieberkev","id":3216851,"avatar_url":"https://avatars.githubusercontent.com/u/3216851?v=3","gravatar_id":"","url":"https://api.github.com/users/Sieberkev","html_url":"https://github.com/Sieberkev","followers_url":"https://api.github.com/users/Sieberkev/followers","following_url":"https://api.github.com/users/Sieberkev/following{/other_user}","gists_url":"https://api.github.com/users/Sieberkev/gists{/gist_id}","starred_url":"https://api.github.com/users/Sieberkev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sieberkev/subscriptions","organizations_url":"https://api.github.com/users/Sieberkev/orgs","repos_url":"https://api.github.com/users/Sieberkev/repos","events_url":"https://api.github.com/users/Sieberkev/events{/privacy}","received_events_url":"https://api.github.com/users/Sieberkev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sieberkev/PokemonGoBot","description":"Bot that plays Pokemon Go","fork":true,"url":"https://api.github.com/repos/Sieberkev/PokemonGoBot","forks_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/forks","keys_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/teams","hooks_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/hooks","issue_events_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/issues/events{/number}","events_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/events","assignees_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/assignees{/user}","branches_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/branches{/branch}","tags_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/tags","blobs_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/statuses/{sha}","languages_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/languages","stargazers_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/stargazers","contributors_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/contributors","subscribers_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/subscribers","subscription_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/subscription","commits_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/contents/{+path}","compare_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/merges","archive_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/downloads","issues_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/issues{/number}","pulls_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/pulls{/number}","milestones_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/milestones{/number}","notifications_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/labels{/name}","releases_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/releases{/id}","deployments_url":"https://api.github.com/repos/Sieberkev/PokemonGoBot/deployments","created_at":"2016-08-22T20:18:35Z","updated_at":"2016-08-22T20:18:37Z","pushed_at":"2016-09-01T09:24:27Z","git_url":"git://github.com/Sieberkev/PokemonGoBot.git","ssh_url":"git@github.com:Sieberkev/PokemonGoBot.git","clone_url":"https://github.com/Sieberkev/PokemonGoBot.git","svn_url":"https://github.com/Sieberkev/PokemonGoBot","homepage":null,"size":5177,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"jabbink:develop","ref":"develop","sha":"5d8bb22b67f26b07a7f8778bd5359e43311d449a","user":{"login":"jabbink","id":2461972,"avatar_url":"https://avatars.githubusercontent.com/u/2461972?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbink","html_url":"https://github.com/jabbink","followers_url":"https://api.github.com/users/jabbink/followers","following_url":"https://api.github.com/users/jabbink/following{/other_user}","gists_url":"https://api.github.com/users/jabbink/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbink/subscriptions","organizations_url":"https://api.github.com/users/jabbink/orgs","repos_url":"https://api.github.com/users/jabbink/repos","events_url":"https://api.github.com/users/jabbink/events{/privacy}","received_events_url":"https://api.github.com/users/jabbink/received_events","type":"User","site_admin":false},"repo":{"id":63780762,"name":"PokemonGoBot","full_name":"jabbink/PokemonGoBot","owner":{"login":"jabbink","id":2461972,"avatar_url":"https://avatars.githubusercontent.com/u/2461972?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbink","html_url":"https://github.com/jabbink","followers_url":"https://api.github.com/users/jabbink/followers","following_url":"https://api.github.com/users/jabbink/following{/other_user}","gists_url":"https://api.github.com/users/jabbink/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbink/subscriptions","organizations_url":"https://api.github.com/users/jabbink/orgs","repos_url":"https://api.github.com/users/jabbink/repos","events_url":"https://api.github.com/users/jabbink/events{/privacy}","received_events_url":"https://api.github.com/users/jabbink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jabbink/PokemonGoBot","description":"Bot that plays Pokemon Go","fork":false,"url":"https://api.github.com/repos/jabbink/PokemonGoBot","forks_url":"https://api.github.com/repos/jabbink/PokemonGoBot/forks","keys_url":"https://api.github.com/repos/jabbink/PokemonGoBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jabbink/PokemonGoBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jabbink/PokemonGoBot/teams","hooks_url":"https://api.github.com/repos/jabbink/PokemonGoBot/hooks","issue_events_url":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/events{/number}","events_url":"https://api.github.com/repos/jabbink/PokemonGoBot/events","assignees_url":"https://api.github.com/repos/jabbink/PokemonGoBot/assignees{/user}","branches_url":"https://api.github.com/repos/jabbink/PokemonGoBot/branches{/branch}","tags_url":"https://api.github.com/repos/jabbink/PokemonGoBot/tags","blobs_url":"https://api.github.com/repos/jabbink/PokemonGoBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jabbink/PokemonGoBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jabbink/PokemonGoBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/jabbink/PokemonGoBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jabbink/PokemonGoBot/statuses/{sha}","languages_url":"https://api.github.com/repos/jabbink/PokemonGoBot/languages","stargazers_url":"https://api.github.com/repos/jabbink/PokemonGoBot/stargazers","contributors_url":"https://api.github.com/repos/jabbink/PokemonGoBot/contributors","subscribers_url":"https://api.github.com/repos/jabbink/PokemonGoBot/subscribers","subscription_url":"https://api.github.com/repos/jabbink/PokemonGoBot/subscription","commits_url":"https://api.github.com/repos/jabbink/PokemonGoBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/jabbink/PokemonGoBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/jabbink/PokemonGoBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/jabbink/PokemonGoBot/contents/{+path}","compare_url":"https://api.github.com/repos/jabbink/PokemonGoBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jabbink/PokemonGoBot/merges","archive_url":"https://api.github.com/repos/jabbink/PokemonGoBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jabbink/PokemonGoBot/downloads","issues_url":"https://api.github.com/repos/jabbink/PokemonGoBot/issues{/number}","pulls_url":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls{/number}","milestones_url":"https://api.github.com/repos/jabbink/PokemonGoBot/milestones{/number}","notifications_url":"https://api.github.com/repos/jabbink/PokemonGoBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jabbink/PokemonGoBot/labels{/name}","releases_url":"https://api.github.com/repos/jabbink/PokemonGoBot/releases{/id}","deployments_url":"https://api.github.com/repos/jabbink/PokemonGoBot/deployments","created_at":"2016-07-20T12:46:30Z","updated_at":"2016-08-31T10:01:32Z","pushed_at":"2016-09-01T09:24:27Z","git_url":"git://github.com/jabbink/PokemonGoBot.git","ssh_url":"git@github.com:jabbink/PokemonGoBot.git","clone_url":"https://github.com/jabbink/PokemonGoBot.git","svn_url":"https://github.com/jabbink/PokemonGoBot","homepage":"https://www.pogobot.club/","size":14108,"stargazers_count":628,"watchers_count":628,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":331,"mirror_url":null,"open_issues_count":106,"forks":331,"open_issues":106,"watchers":628,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264"},"html":{"href":"https://github.com/jabbink/PokemonGoBot/pull/1264"},"issue":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/1264"},"comments":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/issues/1264/comments"},"review_comments":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264/comments"},"review_comment":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/pulls/1264/commits"},"statuses":{"href":"https://api.github.com/repos/jabbink/PokemonGoBot/statuses/d8a575494ec2286754bf6f2e1d0d6ad12d8e5606"}}}}
{"actor":{"display_login":"FrancYescO"}}