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

file_upload_v2 => username #1580

Open nick-youngblut opened 6 days ago

nick-youngblut commented 6 days ago

The differences between chat_postMessage and file_upload_v2 lead to a sometimes frustrating dev experience. For instance, chat_postMessage includes the username parameter, allowing the developer to customize the username.

The file_upload_v2 function has no such parameter, so the bot's name cannot be customized, resulting in Slack threads with messages from the same bot, but named differently (custom username or the default name).

It would be very helpful if one could specify the username when executing file_upload_v2, as can be done for chat_postMessage.

There is also the difference between chat_postMessage and file_upload_v2 in regards to how channels can be specified. chat_postMessage allows channel names, while file_upload_v2 requires channel IDs. If one tries to use a channel name with file_upload_v2, the returned error is "channel not found" instead of a more informative error, such as "channel not found; note: this endpoint requires a channel ID".

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

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.

mwbrooks commented 5 days ago

Hey @nick-youngblut 🙇🏻 This is fantastic feedback, thank you!

From my understanding, these improvements around consistencies are at the Slack API level. We could consider patching them at the SDK level, but it would be a workaround that should be solved on the API.

I've shared your feedback internally with the Slack Platform team and I'm looking to see whether we can take it a step further than just reporting the feedback. So, I'll leave this issue open for a bit in case others would like to chime in!