function finalize($responses) {
        if(!empty($this->responses)) {
            $this->deleteRemainingResponses();
        }
        
        if(\is_array($responses)) {
            foreach($responses as $response) {
                /** @var \CharlotteDunois\Yasmin\Models\Message  $msg */
                $msg = (\is_array($response) ? $response[0] : $response);
                
                if(!($msg instanceof \CharlotteDunois\Yasmin\Models\Message)) {
                    continue;
                }
                
                $id = $this->getChannelIDOrDM($msg->channel);
                
                if(empty($this->responses[$id])) {
                    $this->responses[$id] = array();
                }
                
                $this->responses[$id][] = $response;
            }
        } elseif($responses !== null) {
            if(!($responses instanceof \CharlotteDunois\Yasmin\Models\Message)) {
                return;
            }
            
            $id = $this->getChannelIDOrDM($responses->channel);
            $this->responses[$id] = array($responses);
        }
    }
function finalize($responses) {
        if(!empty($this->responses)) {
            $this->deleteRemainingResponses();
        }
        
        if(\is_array($responses)) {
            foreach($responses as $response) {
                /** @var \CharlotteDunois\Yasmin\Models\Message  $msg */
                $msg = (\is_array($response) ? $response[0] : $response);
                
                if(!($msg instanceof \CharlotteDunois\Yasmin\Models\Message)) {
                    continue;
                }
                
                $id = $this->getChannelIDOrDM($msg->channel);
                
                if(empty($this->responses[$id])) {
                    $this->responses[$id] = array();
                }
                
                $this->responses[$id][] = $response;
            }
        } elseif($responses !== null) {
            if(!($responses instanceof \CharlotteDunois\Yasmin\Models\Message)) {
                return;
            }
            
            $id = $this->getChannelIDOrDM($responses->channel);
            $this->responses[$id] = array($responses);
        }
    }
function finalize ( $ responses ) { if ( ! empty ( $ this -> responses ) ) { $ this -> deleteRemainingResponses ( ) ; } if ( \ is_array ( $ responses ) ) { foreach ( $ responses as $ response ) { /** @var \CharlotteDunois\Yasmin\Models\Message  $msg */ $ msg = ( \ is_array ( $ response ) ? $ response [ 0 ] : $ response ) ; if ( ! ( $ msg instanceof \ CharlotteDunois \ Yasmin \ Models \ Message ) ) { continue ; } $ id = $ this -> getChannelIDOrDM ( $ msg -> channel ) ; if ( empty ( $ this -> responses [ $ id ] ) ) { $ this -> responses [ $ id ] = array ( ) ; } $ this -> responses [ $ id ] [ ] = $ response ; } } elseif ( $ responses !== null ) { if ( ! ( $ responses instanceof \ CharlotteDunois \ Yasmin \ Models \ Message ) ) { return ; } $ id = $ this -> getChannelIDOrDM ( $ responses -> channel ) ; $ this -> responses [ $ id ] = array ( $ responses ) ; } }
Finalizes the command message by setting the responses and deleting any remaining prior ones.
@param \CharlotteDunois\Yasmin\Models\Message|\CharlotteDunois\Yasmin\Models\Message[]|null  $responses
@return void
@internal
Finalizes the command message by setting the responses and deleting any remaining prior ones .