for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Greenplugin\TelegramBot\Method;
use Greenplugin\TelegramBot\Method\Traits\ChatIdVariableTrait;
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
use Greenplugin\TelegramBot\Method\Traits\MessageIdVariableTrait;
/**
* Class PinChatMessageMethod.
*
* @see https://core.telegram.org/bots/api#pinchatmessage
*/
class PinChatMessageMethod
{
use FillFromArrayTrait;
use ChatIdVariableTrait;
use MessageIdVariableTrait;
* Optional. Pass True, if it is not necessary to send a notification to all chat members about the new
* pinned message. Notifications are always disabled in channels.
* @var bool|null
public $disableNotification;
* @param int|string $chatId
* @param int $messageId
* @param array|null $data
* @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
* @return PinChatMessageMethod
public static function create($chatId, int $messageId, array $data = null): PinChatMessageMethod
$instance = new static();
$instance->chatId = $chatId;
$instance->messageId = $messageId;
if ($data) {
$instance->fill($data);
}
return $instance;