code: public function chatRename($chat, $newChatName)
      {
          $chat        = $this->escapePeer($chat); //Not escapeStringArgument as chat needs underscores if spaces in name
          $newChatName = $this->escapeStringArgument($newChatName); //Not escapeStringArgument as chat needs underscores if spaces in name
  
          return $this->exec('rename_chat ' . $chat . ' ' . $newChatName);
      }
docs: Rename $chat to $newChatName
  @param $chat
  @param $newChatName
  @return bool|string