Skip to main content

Player Model

The Player object represents a player in NeatQueue and appears in most webhook events. This object contains player identity, rating, role information, and match-related metadata.

Structure​

{
"name": "Player",
"id": "111222333444555666",
"mmr": 1500,
"role": "Duelist",
"team_num": 0,
"top_role_index": 0,
"ign": "PlayerIGN",
"timestamp": "2024-02-10T00:00:00.123456",
"pulled_from": null
}

Fields​

FieldTypeDescription
namestringThe player's server nickname, or their Discord username if the queue uses /misc nametype type: Discord (default: nicknames)
idstringDiscord user ID (unique identifier)
mmrnumberPlayer's MMR (Matchmaking Rating)
rolestringPlayer's selected role or position
team_numnumberTeam assignment. -1 if not yet assigned, 0 for Team 1, 1 for Team 2, etc.
top_role_indexnumberSkill rank from the player's Discord roles, used when the queue balances teams by roles. 0 when balancing by MMR
ignstring|nullIn-game name if the player has registered, otherwise null
timestampstringISO 8601 date-time (without a timezone offset) when the player joined the queue, e.g. "2024-02-10T00:00:00.123456"
pulled_fromstring|nullID of the voice channel the player was in when they joined the queue, otherwise null
note

Player objects also carry fields not listed here, including captain, team_name (party or team name), party_leader, picked, mmr_change, priority, color, avatar_url, guild_id, mmr_multiplier_configs, points_multiplier, tournament_team_id and queue_entry_survey. Ignore any you don't use.

Field Details​

name​

The player's server nickname (display name), or their Discord username if the queue is set to Discord names with /misc nametype. Discord usernames no longer have discriminators. When the player joins through the queue, Markdown characters in the name are escaped (for example _ becomes \_).

Example: "CoolGamer"

id​

A unique Discord user ID. Use this as the primary identifier for players when storing data or tracking users across events.

Example: "111222333444555666"

mmr​

The player's current MMR (Matchmaking Rating). This numeric value represents skill level and is used for team balancing.

Example: 1500

role​

The role or position the player selected when joining the queue. The available roles depend on your queue configuration.

Examples: "Duelist", "Controller", "Tank", "DPS"

team_num​

Indicates which team the player is assigned to:

  • -1: Not yet assigned to a team (during queue phase)
  • 0: Team 1 (first team)
  • 1: Team 2 (second team)
  • 2+: Additional teams (for multi-team modes)

Example: 0 (player is on Team 1)

top_role_index​

Used when the queue balances teams by roles (/balanceby type mode: Roles). It is the position, in the /balanceby roles list (ordered lowest to highest skill), of the highest listed Discord role the player has, so higher values mean higher skill. If no roles are listed, it is the position of the player's highest hoisted Discord role. It is always 0 when the queue balances by MMR.

Example: 0

ign​

The player's in-game name (IGN) if they have registered it using NeatQueue's registration system. This field is null if the player hasn't registered an IGN.

Examples:

  • "PlayerIGN" (registered)
  • null (not registered)

timestamp​

An ISO 8601 date-time string, without a timezone offset, indicating when the player joined the queue.

Example: "2024-02-10T00:00:00.123456"

Converting to datetime (Python):

from datetime import datetime
dt = datetime.fromisoformat(player['timestamp'])

Converting to Date (JavaScript):

const date = new Date(player.timestamp);

pulled_from​

The ID of the voice channel the player was connected to when they joined the queue. NeatQueue can move players back to this channel when the match ends. It's null if the player wasn't in a voice channel.

Examples:

  • "1234567890123456789" (was in that voice channel)
  • null (not in voice)

Usage in Events​

The Player object appears in these events:

Example Usage​

Extracting Player Information​

def process_player(player):
# Get basic info
discord_name = player['name']
discord_id = player['id']
mmr = player['mmr']

# Check if player has registered IGN
if player['ign']:
print(f"{discord_name} (IGN: {player['ign']}) - MMR: {mmr}")
else:
print(f"{discord_name} - MMR: {mmr} (No IGN registered)")

# Check team assignment
if player['team_num'] == -1:
print("Not yet assigned to a team")
else:
print(f"Assigned to Team {player['team_num'] + 1}")

Calculating Team Statistics​

def calculate_team_stats(team):
"""Calculate average MMR for a team"""
total_mmr = sum(player['mmr'] for player in team)
avg_mmr = total_mmr / len(team)

print(f"Team size: {len(team)}")
print(f"Average MMR: {avg_mmr:.1f}")
print(f"Total MMR: {total_mmr}")

return avg_mmr

Finding Players by Role​

def get_players_by_role(players, role):
"""Filter players by their selected role"""
return [p for p in players if p['role'] == role]

# Example
duelists = get_players_by_role(match_players, "Duelist")
print(f"Found {len(duelists)} Duelists")