Skip to content

Commit

Permalink
fallback to display event sku if program code is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Dec 26, 2023
1 parent 9d9d2a3 commit 70c7726
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/commands/team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,15 @@ impl TeamCommand {
for event in events.data {
embed = embed.field(
event.name,
format!(
"[View More](https://robotevents.com/robot-competitions/{}/{})",
event.program.code.unwrap_or("UNKNOWN".to_string()),
if let Some(code) = event.program.code {
format!(
"[View More](https://robotevents.com/robot-competitions/{}/{})",
code,
event.sku
)
} else {
event.sku
),
},
true
);
}
Expand Down

0 comments on commit 70c7726

Please sign in to comment.