Module: Slack::Web::Api::Endpoints::Files
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/files.rb
Instance Method Summary collapse
-
#files_comments(options = {}) ⇒ Object
Edit an existing comment on a file.
-
#files_delete(options = {}) ⇒ Object
This method deletes a file from your team.
-
#files_info(options = {}) ⇒ Object
This method returns information about a file in your team.
-
#files_list(options = {}) ⇒ Object
This method returns a list of files within the team.
-
#files_upload(options = {}) ⇒ Object
This method allows you to create or upload an existing file.
Instance Method Details
#files_comments(options = {}) ⇒ Object
Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed.
19 20 21 22 23 24 |
# File 'lib/slack/web/api/endpoints/files.rb', line 19 def files_comments( = {}) throw ArgumentError.new('Required arguments :file missing') if [:file].nil? throw ArgumentError.new('Required arguments :id missing') if [:id].nil? throw ArgumentError.new('Required arguments :comment missing') if [:comment].nil? post('files.comments', ) end |
#files_delete(options = {}) ⇒ Object
This method deletes a file from your team.
33 34 35 36 |
# File 'lib/slack/web/api/endpoints/files.rb', line 33 def files_delete( = {}) throw ArgumentError.new('Required arguments :file missing') if [:file].nil? post('files.delete', ) end |
#files_info(options = {}) ⇒ Object
This method returns information about a file in your team.
45 46 47 48 |
# File 'lib/slack/web/api/endpoints/files.rb', line 45 def files_info( = {}) throw ArgumentError.new('Required arguments :file missing') if [:file].nil? post('files.info', ) end |
#files_list(options = {}) ⇒ Object
This method returns a list of files within the team. It can be filtered and sliced in various ways.
77 78 79 80 81 |
# File 'lib/slack/web/api/endpoints/files.rb', line 77 def files_list( = {}) = .merge(channel: channels_id()['channel']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('files.list', ) end |
#files_upload(options = {}) ⇒ Object
This method allows you to create or upload an existing file.
102 103 104 105 106 |
# File 'lib/slack/web/api/endpoints/files.rb', line 102 def files_upload( = {}) throw ArgumentError.new('Required arguments :file missing') if [:file].nil? throw ArgumentError.new('Required arguments :filename missing') if [:filename].nil? post('files.upload', ) end |