Comments (5)
Hi @belm0, we appreciate your time and effort in reporting this issue. We also apologize for any inconvenience caused by the changes in the platform's behavior.
Sometime between Oct 20 and Oct 25 2023, text supplied to initial_comment of files_upload() no longer gets formatted.
I tried to reproduce the same misbehavior on my end, but files.upload
API call works for me without any issues. If you're still experiencing the same, could you please share a minimum working example for us to reproduce the issue?
The following test code does not include an example for usergroup mention but other syntaxes are working well:
import os
import unittest
from integration_tests.env_variable_names import SLACK_SDK_TEST_BOT_TOKEN, SLACK_SDK_TEST_WEB_TEST_CHANNEL_ID
from slack_sdk.web import WebClient
class TestWebClient(unittest.TestCase):
"""Runs integration tests with real Slack API
https://github.com/slackapi/python-slack-sdk/issues/1429
"""
def setUp(self):
pass
def tearDown(self):
pass
def test_initial_comment(self):
token = os.environ[SLACK_SDK_TEST_BOT_TOKEN]
channel = os.environ[SLACK_SDK_TEST_WEB_TEST_CHANNEL_ID]
client: WebClient = WebClient(token=token)
current_dir = os.path.dirname(__file__)
file = f"{current_dir}/../../tests/data/slack_logo.png"
v1 = client.files_upload(
channels=[channel],
file=file,
filename="slack_logo.png",
initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
)
v2 = client.files_upload_v2(
channel=channel,
file=file,
filename="slack_logo.png",
initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
)
from python-slack-sdk.
I see-- markdown
should work OK for our case.
from python-slack-sdk.
Thank you. The problem appears related to using the content
option, and specifically with filetype='post'
.
If I use content
and filetype='markdown'
then initial_comment
is formatted as expected.
If I use content
and filetype='post'
then initial_comment
is not formatted. (The file content itself is, however.)
v1 = client.files_upload(
channels=[channel],
filename="file.md",
content="content goes _here_",
filetype='post', # vs. 'markdown'
initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
)
from python-slack-sdk.
Thanks for your prompt response!
Indeed, this seems to be a regression bug on the platform side. However, I hate say this... but Slack posts are now deprecated in favor of canvas, which is the one currently recommended to use: https://slack.com/help/articles/4426294050451-Slack-feature-retirements
So, please consider going with markdown or anything else that meets your requirements. Sorry for the disruption but I hope this helps clarify what's going on.
from python-slack-sdk.
Thank you very much for your understanding. Let me close this issue now.
from python-slack-sdk.
Related Issues (20)
- Slackbot configuration HOT 9
- Link unfurling for Video links from my app's domain HOT 2
- SQLAlchemyInstallationStore: Non-English column data support for MySQL use cases
- AuditLogsClient not honoring oldest/latest timestamps HOT 2
- On the slack app for android phones views.publish method fails to set initial_option on a static select control HOT 3
- Search.messages API does not return messages from bots/automations HOT 5
- Security concerns regarding video rendering on link unfurl HOT 7
- SlackApiError: 'dict' object has no attribute 'status_code' HOT 3
- How do I get the actual response when an error raised? HOT 1
- Add file input block element support
- Unable to send image with `files_upload_v2()` to single user HOT 3
- Add apps.manifest.* & tooling.tokens.rotate API support
- Add rich_text classes to slack_sdk.models module HOT 2
- Download file using WebClient HOT 1
- Add MongoDB installation store HOT 2
- Happy Holidays! ❄️ ⏳ The team will be on break from Dec 22nd 2023 to Jan 3rd 2024
- Built-in InstallationStores fail to resolve a valid bot token when both bot and user-only installations co-exist in database tables HOT 2
- block/type/image should allow image_url to reference an uploaded file to Slack without having to make it public HOT 2
- aiohttp based socket_mode failed to reconnect and enter a broken state HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-slack-sdk.