mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-23 22:43:57 +00:00
Refactor
This commit is contained in:
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";
|
||||||
|
|||||||
Reference in New Issue
Block a user