How to move player to spectator team?

Hi, another question about Spectator, how to move player to Spectator Team in scripts.
I know that host in lobby can move player to Spectator by clicking right click and select option but I need this function in scripts.
I didn’t find any option in workshop and by trying myself write code it still don’t want to work, for example command “Team” have 3 options “All Teams(it move player to queue, Team 1(blue), Team 2(red)” if we copy it to notepad we will see how game see this command, but not one of my options like “Team 0, Team Spectator, Spectator Team, Team 3…” don’t work with game and it give error message, it’s search for command that include in game but I don’t find way how to check the game command about spectators team.

Is someone know how the game see Spectator Team in code?