construct autocomplete interface objects once

This commit is contained in:
2026-01-23 16:49:54 -05:00
parent c5c733d14c
commit ff20bbef2c
2 changed files with 4 additions and 8 deletions

View File

@@ -118,11 +118,11 @@ func isDebuff(s horse.Skill) bool {
return false
}
var skillGlobalAuto = sync.OnceValue(func() *autocomplete.Set[string] {
var set autocomplete.Set[string]
var skillGlobalAuto = sync.OnceValue(func() *autocomplete.Set[discord.AutocompleteChoice] {
var set autocomplete.Set[discord.AutocompleteChoice]
for _, id := range global.OrderedSkills {
s := global.AllSkills[id]
set.Add(s.Name, s.Name)
set.Add(s.Name, discord.AutocompleteChoiceString{Name: s.Name, Value: s.Name})
}
return &set
})