function addField($title, $value, bool $inline = false) {
        if(\count($this->fields) >= 25) {
            throw new \RangeException('Embeds can not have more than 25 fields');
        }
        
        $title = (string) $title;
        $value = (string) $value;
        
        if(\mb_strlen($title) > 256) {
            throw new \InvalidArgumentException('Embed title can not be longer than 256 characters');
        }
        
        if(\mb_strlen($value) > 1024) {
            throw new \InvalidArgumentException('Embed value can not be longer than 1024 characters');
        }
        
        $this->fields[] = array(
            'name' => $title,
            'value' => $value,
            'inline' => $inline
        );
        
        return $this;
    }
function addField($title, $value, bool $inline = false) {
        if(\count($this->fields) >= 25) {
            throw new \RangeException('Embeds can not have more than 25 fields');
        }
        
        $title = (string) $title;
        $value = (string) $value;
        
        if(\mb_strlen($title) > 256) {
            throw new \InvalidArgumentException('Embed title can not be longer than 256 characters');
        }
        
        if(\mb_strlen($value) > 1024) {
            throw new \InvalidArgumentException('Embed value can not be longer than 1024 characters');
        }
        
        $this->fields[] = array(
            'name' => $title,
            'value' => $value,
            'inline' => $inline
        );
        
        return $this;
    }
function addField ( $ title , $ value , bool $ inline = false ) { if ( \ count ( $ this -> fields ) >= 25 ) { throw new \ RangeException ( 'Embeds can not have more than 25 fields' ) ; } $ title = ( string ) $ title ; $ value = ( string ) $ value ; if ( \ mb_strlen ( $ title ) > 256 ) { throw new \ InvalidArgumentException ( 'Embed title can not be longer than 256 characters' ) ; } if ( \ mb_strlen ( $ value ) > 1024 ) { throw new \ InvalidArgumentException ( 'Embed value can not be longer than 1024 characters' ) ; } $ this -> fields [ ] = array ( 'name' => $ title , 'value' => $ value , 'inline' => $ inline ) ; return $ this ; }
Adds a field to this embed.
@param string  $title    Maximum length is 256 characters.
@param string  $value    Maximum length is 1024 characters.
@param bool    $inline   Whether this field gets shown with other inline fields on one line.
@return $this
@throws \RangeException
@throws \InvalidArgumentException
Adds a field to this embed .