Skip to content

Commit d635678

Browse files
committed
inline file open
1 parent fedd8ad commit d635678

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,11 @@ Upload files with [sequenced API calls](https://api.slack.com/messaging/files#up
176176
This library provides a helper method `files_upload_v2` that wraps the three separate API calls.
177177

178178
```ruby
179-
contents = File.read('/users/me/results.pdf')
180179
client.files_upload_v2(
181180
# required options
182181
channels: 'C000000,C000001', # comma delimited channel ids, only one channel is required
183182
filename: 'results.pdf', # this is used for the file title, unless a :title option is provided
184-
contents: contents, # the string contents of the file
183+
contents: File.read('/users/me/results.pdf'), # the string contents of the file
185184

186185
# optional options
187186
initial_comment: 'Sharing the Q1 results :tada:', # the message that is included with the file share thread

0 commit comments

Comments
 (0)