From 821c9beae5edc0a973867629c68bc74d81ee86d8 Mon Sep 17 00:00:00 2001 From: Quin Lynch <49576606+quinchs@users.noreply.github.com> Date: Mon, 29 Nov 2021 23:41:57 -0400 Subject: [PATCH] Make autocomplete log virtual (#328) --- .../AutocompleteHandlers/AutocompleteHandler.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs b/src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs index ec4fa7f25..fd0bc83de 100644 --- a/src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs +++ b/src/Discord.Net.Interactions/AutocompleteHandlers/AutocompleteHandler.cs @@ -19,7 +19,11 @@ namespace Discord.Interactions public abstract Task 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"; + } /// public async Task ExecuteAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter,