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

2
go.mod
View File

@@ -3,7 +3,7 @@ module git.sunturtle.xyz/zephyr/horsebot
go 1.24.1
require (
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117030110-cb1c51db05bb
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe
github.com/disgoorg/disgo v0.19.0-rc.15
)

2
go.sum
View File

@@ -4,6 +4,8 @@ git.sunturtle.xyz/zephyr/horse v0.0.0-20260117022630-19fb713aaa10 h1:soAAeJR/omx
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117022630-19fb713aaa10/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk=
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117030110-cb1c51db05bb h1:iFPbu8i9sRakUnvRX9UzBd/RsVQkf6Nn3sOG/8F6QKM=
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117030110-cb1c51db05bb/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk=
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe h1:fgTarB04AHOKsi/G50fszjCG1pV4u799pxf43zmJk/8=
git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/disgoorg/disgo v0.19.0-rc.15 h1:x0NsV2gcbdjwuztsg2wYXw76p1Cpc8f6ByDrkPcfQtU=

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...))
}