Use nullable

This commit is contained in:
Alexey Golub
2019-11-13 19:19:36 +02:00
parent 1bf9d9e2e2
commit e5a2852165
42 changed files with 195 additions and 196 deletions

View File

@@ -19,7 +19,7 @@ namespace DiscordChatExporter.Core.Models
public DateTimeOffset? EditedTimestamp { get; }
public string Content { get; }
public string? Content { get; }
public IReadOnlyList<Attachment> Attachments { get; }
@@ -32,7 +32,7 @@ namespace DiscordChatExporter.Core.Models
public bool IsPinned { get; }
public Message(string id, string channelId, MessageType type, User author, DateTimeOffset timestamp,
DateTimeOffset? editedTimestamp, string content, IReadOnlyList<Attachment> attachments,
DateTimeOffset? editedTimestamp, string? content, IReadOnlyList<Attachment> attachments,
IReadOnlyList<Embed> embeds, IReadOnlyList<Reaction> reactions, IReadOnlyList<User> mentionedUsers,
bool isPinned)
{
@@ -50,6 +50,6 @@ namespace DiscordChatExporter.Core.Models
IsPinned = isPinned;
}
public override string ToString() => Content;
public override string ToString() => Content ?? "<message without content>";
}
}