$message]); // Match commands like !place A 1 red, !p A 1 red, !paint A 1 red // Updated regex to handle hyphenated color names $commandPattern = '/^(?:!place|!p|!paint)\s([A-P])\s(\d{1,2})\s([\w-]+)$/i'; if (preg_match($commandPattern, $message, $matches)) { Log::debug('TwitchHelper::parseMessage - Command matched', ['matches' => $matches]); return [ 'command' => 'place', 'x' => $matches[1], 'y' => $matches[2], 'color' => $matches[3] ]; } Log::debug('TwitchHelper::parseMessage - No match found'); return null; } }