protected function editResponse($response, string $type, string $content, array $options = array()) {
        if(!$response) {
            return $this->respond($type, $content, $options);
        }
        
        if(!empty($options['split'])) {
            $content = \CharlotteDunois\Yasmin\Utils\MessageHelpers::splitMessage($content, (\is_array($options['split']) ? $options['split'] : array()));
            if(\count($content) === 1) {
                $content = $content[0];
            }
        }
        
        $prepend = '';
        if($type === 'reply') {
            $prepend = $this->message->author->__toString().\CharlotteDunois\Yasmin\Models\Message::$replySeparator;
        }
        
        if(\is_array($content)) {
            $promises = array();
            $clength = \count($content);
            
            if(\is_array($response)) {
                for($i = 0;  $i < $clength; $i++) {
                    if(!empty($response[$i])) {
                        $promises[] = $response[$i]->edit($prepend.$content[$i], $options);
                    } else {
                        $promises[] = $this->message->channel->send($prepend.$content[$i], $options);
                    }
                }
            } else {
                $promises[] = $response->edit($prepend.$content[0], $options);
                for($i = 1; $i < $clength; $i++) {
                    $promises[] = $this->message->channel->send($prepend.$content[$i], $options);
                }
            }
            
            return \React\Promise\all($promises);
        } else {
            if(\is_array($response)) {
                for($i = \count($response) - 1;  $i > 0; $i--) {
                    $response[$i]->delete()->done();
                }
                
                return $response[0]->edit($prepend.$content, $options);
            } else {
                return $response->edit($prepend.$content, $options);
            }
        }
    }
protected function editResponse($response, string $type, string $content, array $options = array()) {
        if(!$response) {
            return $this->respond($type, $content, $options);
        }
        
        if(!empty($options['split'])) {
            $content = \CharlotteDunois\Yasmin\Utils\MessageHelpers::splitMessage($content, (\is_array($options['split']) ? $options['split'] : array()));
            if(\count($content) === 1) {
                $content = $content[0];
            }
        }
        
        $prepend = '';
        if($type === 'reply') {
            $prepend = $this->message->author->__toString().\CharlotteDunois\Yasmin\Models\Message::$replySeparator;
        }
        
        if(\is_array($content)) {
            $promises = array();
            $clength = \count($content);
            
            if(\is_array($response)) {
                for($i = 0;  $i < $clength; $i++) {
                    if(!empty($response[$i])) {
                        $promises[] = $response[$i]->edit($prepend.$content[$i], $options);
                    } else {
                        $promises[] = $this->message->channel->send($prepend.$content[$i], $options);
                    }
                }
            } else {
                $promises[] = $response->edit($prepend.$content[0], $options);
                for($i = 1; $i < $clength; $i++) {
                    $promises[] = $this->message->channel->send($prepend.$content[$i], $options);
                }
            }
            
            return \React\Promise\all($promises);
        } else {
            if(\is_array($response)) {
                for($i = \count($response) - 1;  $i > 0; $i--) {
                    $response[$i]->delete()->done();
                }
                
                return $response[0]->edit($prepend.$content, $options);
            } else {
                return $response->edit($prepend.$content, $options);
            }
        }
    }
protected function editResponse ( $ response , string $ type , string $ content , array $ options = array ( ) ) { if ( ! $ response ) { return $ this -> respond ( $ type , $ content , $ options ) ; } if ( ! empty ( $ options [ 'split' ] ) ) { $ content = \ CharlotteDunois \ Yasmin \ Utils \ MessageHelpers :: splitMessage ( $ content , ( \ is_array ( $ options [ 'split' ] ) ? $ options [ 'split' ] : array ( ) ) ) ; if ( \ count ( $ content ) === 1 ) { $ content = $ content [ 0 ] ; } } $ prepend = '' ; if ( $ type === 'reply' ) { $ prepend = $ this -> message -> author -> __toString ( ) . \ CharlotteDunois \ Yasmin \ Models \ Message :: $ replySeparator ; } if ( \ is_array ( $ content ) ) { $ promises = array ( ) ; $ clength = \ count ( $ content ) ; if ( \ is_array ( $ response ) ) { for ( $ i = 0 ; $ i < $ clength ; $ i ++ ) { if ( ! empty ( $ response [ $ i ] ) ) { $ promises [ ] = $ response [ $ i ] -> edit ( $ prepend . $ content [ $ i ] , $ options ) ; } else { $ promises [ ] = $ this -> message -> channel -> send ( $ prepend . $ content [ $ i ] , $ options ) ; } } } else { $ promises [ ] = $ response -> edit ( $ prepend . $ content [ 0 ] , $ options ) ; for ( $ i = 1 ; $ i < $ clength ; $ i ++ ) { $ promises [ ] = $ this -> message -> channel -> send ( $ prepend . $ content [ $ i ] , $ options ) ; } } return \ React \ Promise \ all ( $ promises ) ; } else { if ( \ is_array ( $ response ) ) { for ( $ i = \ count ( $ response ) - 1 ; $ i > 0 ; $ i -- ) { $ response [ $ i ] -> delete ( ) -> done ( ) ; } return $ response [ 0 ] -> edit ( $ prepend . $ content , $ options ) ; } else { return $ response -> edit ( $ prepend . $ content , $ options ) ; } } }
Edits a response to the command message. Resolves with an instance of Message or an array of Message instances.
@param \CharlotteDunois\Yasmin\Models\Message|\CharlotteDunois\Yasmin\Models\Message[]|null  $response
@param string                                                                                $type
@param string                                                                                $content
@param array                                                                                 $options
@return \React\Promise\ExtendedPromiseInterface
Edits a response to the command message . Resolves with an instance of Message or an array of Message instances .