Skip to content

Commit

Permalink
Merge pull request #149 from netflie/fix-optional-interactive-message…
Browse files Browse the repository at this point in the history
…s-header

Fix optional header for interactive list messages
  • Loading branch information
aalbarca authored Nov 19, 2023
2 parents 2aa75dd + 0eb45d5 commit 4262e84
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Request/MessageRequest/RequestOptionsListMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ public function body(): array
'type' => 'interactive',
'interactive' => [
'type' => $this->message->type(),
'header' => [
'type' => 'text',
'text' => $this->message->header(),
],
'body' => ['text' => $this->message->body()],
'action' => $this->message->action(),
],
];

if ($this->message->header()) {
$body['interactive']['header'] = [
'type' => 'text',
'text' => $this->message->header(),
];
}

if ($this->message->footer()) {
$body['interactive']['footer'] = ['text' => $this->message->footer()];
}
Expand Down

0 comments on commit 4262e84

Please sign in to comment.