I created a bot to sends automatic whatsapp messages. But I have a question I want to hide window after qr code scanned, is this possible without using --headless option?
No you can't hide the window once you have initialized the Browsing Context in the normal (headed) mode within the same session. Neither you can add the --headless option for the same ongoing session.
A cleaner way would be to call driver.quit() within tearDown(){} method to close and destroy the current ChromeDriver and Chrome Browser instances gracefully and then span a new set of ChromeDriver and Chrome Browser instance with the new set of configurations.
Selenium: Can I hide window after login screen