1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-29 02:29:55 +03:00

Add xmldocs.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-06-11 14:12:17 +05:00
parent 1cd309e498
commit e883e143eb
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
15 changed files with 271 additions and 54 deletions

View file

@ -7,6 +7,9 @@ using Remora.Results;
namespace Boyfriend.Commands;
/// <summary>
/// Handles error logging for slash command groups.
/// </summary>
public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent {
private readonly ILogger<ErrorLoggingPostExecutionEvent> _logger;
@ -14,6 +17,14 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent {
_logger = logger;
}
/// <summary>
/// Logs a warning using the injected <see cref="ILogger" /> if the <paramref name="commandResult" /> has not
/// succeeded.
/// </summary>
/// <param name="context">The context of the slash command. Unused.</param>
/// <param name="commandResult">The result whose success is checked.</param>
/// <param name="ct">The cancellation token for this operation. Unused.</param>
/// <returns>A result which has succeeded.</returns>
public Task<Result> AfterExecutionAsync(
ICommandContext context, IResult commandResult, CancellationToken ct = default) {
if (!commandResult.IsSuccess)