Teams #

Read more about the Teams system in Hiro here.

Create a team #

Create a team which other players can join.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const request = new TeamCreateRequest();
request.name = "Example team";
request.desc = "Example description";
request.open = true;
request.icon = "icon.png";
request.lang_tag = "en";
request.setup_metadata = "";

const team = await hiroClient.teamsCreate(session, request);
console.log(team);

List one or more teams #

List one or more teams which the player can join.

1
2
3
4
5
6
7
const request = new TeamListRequest();
request.cursor = "";
request.location = "UK";
request.limit = 100;

const teamList = await hiroClient.teamsList(session, request);
console.log(teamList);

Search for a team #

Search for a team by name or optional short code.

1
2
3
4
5
6
const request = new TeamSearchRequest();
request.input = "heroes";
request.limit = 100;

const teamList = await hiroClient.teamSearch(session, request);
console.log(teamList);

Send team chat message #

Write a chat message to the Team’s chat channel.

1
2
3
4
5
6
const request = new TeamWriteChatMessageRequest();
request.id = "team_1";
request.content = "{\"message\":\"Hey everyone!\"}";

const channelMessageAck = await hiroClient.teamsWriteChatMessage(session, request);
console.log(channelMessageAck);