Skip to content

api.importParty()

Put every member of a party on the map, one square each.

Part of the Action API · Function reference · Since Action API 0.2 (v0.86.0)

Signature

api.importParty(idOrName: string): Promise<Token[] | null>

Asynchronous — await it.

Parameters

Parameter Type Description
idOrName string The party's id, or its name. Names are matched case-insensitively among the parties you can see; if two parties share the name, use the id.

Returns

The tokens that were created, in the order the squares were clicked — or null if the user cancelled. Throws with a plain sentence if there is no such party, the party is empty, or there is no open map.

What it does

One targeting session for the whole party: Choose square 1 of 3 for Bill, Bob and Ann, then square 2, then 3. Each member becomes a token exactly as api.importCharacter() would make it.

Examples

const skulls = await api.importParty('The Skulls');
if (!skulls) return;
return `The Skulls arrive: ${skulls.map((t) => t.name).join(', ')}.`;

See also

api.importRelatedCharacters() — the same thing for the characters related to one, rather than a named party.