Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the new channel parameter with a single str #1315

Closed
GreekGreenGeek opened this issue Dec 29, 2022 · 3 comments
Closed

Using the new channel parameter with a single str #1315

GreekGreenGeek opened this issue Dec 29, 2022 · 3 comments
Labels
auto-triage-stale question M-T: User needs support to use the project Version: 3x web-client

Comments

@GreekGreenGeek
Copy link

I write a script to upload a file and in my call I get the message. But I can't find anything in the doc related to this message. In the examples there is not even client.files_upload_v2() which is recommended.

/Users/spyros.m/Developer/Scripts/Python/audit_macos/venv/lib/python3.11/site-packages/slack_sdk/web/client.py:3032: UserWarning: Although the channels parameter is still supported for smooth migration from legacy files.upload, we recommend using the new channel parameter with a single str value instead for more clarity.

How to solve this warning?

@seratch seratch added question M-T: User needs support to use the project web-client Version: 3x and removed untriaged labels Dec 29, 2022
@seratch
Copy link
Member

seratch commented Dec 29, 2022

Hi @GreekGreenGeek, you can migrate to v2 method as below:

result = client.files_upload_v2( # files_upload -> files_upload_v2
    channel=channel_id, # channels -> channel
    initial_comment="Here's my file :smile:",
    file=file_name,
)

Also, please refer to the release notes https://github.com/slackapi/python-slack-sdk/releases/tag/v3.19.0 for more details.

I hope this was helpful to you!

@github-actions
Copy link

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

@seratch
Copy link
Member

seratch commented Feb 8, 2023

Thanks for your reaction 👍 Let me close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-stale question M-T: User needs support to use the project Version: 3x web-client
Projects
None yet
Development

No branches or pull requests

2 participants