Class AutocompleteHandler
Base class for creating Autocompleters. InteractionService uses Autocompleters to generate parameter suggestions.
Implements
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public abstract class AutocompleteHandler : object, IAutocompleteHandler
Properties
| Improve this Doc View SourceInteractionService
Gets the the underlying command service.
Declaration
public InteractionService InteractionService { get; set; }
Property Value
Type | Description |
---|---|
InteractionService |
Methods
| Improve this Doc View SourceExecuteAsync(IInteractionContext, IAutocompleteInteraction, IParameterInfo, IServiceProvider)
Executes the IAutocompleteHandler with the provided context.
Declaration
public async Task<IResult> ExecuteAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter, IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context | The execution context. |
IAutocompleteInteraction | autocompleteInteraction | AutocompleteInteraction payload. |
IParameterInfo | parameter | Parameter information of the target parameter. |
IServiceProvider | services | Dependencies that will be used to create the module instance. |
Returns
Type | Description |
---|---|
Task<IResult> | A task representing the execution process. The task result contains the execution result. |
GenerateSuggestionsAsync(IInteractionContext, IAutocompleteInteraction, IParameterInfo, IServiceProvider)
Will be used to generate parameter suggestions.
Declaration
public abstract Task<AutocompletionResult> GenerateSuggestionsAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter, IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context | Command execution context. |
IAutocompleteInteraction | autocompleteInteraction | Autocomplete Interaction payload. |
IParameterInfo | parameter | Parameter information of the target parameter. |
IServiceProvider | services | Dependencies that will be used to create the module instance. |
Returns
Type | Description |
---|---|
Task<AutocompletionResult> | A task representing the execution process. The task result contains the Autocompletion result. |
GetLogString(IInteractionContext)
Declaration
protected virtual string GetLogString(IInteractionContext context)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context |
Returns
Type | Description |
---|---|
String |