Skip to content

Commit

Permalink
Resolved warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BrammyS committed Sep 24, 2021
1 parent 84b2dc3 commit c72c87e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion samples/RoleManager/Pipelines/PerformancePipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<Result<IDiscordInteractionResponse>> HandleAsync(ISlashCommand

sw.Stop();

_logger.Log(sw.ElapsedMilliseconds > 500 ? LogLevel.Warning : LogLevel.Information, "Command {Name} ran for {Time}ms.", context.MethodName, sw.ElapsedMilliseconds.ToString());
_logger.Log(sw.ElapsedMilliseconds > 500 ? LogLevel.Warning : LogLevel.Information, "Command {Name} ran for {Time}ms", context.MethodName, sw.ElapsedMilliseconds.ToString());
return result;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public async Task<Result<IDiscordInteractionResponse>> ExecuteComponentInteracti
if (componentInfo.ComponentMethod.Invoke(instance, null) is not Task<Result<IDiscordInteractionResponse>> task)
{
var errorMessage = $"Failed to cast {componentInfo.ComponentMethod.Name} to Task<Result<IDiscordInteractionResponse>>";
// ReSharper disable once TemplateIsNotCompileTimeConstantProblem
_logger.LogWarning(errorMessage);
return Result<IDiscordInteractionResponse>.FromError(default, new ErrorResult(errorMessage));
}
Expand Down

0 comments on commit c72c87e

Please sign in to comment.