Skip to content

Commit 87f948c

Browse files
committed
Remove bugcheck autocomplete
1 parent 53ab31c commit 87f948c

1 file changed

Lines changed: 4 additions & 27 deletions

File tree

commands/bugcheck.go

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ var BugCheckCommand = tempest.Command{
1414
Description: "Look up a Windows NT bug check code",
1515
Options: []tempest.CommandOption{
1616
{
17-
Type: tempest.STRING_OPTION_TYPE,
18-
Name: "code",
19-
Description: "Bug check code",
20-
Required: true,
21-
AutoComplete: true,
17+
Type: tempest.STRING_OPTION_TYPE,
18+
Name: "code",
19+
Description: "Bug check code",
20+
Required: true,
2221
},
2322
},
2423
SlashCommandHandler: handleBugCheck,
25-
AutoCompleteHandler: handleBugCheckAutoComplete,
2624
}
2725

2826
func handleBugCheck(itx *tempest.CommandInteraction) {
@@ -80,24 +78,3 @@ func handleBugCheck(itx *tempest.CommandInteraction) {
8078

8179
itx.SendReply(response, false, nil)
8280
}
83-
84-
func handleBugCheckAutoComplete(itx tempest.CommandInteraction) []tempest.Choice {
85-
value := itx.Data.Options[0].Value.(string)
86-
87-
matches := repoInstance.BugCheck.FindBugCheckString(value)
88-
89-
if len(matches) > 25 {
90-
return []tempest.Choice{}
91-
}
92-
93-
var choices []tempest.Choice
94-
95-
for _, match := range matches {
96-
choices = append(choices, tempest.Choice{
97-
Name: match.Name,
98-
Value: fmt.Sprintf("0x%08X", match.Code),
99-
})
100-
}
101-
102-
return choices
103-
}

0 commit comments

Comments
 (0)