Skip to content

Commit 78aefb6

Browse files
committed
Set filename as the default title of a file in files.upload v2 method
see #1165 (comment) for the context
1 parent 2b67f77 commit 78aefb6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

slack_sdk/web/internal_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ def _to_v2_file_upload_item(upload_file: Dict[str, Any]) -> Dict[str, Optional[A
336336
if data is None:
337337
raise SlackRequestError(f"File content not found for filename: {filename}, title: {title}")
338338

339+
if title is None:
340+
title = filename # to be consistent with files.upload API
341+
339342
return {
340343
"filename": filename,
341344
"data": data,

0 commit comments

Comments
 (0)