We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5208914 + 6d018ed commit 72a3204Copy full SHA for 72a3204
src/commands/team.rs
@@ -594,7 +594,11 @@ impl TeamCommand {
594
query = query.program(program_id_filter);
595
}
596
597
- if let Ok(teams) = robotevents.teams(query).await {
+ if let Ok(mut teams) = robotevents.teams(query).await {
598
+ // Prioritize teams that are registered over teams that are not registered.
599
+ // From there, pick the team with the lowest numeric program ID (VRC has the lowest ID being `1`).
600
+ teams.data.sort_by_key(|team| (!team.registered, team.program.id));
601
+
602
if let Some(team) = teams.data.iter().next() {
603
self.team = Some(team.clone()); // Cache value for later use.
604
return Ok(team.clone());
0 commit comments