Class AutocompleteHandler
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Base class for creating Autocompleters. InteractionService uses Autocompleters to generate parameter suggestions.
public abstract class AutocompleteHandler : IAutocompleteHandler
- Inheritance
-
AutocompleteHandler
- Implements
- Inherited Members
Properties
InteractionService
Gets the the underlying command service.
public InteractionService InteractionService { get; set; }
Property Value
Methods
ExecuteAsync(IInteractionContext, IAutocompleteInteraction, IParameterInfo, IServiceProvider)
Executes the IAutocompleteHandler with the provided context.
public Task<IResult> ExecuteAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter, IServiceProvider services)
Parameters
context
IInteractionContextThe execution context.
autocompleteInteraction
IAutocompleteInteractionAutocompleteInteraction payload.
parameter
IParameterInfoParameter information of the target parameter.
services
IServiceProviderDependencies that will be used to create the module instance.
Returns
- 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.
public abstract Task<AutocompletionResult> GenerateSuggestionsAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter, IServiceProvider services)
Parameters
context
IInteractionContextCommand execution context.
autocompleteInteraction
IAutocompleteInteractionAutocomplete Interaction payload.
parameter
IParameterInfoParameter information of the target parameter.
services
IServiceProviderDependencies that will be used to create the module instance.
Returns
- Task<AutocompletionResult>
A task representing the execution process. The task result contains the Autocompletion result.
GetLogString(IInteractionContext)
protected virtual string GetLogString(IInteractionContext context)
Parameters
context
IInteractionContext