Skip to content

Commit 552f34c

Browse files
k-boylefoxbot
authored andcommitted
docs: Removed double hooking of CommandService log event (#1225)
* Removed double hooking of CommandService log event The log event is already hooked in Line 38 of program.cs * Removed redundant log method
1 parent cdf60d5 commit 552f34c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

samples/02_commands_framework/Services/CommandHandlingService.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public CommandHandlingService(IServiceProvider services)
2121
_services = services;
2222

2323
_commands.CommandExecuted += CommandExecutedAsync;
24-
_commands.Log += LogAsync;
2524
_discord.MessageReceived += MessageReceivedAsync;
2625
}
2726

@@ -57,12 +56,5 @@ public async Task CommandExecutedAsync(Optional<CommandInfo> command, ICommandCo
5756
// the command failed, let's notify the user that something happened.
5857
await context.Channel.SendMessageAsync($"error: {result.ToString()}");
5958
}
60-
61-
private Task LogAsync(LogMessage log)
62-
{
63-
Console.WriteLine(log.ToString());
64-
65-
return Task.CompletedTask;
66-
}
6759
}
6860
}

0 commit comments

Comments
 (0)