construct autocomplete interface objects once
This commit is contained in:
6
skill.go
6
skill.go
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user