-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a8fafc
commit b162fbd
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Netflie\WhatsAppCloudApi\Message; | ||
|
||
final class ReactionMessage extends Message | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected string $type = 'reaction'; | ||
|
||
private $emoji; | ||
|
||
private $message_id; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct(string $to, string $emoji, string $message_id) | ||
{ | ||
$this->emoji = $emoji; | ||
$this->message_id = $message_id; | ||
|
||
parent::__construct($to, null); | ||
} | ||
|
||
public function emoji(): string | ||
{ | ||
return $this->emoji; | ||
} | ||
|
||
public function message_id(): string | ||
{ | ||
return $this->message_id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Netflie\WhatsAppCloudApi\Request\MessageRequest; | ||
|
||
use Netflie\WhatsAppCloudApi\Request\MessageRequest; | ||
|
||
final class RequestReactionMessage extends MessageRequest | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function body(): array | ||
{ | ||
$body = [ | ||
'messaging_product' => $this->message->messagingProduct(), | ||
'recipient_type' => $this->message->recipientType(), | ||
'to' => $this->message->to(), | ||
'type' => $this->message->type(), | ||
$this->message->type() => [ | ||
'message_id' => $this->message->message_id(), | ||
'emoji' => $this->message->emoji(), | ||
], | ||
]; | ||
|
||
return $body; | ||
} | ||
} |