disable button for currently shown skill

This commit is contained in:
2026-01-16 23:41:13 -05:00
parent f5e26e5036
commit e712263d13
3 changed files with 8 additions and 2 deletions

View File

@@ -103,7 +103,11 @@ func RenderSkill(id horse.SkillID, all map[horse.SkillID]horse.Skill, groups map
if len(rel) > 1 {
buttons := make([]discord.InteractiveComponent, 0, 4)
for _, rs := range rel {
buttons = append(buttons, discord.NewButton(discord.ButtonStyleSecondary, rs.Name, fmt.Sprintf("/skill/%d", rs.ID), "", 0))
b := discord.NewButton(discord.ButtonStyleSecondary, rs.Name, fmt.Sprintf("/skill/%d", rs.ID), "", 0)
if rs.ID == id {
b = b.AsDisabled()
}
buttons = append(buttons, b)
}
r.Components = append(r.Components, discord.NewActionRow(buttons...))
}