animal racing reposting fix

This commit is contained in:
Kwoth 2016-07-26 14:09:51 +02:00
parent 5db1214440
commit 0521a71fa8
2 changed files with 12 additions and 4 deletions

View File

@ -46,11 +46,20 @@ namespace NadekoBot
commandService.CommandExecuted += StatsCollector_RanCommand;
commandService.CommandFinished += CommandService_CommandFinished;
File.Create("errors.txt");
commandService.CommandErrored += (s, e) => File.AppendAllText("errors.txt", $@"Command: {e.Command}
commandService.CommandErrored += (s, e) =>
{
try
{
if (e.ErrorType == CommandErrorType.Exception)
File.AppendAllText("errors.txt", $@"Command: {e.Command}
{e.Exception}
-------------------------------------
");
}
catch {
Console.WriteLine("Command errored errorring");
}
};
Task.Run(StartCollecting);

View File

@ -194,9 +194,8 @@ namespace NadekoBot.Modules.Gambling.Commands
private void Client_MessageReceived(object sender, MessageEventArgs e)
{
if (e.Message.IsAuthor)
if (e.Message.IsAuthor || e.Channel.IsPrivate || e.Channel != raceChannel)
return;
Console.WriteLine("Message received " + messagesSinceGameStarted);
messagesSinceGameStarted++;
}