disable button for currently shown skill
This commit is contained in:
6
skill.go
6
skill.go
@@ -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...))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user