Skip to content

Commit

Permalink
Fix displayed command names in logs and database
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 committed May 20, 2022
1 parent 75ac278 commit 32fd445
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Services/InteractionHandlingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
Expand Down

0 comments on commit 32fd445

Please sign in to comment.