Browse Source

Make autocomplete log virtual (#328)

pull/1958/head
Quin Lynch GitHub 3 years ago
parent
commit
821c9beae5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs

+ 5
- 1
src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs View File

@@ -19,7 +19,11 @@ namespace Discord.Interactions
public abstract Task<AutocompletionResult> GenerateSuggestionsAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter,
IServiceProvider services);

protected abstract string GetLogString(IInteractionContext context);
protected virtual string GetLogString(IInteractionContext context)
{
var interaction = (context.Interaction as IAutocompleteInteraction);
return $"{interaction.Data.CommandName}: {interaction.Data.Current.Name} Autocomplete";
}

/// <inheritdoc/>
public async Task<IResult> ExecuteAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter,


Loading…
Cancel
Save