code: 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();
      }
docs: Send message.
  
  @param Chat $chat
  @param User $recipient
  @param string $text
  @param Template|null $template