From 32408796b7e206e1e231c9016f7f3c3519c5fa55 Mon Sep 17 00:00:00 2001 From: morozgrafix Date: Wed, 12 Feb 2025 22:34:30 -0800 Subject: [PATCH 1/2] switch to files_upload_v2 and update version of slack_sdk to support it --- octoprint_Octoslack/__init__.py | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/octoprint_Octoslack/__init__.py b/octoprint_Octoslack/__init__.py index a6931c0..e28ee30 100644 --- a/octoprint_Octoslack/__init__.py +++ b/octoprint_Octoslack/__init__.py @@ -4821,6 +4821,8 @@ def upload_slack_asset( upload_rsp = None with open(local_file_path, "rb") as file_to_upload: if slack_client2: + # Slack API method files.upload will be deprecated on March 11, 2025 + # https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay upload_rsp = slack_client2.api_call( "files.upload", channels=channels, @@ -4829,7 +4831,7 @@ def upload_slack_asset( file=file_to_upload, ) elif slack_client3: - upload_rsp = slack_client3.files_upload( + upload_rsp = slack_client3.files_upload_v2( channels=channels, filename=dest_filename, title=file_description, diff --git a/setup.py b/setup.py index 383a2a1..e7222e5 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ plugin_requires.append("Pillow<7.0.0") plugin_requires.append("humanize<=1.0.0") else: - plugin_requires.append("slack_sdk>3.0.0") + plugin_requires.append("slack_sdk>3.23.0") plugin_requires.append("minio") plugin_requires.append("Pillow") plugin_requires.append("humanize") From 16e7e66506f13202c34a7711292e68affde2f73c Mon Sep 17 00:00:00 2001 From: morozgrafix Date: Wed, 12 Feb 2025 22:42:52 -0800 Subject: [PATCH 2/2] bump plugin version to 2.2.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e7222e5..862b196 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ plugin_name = "Octoslack" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "2.2.0" +plugin_version = "2.2.1" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module