Module: Panoptes::Client::Comments

Included in:
Panoptes::Client
Defined in:
lib/panoptes/client/comments.rb

Instance Method Summary collapse

Instance Method Details

#create_comment(discussion_id:, body:) ⇒ Object

Post a comment to a talk discussion

Parameters:

  • discussion_id (Integer)

    filter by focussable id

  • focus_type (String)

    filter by focussable type

Returns:

  • list of discussions



11
12
13
14
15
# File 'lib/panoptes/client/comments.rb', line 11

def create_comment(discussion_id:, body:)
  user_id = token_contents['id']
  response = talk.post('/comments', comments: { discussion_id: discussion_id, body: body, user_id: user_id })
  response.fetch('comments')[0]
end