Add role self service commands
This commit is contained in:
parent
60fbe3d3fa
commit
2eca82e899
2 changed files with 128 additions and 9 deletions
|
@ -6,26 +6,23 @@ namespace Geekbot.net.Lib
|
|||
{
|
||||
public class ErrorHandler : IErrorHandler
|
||||
{
|
||||
private readonly ILogger logger;
|
||||
// private readonly IDMChannel botOwnerDmChannel;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public ErrorHandler(ILogger logger /*, IDMChannel botOwnerDmChannel*/)
|
||||
public ErrorHandler(ILogger logger)
|
||||
{
|
||||
this.logger = logger;
|
||||
// this.botOwnerDmChannel = botOwnerDmChannel;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void HandleCommandException(Exception e, ICommandContext Context, string errorMessage = "Something went wrong :confused:")
|
||||
{
|
||||
var errorMsg =
|
||||
$"Error Occured while executing \"{Context.Message.Content}\", executed by \"{Context.User.Username}\", complete message was \"{Context.Message}\"";
|
||||
logger.Error(e, errorMsg);
|
||||
$"Error Occured while executing \"{Context.Message.Content}\", executed by \"{Context.User.Username}\"";
|
||||
_logger.Error(e, errorMsg);
|
||||
if (!string.IsNullOrEmpty(errorMessage))
|
||||
{
|
||||
Context.Channel.SendMessageAsync(errorMessage);
|
||||
}
|
||||
// await botOwnerDmChannel.SendMessageAsync($"{errorMsg}```{e.StackTrace}```");
|
||||
// await Context.Channel.SendMessageAsync("Something went wrong...");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue