node-slack-sdk icon indicating copy to clipboard operation
node-slack-sdk copied to clipboard

Unable to connect Slack Bot code (im.open) behind the proxy

Open JanmejayPattanaik opened this issue 8 years ago • 1 comments

Hi Team,

I am building an APP using Node Slack SDK. I am able to authenticate the user by using auth.test URL. But while trying to use im.open or chat.postMessage the code is not working.

I am able to authenticate the user in both scenarios ( with proxy as well as without proxy )

In no proxy, i am able to print the response ( res ), but in proxy environment the this.web.im.open() block code is entirely getting skipped without throwing any error.

It will be helpful if you can help me in debugging the issue. How can i put a tracer to find the exact issue in the below code. const { WebClient } = require('@slack/client'); const proxyUrl = ${process.env.proxyUrl}:${process.env.proxyPort}; web: new WebClient(process.env.SLACK_BOT_TOKEN, { agent: new HttpsProxyAgent(proxyUrl) }),

introduceUser() { console.log("\n this.web.im.open :: ", this.web.im.open); console.log("\n this.user :: ", this.user); this.web.im.open(this.user) .then((res) => { console.log("inside the slack open method :: ", res); this.web.chat.postMessage(res.channel.id, Welcome to user! I'm here to help your)} ) .catch((err) => { console.log("error code ::: ", err); });

console.log("\n method bypassed :: "); },

Slack package details :

"@slack/client": "^3.9.0", "@slack/events-api": "^1.0.1", "@slack/interactive-messages": "^0.1.1",

What type of issue is this? (place an x in one of the [ ])

  • [ ] bug
  • [x ] enhancement (feature request)
  • [x ] question
  • [ x] documentation related
  • [ ] testing related
  • [ x] discussion

Requirements (place an x in each of the [ ])

  • [ ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [ ] I've read and agree to the Code of Conduct.
  • [ ] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

@slack/client version:

node version:

OS version(s):

Steps to reproduce:

1. 2. 3.

Expected result:

What you expected to happen

Actual result:

What actually happened

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

JanmejayPattanaik avatar Oct 23 '18 16:10 JanmejayPattanaik

@JanmejayPattanaik sorry you’ve had trouble getting this to work. The v3.x versions of this package are no longer supported. Please upgrade your package to a supported version (preferably the latest). This guide should help you migrate existing code from v3.x to v4.x.

PS. I know it’s not easy to migrate code you’ve already written, but please take some time to read and understand the support schedule of our packages here: https://github.com/slackapi/node-slack-sdk/wiki/Support-Schedule. If you have any questions about the schedule or migration, feel free to open another issue.

aoberoi avatar Oct 30 '18 16:10 aoberoi