mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-11 04:12:29 +00:00
Make Dark the default theme
Light is burning my eyes
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
public enum Theme
|
||||
{
|
||||
Light,
|
||||
Dark
|
||||
Dark,
|
||||
Light
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace DiscordChatExporter
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
private static readonly DiscordApiService DiscordApiService = new DiscordApiService();
|
||||
private static readonly HtmlExportService HtmlExportService = new HtmlExportService();
|
||||
private static readonly DiscordApiService ApiService = new DiscordApiService();
|
||||
private static readonly HtmlExportService ExportService = new HtmlExportService();
|
||||
|
||||
private static Options GetOptions(string[] args)
|
||||
{
|
||||
@@ -51,12 +51,12 @@ namespace DiscordChatExporter
|
||||
|
||||
// Get messages
|
||||
Console.WriteLine("Getting messages...");
|
||||
var messages = await DiscordApiService.GetMessagesAsync(options.Token, options.ChannelId);
|
||||
var messages = await ApiService.GetMessagesAsync(options.Token, options.ChannelId);
|
||||
var chatLog = new ChatLog(options.ChannelId, messages);
|
||||
|
||||
// Export
|
||||
Console.WriteLine("Exporting messages...");
|
||||
HtmlExportService.Export($"{options.ChannelId}.html", chatLog, options.Theme);
|
||||
ExportService.Export($"{options.ChannelId}.html", chatLog, options.Theme);
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Discord Chat Log</title>
|
||||
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style id="theme">
|
||||
</style>
|
||||
|
||||
<style id="theme"></style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace DiscordChatExporter.Services
|
||||
{
|
||||
private HtmlDocument GetTemplate()
|
||||
{
|
||||
string templateName = "DiscordChatExporter.Resources.HtmlExportService.Template.html";
|
||||
string resourcePath = "DiscordChatExporter.Resources.HtmlExportService.Template.html";
|
||||
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var stream = assembly.GetManifestResourceStream(templateName);
|
||||
var stream = assembly.GetManifestResourceStream(resourcePath);
|
||||
if (stream == null)
|
||||
throw new MissingManifestResourceException("Could not find template resource");
|
||||
|
||||
@@ -31,12 +31,12 @@ namespace DiscordChatExporter.Services
|
||||
|
||||
private string GetStyle(Theme theme)
|
||||
{
|
||||
string styleName = $"DiscordChatExporter.Resources.HtmlExportService.{theme}Theme.css";
|
||||
string resourcePath = $"DiscordChatExporter.Resources.HtmlExportService.{theme}Theme.css";
|
||||
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var stream = assembly.GetManifestResourceStream(styleName);
|
||||
var stream = assembly.GetManifestResourceStream(resourcePath);
|
||||
if (stream == null)
|
||||
throw new MissingManifestResourceException("Could not find theme style resource");
|
||||
throw new MissingManifestResourceException("Could not find style resource");
|
||||
|
||||
using (stream)
|
||||
using (var reader = new StreamReader(stream))
|
||||
|
||||
Reference in New Issue
Block a user