slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.66k stars 1.13k forks source link

add endpoint to socketmode Clinet and OptionAPIURL function #1198

Closed ToshihitoKon closed 1 year ago

ToshihitoKon commented 1 year ago
Pull Request Guidelines

These are recommendations for pull requests. They are strictly guidelines to help manage expectations.

PR preparation

Run make pr-prep from the root of the repository to run formatting, linting and tests.

Should this be an issue instead
API changes

Since API changes have to be maintained they undergo a more detailed review and are more likely to require changes.

Examples of API changes that do not meet guidelines:

Change points

Motivation

I'm creating an application that acts as a server for a Slack App. To do that, we need to point the Endpoint accessed from slack-go/slack away from https://api.slack.com.

The slack client provided a way to change the Endpoint URL, while the socketmode client did not. I also found the URL hardcoded in the openAndDial function. This PR prepares the same OptionAPIURL for socketmode client as for slack client.

I would like opinions on whether this change should go into slack-go/slack.

ToshihitoKon commented 1 year ago

This change was unnecessary.

I figured out that the websocket URL is taken from the result of the apps.connections.open API request and the endpoint of the websocket module is irrelevant.