CustomGame.Menu(int slotID, int menuOption, bool ignoreBottom = false);
Syntax
public bool Menu(
    int slotID,
    int menuOption,
    int ignoreBottom = false
)

slotID
Slot of player to target.
Type: int

menuOption
Option to execute on player.
Type: int

ignoreBottom
Set to true when executing on a bot. Defaults to false.
Type: bool

Does an action to a player in a specific slot. Returns false on failure.

The code below will switch the player in the first blue slot to red.

using System;
using CustomGameOW;

...

static void Main(string[] args)
{
    CustomGame cg = new CustomGame();

    cg.Menu(
        0, // slot
        1 // menu option "swap to red team"
    );
}

The code below will switch the player in the first blue slot to spectator.

using System;
using CustomGameOW;

...

static void Main(string[] args)
{
    CustomGame cg = new CustomGame();

    cg.Menu(
        0, // slot
        2 // menu option "swap to spectator"
    );
}

The menu is different if they are in a team, in spectator, in queue, in queue for red, in queue for blue, or is an AI.