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

files_upload_v2 `initial_comment` doesn't accept markdown

Open Plbltn opened this issue 4 years ago • 8 comments

    Hi!

We switched to files_upload_v2, the problem with timeots is gone, but looks like something broken with slack markdown in initial_comment. Link tags not working anymore - formatting example from docs sends to chat as text <http://www.example.com|This message is a link> (bold, italic and others works well)

Tried on files_upload again and link tag works

Originally posted by @Plebolution in https://github.com/slackapi/python-slack-sdk/issues/1165#issuecomment-1284318055

Plbltn avatar Oct 28 '22 10:10 Plbltn

I had the same issue when i switched to files_upload_v2!!

LukeDataWalker avatar Oct 28 '22 14:10 LukeDataWalker

Hello! I tried different workarounds but couldn't make links work with files_upload_v2

emilianomoscato avatar Oct 28 '22 16:10 emilianomoscato

👋 Thanks for reporting this! I've escalated this to the server-side teams responsible and will get back with notice of a fix or workaround respectively.

srajiang avatar Oct 28 '22 22:10 srajiang

I've put this on the server-teams' radar, but don't have news yet to share on whether they will support mrkdown formatting for the initial_comment in the V2 files upload.

Here's a workaround for this for now that still uses the files_upload_v2 method:

  • Use client.chat.postMessage to post the message / comment, note the timestamp
  • Use files_upload_v2 and supply the thread timestamp in the method to attach the files.

srajiang avatar Nov 02 '22 17:11 srajiang

@srajiang that will add the uploaded file in a thread, how can I keep the uploaded file within the initial message?

tekumara avatar Dec 11 '22 06:12 tekumara

This ending up working for me https://github.com/slackapi/python-slack-sdk/issues/1194#issuecomment-1076962918

tekumara avatar Dec 11 '22 09:12 tekumara

Cross-posting workaround https://github.com/slackapi/node-slack-sdk/issues/1561#issuecomment-1722323302, which combines files.upload with chat.update. It's not ideal (requires two API calls), but at least it achieves the desired end state.

mxxk avatar Sep 16 '23 21:09 mxxk

Hi! Thank you very much for your patience regarding this issue. The server-side has recently been enhanced, so now the API accepts mrkdwn format for the initial_comment parameter! Let me close this issue now 🙇

seratch avatar Oct 05 '23 07:10 seratch