Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/guides/int_framework/autocompletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ A valid AutocompleteHandlers must inherit [AutocompleteHandler] base type and im

[!code-csharp[Autocomplete Command Example](samples/autocompletion/autocomplete-example.cs)]

In order for Autocompletehandlers to work you must register a AutocompleteExecuted method with your DiscordSocketClient

[!code-csharp[RegisterAutocompleteExecuted](samples/autocompletion/exampleRegisterAutocompletion.cs)]

### GenerateSuggestionsAsync()

The Interactions Service uses this method to generate a response of an Autocomplete Interaction.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_client.AutocompleteExecuted += HandleAutocompleteExecution;

private static async Task HandleAutocompleteExecution(SocketAutocompleteInteraction arg){
var context = new InteractionContext(_client, arg, arg.Channel);
await _interactionService.ExecuteCommandAsync(context, null);
}