Module: Slack::Web::Api::Endpoints::FilesComments

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/files_comments.rb

Instance Method Summary collapse

Instance Method Details

#files_comments_add(options = {}) ⇒ Object

Add a comment to an existing file.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :file (file)

    File to add a comment to.

  • :comment (Object)

    Text of the comment to add.

  • :channel (channel)

    Channel id (encoded) of which location to associate with the new comment.

See Also:



19
20
21
22
23
24
# File 'lib/slack/web/api/endpoints/files_comments.rb', line 19

def files_comments_add(options = {})
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
  throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('files.comments.add', options)
end

#files_comments_delete(options = {}) ⇒ Object

Delete an existing comment on a file. Only the original author of the comment or a Team Administrator may delete a file comment.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :file (file)

    File to delete a comment from.

  • :id (Object)

    The comment to delete.

See Also:



35
36
37
38
39
# File 'lib/slack/web/api/endpoints/files_comments.rb', line 35

def files_comments_delete(options = {})
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
  throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
  post('files.comments.delete', options)
end

#files_comments_edit(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.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :file (file)

    File containing the comment to edit.

  • :id (Object)

    The comment to edit.

  • :comment (Object)

    Text of the comment to edit.

See Also:



52
53
54
55
56
57
# File 'lib/slack/web/api/endpoints/files_comments.rb', line 52

def files_comments_edit(options = {})
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
  throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
  throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
  post('files.comments.edit', options)
end