slackapi / python-slack-sdk

Slack Developer Kit for Python
https://tools.slack.dev/python-slack-sdk/
MIT License
3.86k stars 835 forks source link

bug: improve the slack url overwriting experience #1541

Open WilliamBergamin opened 2 months ago

WilliamBergamin commented 2 months ago

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

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., setup.py))

  1. Try setting up an app to point to a different slack url that does not include a trailing /
  2. app = App(token=os.environ.get("SLACK_BOT_TOKEN"), client=WebClient(os.environ.get("SLACK_BOT_TOKEN"), "https://example.slack.com/api"))
  3. This will fail 🔴
  4. Add a trailing / app = App(token=os.environ.get("SLACK_BOT_TOKEN"), client=WebClient(os.environ.get("SLACK_BOT_TOKEN"), "https://example.slack.com/api/"))
  5. This will pass 🟢

Expected result:

app = App(token=os.environ.get("SLACK_BOT_TOKEN"), client=WebClient(os.environ.get("SLACK_BOT_TOKEN"), "https://example.slack.com/api"))

Should provide an informative error or format the slack URL to work

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

seratch commented 2 months ago

@WilliamBergamin This idea should be helpful in some situations, but it sounds like an improvement on the slack-sdk side. What do you think?

filmaj commented 2 months ago

I moved the issue over to python-slack-sdk