Browse Source

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
tags/2.0.1
Casino Boyale Christopher F 6 years ago
parent
commit
552f34c30e
1 changed files with 0 additions and 8 deletions
  1. +0
    -8
      samples/02_commands_framework/Services/CommandHandlingService.cs

+ 0
- 8
samples/02_commands_framework/Services/CommandHandlingService.cs View File

@@ -21,7 +21,6 @@ namespace _02_commands_framework.Services
_services = services;

_commands.CommandExecuted += CommandExecutedAsync;
_commands.Log += LogAsync;
_discord.MessageReceived += MessageReceivedAsync;
}

@@ -57,12 +56,5 @@ namespace _02_commands_framework.Services
// the command failed, let's notify the user that something happened.
await context.Channel.SendMessageAsync($"error: {result.ToString()}");
}

private Task LogAsync(LogMessage log)
{
Console.WriteLine(log.ToString());

return Task.CompletedTask;
}
}
}

Loading…
Cancel
Save