File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,23 @@ class Conversation extends BaseApi implements ApiInterface
8
8
* Sends an activity message
9
9
*
10
10
* @param string $target In format of 8:<username> or 19:<group>
11
- * @param string $content The message
11
+ * @param string $text The message
12
+ * @param array $suggestedActions
12
13
* @return \Psr\Http\Message\ResponseInterface
13
14
*/
14
- public function activity ($ target , $ content )
15
+ public function activity ($ target , $ text , $ suggestedActions = [] )
15
16
{
17
+ $ json = [
18
+ 'type ' => 'message/text ' ,
19
+ 'text ' => $ text ,
20
+ ];
21
+
22
+ if (!empty ($ suggestedActions )) {
23
+ $ json ['suggestedActions ' ]['actions ' ] = $ suggestedActions ;
24
+ }
25
+
16
26
return $ this ->request ('POST ' , '/v3/conversations/ ' . $ target . '/activities ' , [
17
- 'json ' => [
18
- "type " => "message/text " ,
19
- "text " => $ content
20
- ]
27
+ 'json ' => $ json
21
28
]);
22
29
}
23
30
}
You can’t perform that action at this time.
0 commit comments