From 26e260f3bd39b114fbe363000707bc19dba5cd45 Mon Sep 17 00:00:00 2001 From: Nilay Khatri Date: Tue, 6 Aug 2019 17:27:20 +0530 Subject: [PATCH] Fixed #32 Added option to set title for QuickReplies --- src/RichMessage/Suggestion.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/RichMessage/Suggestion.php b/src/RichMessage/Suggestion.php index 64f9828..7480c77 100644 --- a/src/RichMessage/Suggestion.php +++ b/src/RichMessage/Suggestion.php @@ -12,6 +12,9 @@ class Suggestion extends RichMessage /** @var array */ protected $replies = []; + + /** @var string */ + protected $title; /** * Create a new Suggestion instance. @@ -31,6 +34,17 @@ public static function create($reply = null) return $suggestion; } + /** + * Set the title for a Card. + * + * @param string $title + */ + public function title($title) + { + $this->title = $title; + return $this; + } + /** * Set the reply for a Suggestion. * @@ -103,6 +117,7 @@ protected function renderV2() } else { $out = [ 'quickReplies' => [ + 'title' => $this->title, 'quickReplies' => $this->replies, ], ];