mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Refactor
This commit is contained in:
parent
7eeea54ee9
commit
16ac87d9ce
22
DiscordChatExporter/Models/MessageGroup.cs
Normal file
22
DiscordChatExporter/Models/MessageGroup.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace DiscordChatExporter.Models
|
||||||
|
{
|
||||||
|
public class MessageGroup
|
||||||
|
{
|
||||||
|
public MessageGroup(User author, DateTime firstTimeStamp, IEnumerable<Message> messages)
|
||||||
|
{
|
||||||
|
Author = author;
|
||||||
|
FirstTimeStamp = firstTimeStamp;
|
||||||
|
Messages = messages.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public User Author { get; }
|
||||||
|
|
||||||
|
public DateTime FirstTimeStamp { get; }
|
||||||
|
|
||||||
|
public IReadOnlyList<Message> Messages { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
@ -11,22 +10,6 @@ namespace DiscordChatExporter.Services
|
||||||
{
|
{
|
||||||
public class ExportService
|
public class ExportService
|
||||||
{
|
{
|
||||||
private class MessageGroup
|
|
||||||
{
|
|
||||||
public User Author { get; }
|
|
||||||
|
|
||||||
public DateTime FirstTimeStamp { get; }
|
|
||||||
|
|
||||||
public IReadOnlyList<Message> Messages { get; }
|
|
||||||
|
|
||||||
public MessageGroup(User author, DateTime firstTimeStamp, IEnumerable<Message> messages)
|
|
||||||
{
|
|
||||||
Author = author;
|
|
||||||
FirstTimeStamp = firstTimeStamp;
|
|
||||||
Messages = messages.ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private HtmlDocument GetTemplate()
|
private HtmlDocument GetTemplate()
|
||||||
{
|
{
|
||||||
const string templateName = "DiscordChatExporter.Services.ExportTemplate.html";
|
const string templateName = "DiscordChatExporter.Services.ExportTemplate.html";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue