for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace FondBot\Channels\VkCommunity;
use FondBot\Contracts\Channels\ReceivedMessage;
use FondBot\Contracts\Channels\Message\Location;
use FondBot\Contracts\Channels\Message\Attachment;
class VkCommunityReceivedMessage implements ReceivedMessage
{
private $payload;
public function __construct(array $payload)
$this->payload = $payload;
}
/**
* Get text.
*
* @return string|null
*/
public function getText(): ?string
return $this->payload['body'] ?? null;
* Get location.
* @return Location|null
public function getLocation(): ?Location
return null;
* Determine if message has attachment.
* @return bool
public function hasAttachment(): bool
return false;
* Get attachment.
* @return Attachment|null
public function getAttachment(): ?Attachment
* Determine if message has data payload.
public function hasData(): bool
* Get data payload.
public function getData(): ?string