From 32fd445e1d29273a3a03e5bc0d4d1f46c83abb47 Mon Sep 17 00:00:00 2001 From: d4n Date: Fri, 20 May 2022 14:55:58 -0500 Subject: [PATCH] Fix displayed command names in logs and database --- src/Services/InteractionHandlingService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Services/InteractionHandlingService.cs b/src/Services/InteractionHandlingService.cs index a14b974..5133758 100644 --- a/src/Services/InteractionHandlingService.cs +++ b/src/Services/InteractionHandlingService.cs @@ -241,9 +241,9 @@ private Task AutocompleteHandlerExecuted(IAutocompleteHandler autocompleteComman private async Task HandleCommandExecutedAsync(IApplicationCommandInfo command, IInteractionContext context, IResult result) { - string commandName = command.ToString()!.ToLowerInvariant(); + string commandName = command.CommandType == ApplicationCommandType.Slash ? command.ToString()! : command.Name; await _cmdStatsSemaphore.WaitAsync(); - + try { await using var scope = _services.CreateAsyncScope(); @@ -268,7 +268,7 @@ private async Task HandleCommandExecutedAsync(IApplicationCommandInfo command, I if (result.IsSuccess) { _logger.LogInformation("Executed {Type} Command \"{Command}\" for {User} ({Id}) in {Context}", - command.CommandType, command, context.User, context.User.Id, context.Display()); + command.CommandType, commandName, context.User, context.User.Id, context.Display()); return; }