protected function matchDefault(\CharlotteDunois\Yasmin\Models\Message $message, string $pattern, int $commandNameIndex = 1) {
        \preg_match($pattern, $message->content, $matches);
        if(!empty($matches)) {
            $commands = $this->client->registry->findCommands($matches[$commandNameIndex], true);
            if(\count($commands) !== 1 || $commands[0]->defaultHandling === false) {
                return (new \CharlotteDunois\Livia\Commands\Context($this->client, $message, null));
            }
            
            $argString = (string) \mb_substr($message->content, (\mb_strlen($matches[1]) + (!empty($matches[2]) ? \mb_strlen($matches[2]) : 0)));
            return (new \CharlotteDunois\Livia\Commands\Context($this->client, $message, $commands[0], $argString));
        }
        
        return null;
    }
protected function matchDefault(\CharlotteDunois\Yasmin\Models\Message $message, string $pattern, int $commandNameIndex = 1) {
        \preg_match($pattern, $message->content, $matches);
        if(!empty($matches)) {
            $commands = $this->client->registry->findCommands($matches[$commandNameIndex], true);
            if(\count($commands) !== 1 || $commands[0]->defaultHandling === false) {
                return (new \CharlotteDunois\Livia\Commands\Context($this->client, $message, null));
            }
            
            $argString = (string) \mb_substr($message->content, (\mb_strlen($matches[1]) + (!empty($matches[2]) ? \mb_strlen($matches[2]) : 0)));
            return (new \CharlotteDunois\Livia\Commands\Context($this->client, $message, $commands[0], $argString));
        }
        
        return null;
    }
protected function matchDefault ( \ CharlotteDunois \ Yasmin \ Models \ Message $ message , string $ pattern , int $ commandNameIndex = 1 ) { \ preg_match ( $ pattern , $ message -> content , $ matches ) ; if ( ! empty ( $ matches ) ) { $ commands = $ this -> client -> registry -> findCommands ( $ matches [ $ commandNameIndex ] , true ) ; if ( \ count ( $ commands ) !== 1 || $ commands [ 0 ] -> defaultHandling === false ) { return ( new \ CharlotteDunois \ Livia \ Commands \ Context ( $ this -> client , $ message , null ) ) ; } $ argString = ( string ) \ mb_substr ( $ message -> content , ( \ mb_strlen ( $ matches [ 1 ] ) + ( ! empty ( $ matches [ 2 ] ) ? \ mb_strlen ( $ matches [ 2 ] ) : 0 ) ) ) ; return ( new \ CharlotteDunois \ Livia \ Commands \ Context ( $ this -> client , $ message , $ commands [ 0 ] , $ argString ) ) ; } return null ; }
Matches a message against a guild command pattern.
@param \CharlotteDunois\Yasmin\Models\Message  $message
@param string                                  $pattern           The pattern to match against.
@param int                                     $commandNameIndex  The index of the command name in the pattern matches.
@return \CharlotteDunois\Livia\Commands\Context|null
Matches a message against a guild command pattern .