src/TelegramDriver.php
public function sendMessage(Chat $chat, User $recipient, string $text, Template $template = null): void
    {
        $sendMessage = new SendMessage();

        if ($template !== null) {
            $sendMessage->reply_markup = $this->templateCompiler->compile($template);
        }

        $sendMessage->chat_id = $chat->getId();
        $sendMessage->text = $text;

        $this->client->performApiRequest($sendMessage);
        $this->loop->run();
    }
public function sendMessage(Chat $chat, User $recipient, string $text, Template $template = null): void
    {
        $sendMessage = new SendMessage();

        if ($template !== null) {
            $sendMessage->reply_markup = $this->templateCompiler->compile($template);
        }

        $sendMessage->chat_id = $chat->getId();
        $sendMessage->text = $text;

        $this->client->performApiRequest($sendMessage);
        $this->loop->run();
    }
Send message.

@param Chat $chat
@param User $recipient
@param string $text
@param Template|null $template