Browse Source

Fixed syntax error in example AutocompleteHandler

pull/2524/head
Philipp Elvin Friedhoff GitHub 2 years ago
parent
commit
7e65a88bae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      docs/guides/int_framework/samples/autocompletion/autocomplete-example.cs

+ 2
- 2
docs/guides/int_framework/samples/autocompletion/autocomplete-example.cs View File

@@ -1,6 +1,6 @@
// you need to add `Autocomplete` attribute before parameter to add autocompletion to it
[SlashCommand("command_name", "command_description")]
public async Task ExampleCommand([Summary("parameter_name"), Autocomplete(typeof(ExampleAutocompleteHandler))] string parameterWithAutocompletion)
public async Task ExampleCommand([Summary("parameter_name"), [Autocomplete(typeof(ExampleAutocompleteHandler))] string parameterWithAutocompletion)
=> await RespondAsync($"Your choice: {parameterWithAutocompletion}");

public class ExampleAutocompleteHandler : AutocompleteHandler
@@ -17,4 +17,4 @@ public class ExampleAutocompleteHandler : AutocompleteHandler
// max - 25 suggestions at a time (API limit)
return AutocompletionResult.FromSuccess(results.Take(25));
}
}
}

Loading…
Cancel
Save