new Quote command and bugfixes

This commit is contained in:
Runebaas 2017-09-28 18:55:57 +02:00
parent a4cbc03202
commit 0b680d7fb2
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
4 changed files with 176 additions and 9 deletions

View file

@ -15,11 +15,15 @@ namespace Geekbot.net.Lib
// this.botOwnerDmChannel = botOwnerDmChannel;
}
public void HandleCommandException(Exception e, ICommandContext Context)
public void HandleCommandException(Exception e, ICommandContext Context, string errorMessage = "")
{
var errorMsg =
$"Error Occured while executing \"{Context.Message.Content}\", executed by \"{Context.User.Username}\", complete message was \"{Context.Message}\"";
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...");
}
@ -27,6 +31,6 @@ namespace Geekbot.net.Lib
public interface IErrorHandler
{
void HandleCommandException(Exception e, ICommandContext Context);
void HandleCommandException(Exception e, ICommandContext Context, string errorMessage = "");
}
}