{"action":"opened","issue":{"url":"https://api.github.com/repos/smallwins/slack/issues/67","repository_url":"https://api.github.com/repos/smallwins/slack","labels_url":"https://api.github.com/repos/smallwins/slack/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/smallwins/slack/issues/67/comments","events_url":"https://api.github.com/repos/smallwins/slack/issues/67/events","html_url":"https://github.com/smallwins/slack/issues/67","id":215894787,"number":67,"title":"Missing Scope","user":{"login":"tloriato","id":11580564,"avatar_url":"https://avatars2.githubusercontent.com/u/11580564?v=3","gravatar_id":"","url":"https://api.github.com/users/tloriato","html_url":"https://github.com/tloriato","followers_url":"https://api.github.com/users/tloriato/followers","following_url":"https://api.github.com/users/tloriato/following{/other_user}","gists_url":"https://api.github.com/users/tloriato/gists{/gist_id}","starred_url":"https://api.github.com/users/tloriato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tloriato/subscriptions","organizations_url":"https://api.github.com/users/tloriato/orgs","repos_url":"https://api.github.com/users/tloriato/repos","events_url":"https://api.github.com/users/tloriato/events{/privacy}","received_events_url":"https://api.github.com/users/tloriato/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-21T22:13:56Z","updated_at":"2017-03-21T22:13:56Z","closed_at":null,"body":"Hello! Wanted to first say thank you about the lib and then head to the question!\r\n\r\nI had created a bot for my team using these tools and they were working great! However, now I have to do a **search** on the channel and I'm stuck.\r\n\r\n- **Missing Scope** is my _currently_ error\r\n![image](https://cloud.githubusercontent.com/assets/11580564/24173121/9c01c956-0e69-11e7-8904-6a1f0670b7e7.png)\r\n\r\n- - -\r\nAfter reading a lot online here's what I did:\r\n\r\n- I was using it as a custom integration, so I created an official Slack App now.\r\n- I updated the token that I'm using.\r\n\r\n- - -\r\nHow's the code?\r\n\r\n- My **\"header\"**:\r\n\r\n```\r\n// Nightmare Stuff\r\nvar Nightmare = require(\"nightmare\");\r\n\r\nvar night = false;\r\nvar nightmare = null;\r\n\r\nconst realMouse = require('nightmare-real-mouse');\r\nrealMouse(Nightmare);\r\n\r\n// Misc.\r\nvar request = require(\"request\");\r\nvar fileSystem = require(\"fs\");\r\n\r\n//Slack Stuff\r\nvar slack = require(\"slack\");\r\nvar env = require(\"node-env-file\");\r\nvar path = require(\"path\");\r\nvar bot = slack.rtm.client();\r\n\r\n// Load Environment Variables\r\nenv(path.join(__dirname, \".env\"));\r\n\r\n\r\n// Anti-Captcha\r\nvar anticaptcha = require('./anticaptcha')(process.env.ANTI_TOKEN);\r\n\r\n// Grab the auth token\r\nvar token = process.env.SLACK_BOT_TOKEN;\r\n```\r\n\r\n- I **connect** using this:\r\n```\r\nvar token = process.env.SLACK_BOT_TOKEN;\r\n\r\nbot.listen({\r\n  token\r\n});\r\n```\r\nThat was taken from **OAuth & Permissions** page from **App**\r\n\r\n- After \"listening\" and validating what I want, **I'm calling search this way**:\r\n`slack.search.messages({token, query: name}, (err, data) => {console.log(err)});`\r\n\r\n- - -\r\nCould you help me? I realize it's a broad issue, but I tried to provide all the relevant info's.\r\n\r\nThank you so much!"}}
{"actor":{"display_login":"tloriato"}}