Switch from DateTime to DateTimeOffset

This commit is contained in:
Alexey Golub
2019-04-11 01:20:52 +03:00
parent 4bfb2ec7fd
commit 6d9bc3625f
20 changed files with 122 additions and 79 deletions

View File

@@ -9,21 +9,21 @@ namespace DiscordChatExporter.Core.Models
public Channel Channel { get; }
public DateTime? From { get; }
public DateTimeOffset? After { get; }
public DateTime? To { get; }
public DateTimeOffset? Before { get; }
public IReadOnlyList<Message> Messages { get; }
public Mentionables Mentionables { get; }
public ChatLog(Guild guild, Channel channel, DateTime? from, DateTime? to,
public ChatLog(Guild guild, Channel channel, DateTimeOffset? after, DateTimeOffset? before,
IReadOnlyList<Message> messages, Mentionables mentionables)
{
Guild = guild;
Channel = channel;
From = from;
To = to;
After = after;
Before = before;
Messages = messages;
Mentionables = mentionables;
}

View File

@@ -12,7 +12,7 @@ namespace DiscordChatExporter.Core.Models
public string Url { get; }
public DateTime? Timestamp { get; }
public DateTimeOffset? Timestamp { get; }
public Color Color { get; }
@@ -28,7 +28,7 @@ namespace DiscordChatExporter.Core.Models
public EmbedFooter Footer { get; }
public Embed(string title, string url, DateTime? timestamp, Color color, EmbedAuthor author, string description,
public Embed(string title, string url, DateTimeOffset? timestamp, Color color, EmbedAuthor author, string description,
IReadOnlyList<EmbedField> fields, EmbedImage thumbnail, EmbedImage image, EmbedFooter footer)
{
Title = title;

View File

@@ -15,9 +15,9 @@ namespace DiscordChatExporter.Core.Models
public User Author { get; }
public DateTime Timestamp { get; }
public DateTimeOffset Timestamp { get; }
public DateTime? EditedTimestamp { get; }
public DateTimeOffset? EditedTimestamp { get; }
public string Content { get; }
@@ -29,8 +29,8 @@ namespace DiscordChatExporter.Core.Models
public IReadOnlyList<User> MentionedUsers { get; }
public Message(string id, string channelId, MessageType type, User author, DateTime timestamp,
DateTime? editedTimestamp, string content, IReadOnlyList<Attachment> attachments,
public Message(string id, string channelId, MessageType type, User author, DateTimeOffset timestamp,
DateTimeOffset? editedTimestamp, string content, IReadOnlyList<Attachment> attachments,
IReadOnlyList<Embed> embeds, IReadOnlyList<Reaction> reactions, IReadOnlyList<User> mentionedUsers)
{
Id = id;