diff --git a/Geekbot.net/Handlers.cs b/Geekbot.net/Handlers.cs index 64b3a15..0e57d55 100644 --- a/Geekbot.net/Handlers.cs +++ b/Geekbot.net/Handlers.cs @@ -99,7 +99,7 @@ namespace Geekbot.net if (message == null) return; if (message.Channel.Name.StartsWith('@')) { - _logger.Information(LogSource.Message, $"[DM-Channel] {message.Content}", SimpleConextConverter.ConvertSocketMessage(message)); + _logger.Information(LogSource.Message, $"[DM-Channel] {message.Content}", SimpleConextConverter.ConvertSocketMessage(message, true)); return; } diff --git a/Geekbot.net/Lib/Logger/SimpleConextConverter.cs b/Geekbot.net/Lib/Logger/SimpleConextConverter.cs index 0845cc1..5659896 100644 --- a/Geekbot.net/Lib/Logger/SimpleConextConverter.cs +++ b/Geekbot.net/Lib/Logger/SimpleConextConverter.cs @@ -35,9 +35,9 @@ namespace Geekbot.net.Lib.Logger } }; } - public static MessageDto ConvertSocketMessage(SocketMessage message) + public static MessageDto ConvertSocketMessage(SocketMessage message, bool isPrivate = false) { - var channel = (SocketGuildChannel) message.Channel; + SocketGuildChannel channel = isPrivate ? null : (SocketGuildChannel) message.Channel; return new MessageDto { Message = new MessageDto.MessageContent