Skip to content

Commit

Permalink
added suggested actions to activity
Browse files Browse the repository at this point in the history
  • Loading branch information
radutopala committed Feb 14, 2018
1 parent a27af09 commit 2d72cdb
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Skype/Api/Conversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ class Conversation extends BaseApi implements ApiInterface
* Sends an activity message
*
* @param string $target In format of 8:<username> or 19:<group>
* @param string $content The message
* @param string $text The message
* @param array $suggestedActions
* @return \Psr\Http\Message\ResponseInterface
*/
public function activity($target, $content)
public function activity($target, $text, $suggestedActions = [])
{
$json = [
'type' => 'message/text',
'text' => $text,
];

if (!empty($suggestedActions)) {
$json['suggestedActions']['actions'] = $suggestedActions;
}

return $this->request('POST', '/v3/conversations/' . $target . '/activities', [
'json' => [
"type" => "message/text",
"text" => $content
]
'json' => $json
]);
}
}

0 comments on commit 2d72cdb

Please sign in to comment.