fixed some "error in command ran" console errors

This commit is contained in:
Master Kwoth 2016-05-03 05:55:05 +02:00
parent cb63a9b078
commit e10b19e533

View File

@ -209,10 +209,10 @@ namespace NadekoBot
commandsRan++; commandsRan++;
Classes.DbHandler.Instance.InsertData(new DataModels.Command Classes.DbHandler.Instance.InsertData(new DataModels.Command
{ {
ServerId = (long)e.Server.Id, ServerId = (long)(e.Server?.Id ?? 0),
ServerName = e.Server.Name, ServerName = e.Server?.Name ?? "--Direct Message--",
ChannelId = (long)e.Channel.Id, ChannelId = (long)e.Channel.Id,
ChannelName = e.Channel.Name, ChannelName = e.Channel.IsPrivate ? "--Direct Message" : e.Channel.Name,
UserId = (long)e.User.Id, UserId = (long)e.User.Id,
UserName = e.User.Name, UserName = e.User.Name,
CommandName = e.Command.Text, CommandName = e.Command.Text,