From 4e3deb409ca4d3f8f6f3f69714510e75d005466a Mon Sep 17 00:00:00 2001
From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Date: Fri, 29 Dec 2023 00:08:16 +0200
Subject: [PATCH] Update NuGet packages
---
.../DiscordChatExporter.Cli.Tests.csproj | 6 +-
.../Specs/DateRangeSpecs.cs | 27 ++----
.../Commands/Base/DiscordCommandBase.cs | 22 ++---
.../Commands/Base/ExportCommandBase.cs | 88 +++++++------------
.../Commands/ExportAllCommand.cs | 24 ++---
.../Commands/GetChannelsCommand.cs | 20 ++---
.../Commands/GetDirectChannelsCommand.cs | 6 +-
.../Commands/GuideCommand.cs | 36 ++++----
.../DiscordChatExporter.Cli.csproj | 4 +-
.../Discord/Data/Message.cs | 3 +-
.../Discord/DiscordClient.cs | 16 ++--
.../DiscordChatExporter.Core.csproj | 4 +-
.../Exporting/ExportAssetDownloader.cs | 4 +-
.../Exporting/ExportRequest.cs | 7 +-
.../Filtering/ContainsMessageFilter.cs | 18 ++--
.../Filtering/MentionsMessageFilter.cs | 16 ++--
.../Filtering/ReactionMessageFilter.cs | 14 ++-
.../Exporting/JsonMessageWriter.cs | 14 ++-
.../Exporting/MessageExporter.cs | 8 +-
.../DiscordChatExporter.Gui.csproj | 4 +-
.../Services/SettingsService.cs | 3 +-
.../Components/DashboardViewModel.cs | 3 +-
22 files changed, 144 insertions(+), 203 deletions(-)
diff --git a/DiscordChatExporter.Cli.Tests/DiscordChatExporter.Cli.Tests.csproj b/DiscordChatExporter.Cli.Tests/DiscordChatExporter.Cli.Tests.csproj
index 6cb2abbc..dff62425 100644
--- a/DiscordChatExporter.Cli.Tests/DiscordChatExporter.Cli.Tests.csproj
+++ b/DiscordChatExporter.Cli.Tests/DiscordChatExporter.Cli.Tests.csproj
@@ -13,7 +13,7 @@
-
+
@@ -22,8 +22,8 @@
-
-
+
+
diff --git a/DiscordChatExporter.Cli.Tests/Specs/DateRangeSpecs.cs b/DiscordChatExporter.Cli.Tests/Specs/DateRangeSpecs.cs
index 57bd73e5..af9fcb8d 100644
--- a/DiscordChatExporter.Cli.Tests/Specs/DateRangeSpecs.cs
+++ b/DiscordChatExporter.Cli.Tests/Specs/DateRangeSpecs.cs
@@ -54,15 +54,12 @@ public class DateRangeSpecs
new DateTimeOffset(2021, 09, 08, 14, 26, 35, TimeSpan.Zero)
},
o =>
- {
- return o.Using(
+ o.Using(
ctx =>
- ctx.Subject
- .Should()
+ ctx.Subject.Should()
.BeCloseTo(ctx.Expectation, TimeSpan.FromSeconds(1))
)
- .WhenTypeIs();
- }
+ .WhenTypeIs()
);
}
@@ -102,15 +99,12 @@ public class DateRangeSpecs
new DateTimeOffset(2021, 07, 19, 17, 23, 58, TimeSpan.Zero)
},
o =>
- {
- return o.Using(
+ o.Using(
ctx =>
- ctx.Subject
- .Should()
+ ctx.Subject.Should()
.BeCloseTo(ctx.Expectation, TimeSpan.FromSeconds(1))
)
- .WhenTypeIs();
- }
+ .WhenTypeIs()
);
}
@@ -153,15 +147,12 @@ public class DateRangeSpecs
new DateTimeOffset(2021, 07, 24, 14, 52, 40, TimeSpan.Zero)
},
o =>
- {
- return o.Using(
+ o.Using(
ctx =>
- ctx.Subject
- .Should()
+ ctx.Subject.Should()
.BeCloseTo(ctx.Expectation, TimeSpan.FromSeconds(1))
)
- .WhenTypeIs();
- }
+ .WhenTypeIs()
);
}
}
diff --git a/DiscordChatExporter.Cli/Commands/Base/DiscordCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/DiscordCommandBase.cs
index bf259c39..424587b1 100644
--- a/DiscordChatExporter.Cli/Commands/Base/DiscordCommandBase.cs
+++ b/DiscordChatExporter.Cli/Commands/Base/DiscordCommandBase.cs
@@ -37,13 +37,11 @@ public abstract class DiscordCommandBase : ICommand
{
using (console.WithForegroundColor(ConsoleColor.DarkYellow))
{
- console
- .Error
- .WriteLine(
- "Warning: Option --bot is deprecated and should not be used. "
- + "The type of the provided token is now inferred automatically. "
- + "Please update your workflows as this option may be completely removed in a future version."
- );
+ console.Error.WriteLine(
+ "Warning: The --bot option is deprecated and should not be used. "
+ + "The token type is now inferred automatically. "
+ + "Please update your workflows as this option may be completely removed in a future version."
+ );
}
}
#pragma warning restore CS0618
@@ -51,12 +49,10 @@ public abstract class DiscordCommandBase : ICommand
// Note about interactivity
if (console.IsOutputRedirected)
{
- console
- .Output
- .WriteLine(
- "Note: Output streams are redirected, rich console interactions are disabled. "
- + "If you are running this command in Docker, consider allocating a pseudo-terminal for better user experience (docker run -it ...)."
- );
+ console.Output.WriteLine(
+ "Note: Output streams are redirected, rich console interactions are disabled. "
+ + "If you are running this command in Docker, consider allocating a pseudo-terminal for better user experience (docker run -it ...)."
+ );
}
return default;
diff --git a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs
index b96d245c..09c2a60c 100644
--- a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs
+++ b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs
@@ -244,11 +244,9 @@ public abstract class ExportCommandBase : DiscordCommandBase
// Print the result
using (console.WithForegroundColor(ConsoleColor.White))
{
- await console
- .Output
- .WriteLineAsync(
- $"Successfully exported {channels.Count - errorsByChannel.Count} channel(s)."
- );
+ await console.Output.WriteLineAsync(
+ $"Successfully exported {channels.Count - errorsByChannel.Count} channel(s)."
+ );
}
// Print errors
@@ -258,11 +256,9 @@ public abstract class ExportCommandBase : DiscordCommandBase
using (console.WithForegroundColor(ConsoleColor.Red))
{
- await console
- .Error
- .WriteLineAsync(
- $"Failed to export {errorsByChannel.Count} the following channel(s):"
- );
+ await console.Error.WriteLineAsync(
+ $"Failed to export {errorsByChannel.Count} the following channel(s):"
+ );
}
foreach (var (channel, error) in errorsByChannel)
@@ -324,51 +320,33 @@ public abstract class ExportCommandBase : DiscordCommandBase
// Support Ukraine callout
if (!IsUkraineSupportMessageDisabled)
{
- console
- .Output
- .WriteLine(
- "┌────────────────────────────────────────────────────────────────────┐"
- );
- console
- .Output
- .WriteLine(
- "│ Thank you for supporting Ukraine <3 │"
- );
- console
- .Output
- .WriteLine(
- "│ │"
- );
- console
- .Output
- .WriteLine(
- "│ As Russia wages a genocidal war against my country, │"
- );
- console
- .Output
- .WriteLine(
- "│ I'm grateful to everyone who continues to │"
- );
- console
- .Output
- .WriteLine(
- "│ stand with Ukraine in our fight for freedom. │"
- );
- console
- .Output
- .WriteLine(
- "│ │"
- );
- console
- .Output
- .WriteLine(
- "│ Learn more: https://tyrrrz.me/ukraine │"
- );
- console
- .Output
- .WriteLine(
- "└────────────────────────────────────────────────────────────────────┘"
- );
+ console.Output.WriteLine(
+ "┌────────────────────────────────────────────────────────────────────┐"
+ );
+ console.Output.WriteLine(
+ "│ Thank you for supporting Ukraine <3 │"
+ );
+ console.Output.WriteLine(
+ "│ │"
+ );
+ console.Output.WriteLine(
+ "│ As Russia wages a genocidal war against my country, │"
+ );
+ console.Output.WriteLine(
+ "│ I'm grateful to everyone who continues to │"
+ );
+ console.Output.WriteLine(
+ "│ stand with Ukraine in our fight for freedom. │"
+ );
+ console.Output.WriteLine(
+ "│ │"
+ );
+ console.Output.WriteLine(
+ "│ Learn more: https://tyrrrz.me/ukraine │"
+ );
+ console.Output.WriteLine(
+ "└────────────────────────────────────────────────────────────────────┘"
+ );
console.Output.WriteLine("");
}
diff --git a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs
index 77cdcbeb..1ec5e289 100644
--- a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs
+++ b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs
@@ -54,9 +54,9 @@ public class ExportAllCommand : ExportCommandBase
await foreach (var guild in Discord.GetUserGuildsAsync(cancellationToken))
{
// Regular channels
- await console
- .Output
- .WriteLineAsync($"Fetching channels for server '{guild.Name}'...");
+ await console.Output.WriteLineAsync(
+ $"Fetching channels for server '{guild.Name}'..."
+ );
var fetchedChannelsCount = 0;
await console
@@ -94,9 +94,9 @@ public class ExportAllCommand : ExportCommandBase
// Threads
if (ThreadInclusionMode != ThreadInclusionMode.None)
{
- await console
- .Output
- .WriteLineAsync($"Fetching threads for server '{guild.Name}'...");
+ await console.Output.WriteLineAsync(
+ $"Fetching threads for server '{guild.Name}'..."
+ );
var fetchedThreadsCount = 0;
await console
@@ -126,9 +126,9 @@ public class ExportAllCommand : ExportCommandBase
}
);
- await console
- .Output
- .WriteLineAsync($"Fetched {fetchedThreadsCount} thread(s).");
+ await console.Output.WriteLineAsync(
+ $"Fetched {fetchedThreadsCount} thread(s)."
+ );
}
}
}
@@ -180,9 +180,9 @@ public class ExportAllCommand : ExportCommandBase
using (console.WithForegroundColor(ConsoleColor.Red))
{
- await console
- .Error
- .WriteLineAsync("Failed to access the following channel(s):");
+ await console.Error.WriteLineAsync(
+ "Failed to access the following channel(s):"
+ );
}
foreach (var dumpChannel in inaccessibleChannels)
diff --git a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs
index 6d62945e..a430cac1 100644
--- a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs
+++ b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs
@@ -64,9 +64,9 @@ public class GetChannelsCommand : DiscordCommandBase
foreach (var channel in channels)
{
// Channel ID
- await console
- .Output
- .WriteAsync(channel.Id.ToString().PadRight(channelIdMaxLength, ' '));
+ await console.Output.WriteAsync(
+ channel.Id.ToString().PadRight(channelIdMaxLength, ' ')
+ );
// Separator
using (console.WithForegroundColor(ConsoleColor.DarkGray))
@@ -88,11 +88,9 @@ public class GetChannelsCommand : DiscordCommandBase
await console.Output.WriteAsync(" * ");
// Thread ID
- await console
- .Output
- .WriteAsync(
- channelThread.Id.ToString().PadRight(channelThreadIdMaxLength, ' ')
- );
+ await console.Output.WriteAsync(
+ channelThread.Id.ToString().PadRight(channelThreadIdMaxLength, ' ')
+ );
// Separator
using (console.WithForegroundColor(ConsoleColor.DarkGray))
@@ -108,9 +106,9 @@ public class GetChannelsCommand : DiscordCommandBase
// Thread status
using (console.WithForegroundColor(ConsoleColor.White))
- await console
- .Output
- .WriteLineAsync(channelThread.IsArchived ? "Archived" : "Active");
+ await console.Output.WriteLineAsync(
+ channelThread.IsArchived ? "Archived" : "Active"
+ );
}
}
}
diff --git a/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs
index a72368db..daedf096 100644
--- a/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs
+++ b/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs
@@ -33,9 +33,9 @@ public class GetDirectChannelsCommand : DiscordCommandBase
foreach (var channel in channels)
{
// Channel ID
- await console
- .Output
- .WriteAsync(channel.Id.ToString().PadRight(channelIdMaxLength, ' '));
+ await console.Output.WriteAsync(
+ channel.Id.ToString().PadRight(channelIdMaxLength, ' ')
+ );
// Separator
using (console.WithForegroundColor(ConsoleColor.DarkGray))
diff --git a/DiscordChatExporter.Cli/Commands/GuideCommand.cs b/DiscordChatExporter.Cli/Commands/GuideCommand.cs
index ed9c814d..c643cb11 100644
--- a/DiscordChatExporter.Cli/Commands/GuideCommand.cs
+++ b/DiscordChatExporter.Cli/Commands/GuideCommand.cs
@@ -15,11 +15,9 @@ public class GuideCommand : ICommand
using (console.WithForegroundColor(ConsoleColor.White))
console.Output.WriteLine("To get the token for your personal account:");
- console
- .Output
- .WriteLine(
- " * Automating user accounts is technically against TOS — USE AT YOUR OWN RISK!"
- );
+ console.Output.WriteLine(
+ " * Automating user accounts is technically against TOS — USE AT YOUR OWN RISK!"
+ );
console.Output.WriteLine(" 1. Open Discord in your web browser and login");
console.Output.WriteLine(" 2. Open any server or direct message channel");
console.Output.WriteLine(" 3. Press Ctrl+Shift+I to show developer tools");
@@ -40,11 +38,9 @@ public class GuideCommand : ICommand
console.Output.WriteLine(" 2. Open your application's settings");
console.Output.WriteLine(" 3. Navigate to the Bot section on the left");
console.Output.WriteLine(" 4. Under Token click Copy");
- console
- .Output
- .WriteLine(
- " * Your bot needs to have the Message Content Intent enabled to read messages"
- );
+ console.Output.WriteLine(
+ " * Your bot needs to have the Message Content Intent enabled to read messages"
+ );
console.Output.WriteLine();
// Guild or channel ID
@@ -55,26 +51,24 @@ public class GuideCommand : ICommand
console.Output.WriteLine(" 2. Open Settings");
console.Output.WriteLine(" 3. Go to Advanced section");
console.Output.WriteLine(" 4. Enable Developer Mode");
- console
- .Output
- .WriteLine(
- " 5. Right-click on the desired server or channel and click Copy Server ID or Copy Channel ID"
- );
+ console.Output.WriteLine(
+ " 5. Right-click on the desired server or channel and click Copy Server ID or Copy Channel ID"
+ );
console.Output.WriteLine();
// Docs link
using (console.WithForegroundColor(ConsoleColor.White))
{
- console
- .Output
- .WriteLine("If you have questions or issues, please refer to the documentation:");
+ console.Output.WriteLine(
+ "If you have questions or issues, please refer to the documentation:"
+ );
}
using (console.WithForegroundColor(ConsoleColor.DarkCyan))
{
- console
- .Output
- .WriteLine("https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs");
+ console.Output.WriteLine(
+ "https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs"
+ );
}
return default;
diff --git a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj
index 88c2d524..4d012b99 100644
--- a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj
+++ b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj
@@ -7,9 +7,9 @@
-
+
-
+
diff --git a/DiscordChatExporter.Core/Discord/Data/Message.cs b/DiscordChatExporter.Core/Discord/Data/Message.cs
index b02dd98a..f7616473 100644
--- a/DiscordChatExporter.Core/Discord/Data/Message.cs
+++ b/DiscordChatExporter.Core/Discord/Data/Message.cs
@@ -100,8 +100,7 @@ public partial record Message
{
// Concatenate all images into one embed
var images = embed
- .Images
- .Concat(trailingEmbeds.SelectMany(e => e.Images))
+ .Images.Concat(trailingEmbeds.SelectMany(e => e.Images))
.ToArray();
normalizedEmbeds.Add(embed with { Images = images });
diff --git a/DiscordChatExporter.Core/Discord/DiscordClient.cs b/DiscordChatExporter.Core/Discord/DiscordClient.cs
index 5ad9862f..a3f14cb1 100644
--- a/DiscordChatExporter.Core/Discord/DiscordClient.cs
+++ b/DiscordChatExporter.Core/Discord/DiscordClient.cs
@@ -36,12 +36,10 @@ public class DiscordClient(string token)
// Don't validate because the token can have special characters
// https://github.com/Tyrrrz/DiscordChatExporter/issues/828
- request
- .Headers
- .TryAddWithoutValidation(
- "Authorization",
- tokenKind == TokenKind.Bot ? $"Bot {token}" : token
- );
+ request.Headers.TryAddWithoutValidation(
+ "Authorization",
+ tokenKind == TokenKind.Bot ? $"Bot {token}" : token
+ );
var response = await Http.Client.SendAsync(
request,
@@ -57,13 +55,11 @@ public class DiscordClient(string token)
// rate limits and that's just way too much effort.
// https://discord.com/developers/docs/topics/rate-limits
var remainingRequestCount = response
- .Headers
- .TryGetValue("X-RateLimit-Remaining")
+ .Headers.TryGetValue("X-RateLimit-Remaining")
?.Pipe(s => int.Parse(s, CultureInfo.InvariantCulture));
var resetAfterDelay = response
- .Headers
- .TryGetValue("X-RateLimit-Reset-After")
+ .Headers.TryGetValue("X-RateLimit-Reset-After")
?.Pipe(s => double.Parse(s, CultureInfo.InvariantCulture))
.Pipe(TimeSpan.FromSeconds);
diff --git a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj
index 560ad382..709517fa 100644
--- a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj
+++ b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj
@@ -2,14 +2,14 @@
-
+
-
+
\ No newline at end of file
diff --git a/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs b/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
index 3f37923f..fe957ed2 100644
--- a/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
+++ b/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
@@ -57,9 +57,7 @@ internal partial class ExportAssetDownloader(string workingDirPath, bool reuse)
try
{
var lastModified = response
- .Content
- .Headers
- .TryGetValue("Last-Modified")
+ .Content.Headers.TryGetValue("Last-Modified")
?.Pipe(
s =>
DateTimeOffset.TryParse(
diff --git a/DiscordChatExporter.Core/Exporting/ExportRequest.cs b/DiscordChatExporter.Core/Exporting/ExportRequest.cs
index fbd22de5..8ddab729 100644
--- a/DiscordChatExporter.Core/Exporting/ExportRequest.cs
+++ b/DiscordChatExporter.Core/Exporting/ExportRequest.cs
@@ -182,9 +182,10 @@ public partial class ExportRequest
=> before?.ToDate().ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
?? "",
"%d"
- => DateTimeOffset
- .Now
- .ToString("yyyy-MM-dd", CultureInfo.InvariantCulture),
+ => DateTimeOffset.Now.ToString(
+ "yyyy-MM-dd",
+ CultureInfo.InvariantCulture
+ ),
"%%" => "%",
_ => m.Value
diff --git a/DiscordChatExporter.Core/Exporting/Filtering/ContainsMessageFilter.cs b/DiscordChatExporter.Core/Exporting/Filtering/ContainsMessageFilter.cs
index ccf83a92..2c3c8efb 100644
--- a/DiscordChatExporter.Core/Exporting/Filtering/ContainsMessageFilter.cs
+++ b/DiscordChatExporter.Core/Exporting/Filtering/ContainsMessageFilter.cs
@@ -22,14 +22,12 @@ internal class ContainsMessageFilter(string text) : MessageFilter
public override bool IsMatch(Message message) =>
IsMatch(message.Content)
- || message
- .Embeds
- .Any(
- e =>
- IsMatch(e.Title)
- || IsMatch(e.Author?.Name)
- || IsMatch(e.Description)
- || IsMatch(e.Footer?.Text)
- || e.Fields.Any(f => IsMatch(f.Name) || IsMatch(f.Value))
- );
+ || message.Embeds.Any(
+ e =>
+ IsMatch(e.Title)
+ || IsMatch(e.Author?.Name)
+ || IsMatch(e.Description)
+ || IsMatch(e.Footer?.Text)
+ || e.Fields.Any(f => IsMatch(f.Name) || IsMatch(f.Value))
+ );
}
diff --git a/DiscordChatExporter.Core/Exporting/Filtering/MentionsMessageFilter.cs b/DiscordChatExporter.Core/Exporting/Filtering/MentionsMessageFilter.cs
index 21d2a4d0..ae98b14d 100644
--- a/DiscordChatExporter.Core/Exporting/Filtering/MentionsMessageFilter.cs
+++ b/DiscordChatExporter.Core/Exporting/Filtering/MentionsMessageFilter.cs
@@ -7,13 +7,11 @@ namespace DiscordChatExporter.Core.Exporting.Filtering;
internal class MentionsMessageFilter(string value) : MessageFilter
{
public override bool IsMatch(Message message) =>
- message
- .MentionedUsers
- .Any(
- user =>
- string.Equals(value, user.Name, StringComparison.OrdinalIgnoreCase)
- || string.Equals(value, user.DisplayName, StringComparison.OrdinalIgnoreCase)
- || string.Equals(value, user.FullName, StringComparison.OrdinalIgnoreCase)
- || string.Equals(value, user.Id.ToString(), StringComparison.OrdinalIgnoreCase)
- );
+ message.MentionedUsers.Any(
+ user =>
+ string.Equals(value, user.Name, StringComparison.OrdinalIgnoreCase)
+ || string.Equals(value, user.DisplayName, StringComparison.OrdinalIgnoreCase)
+ || string.Equals(value, user.FullName, StringComparison.OrdinalIgnoreCase)
+ || string.Equals(value, user.Id.ToString(), StringComparison.OrdinalIgnoreCase)
+ );
}
diff --git a/DiscordChatExporter.Core/Exporting/Filtering/ReactionMessageFilter.cs b/DiscordChatExporter.Core/Exporting/Filtering/ReactionMessageFilter.cs
index e4f490b3..eb7bb576 100644
--- a/DiscordChatExporter.Core/Exporting/Filtering/ReactionMessageFilter.cs
+++ b/DiscordChatExporter.Core/Exporting/Filtering/ReactionMessageFilter.cs
@@ -7,12 +7,10 @@ namespace DiscordChatExporter.Core.Exporting.Filtering;
internal class ReactionMessageFilter(string value) : MessageFilter
{
public override bool IsMatch(Message message) =>
- message
- .Reactions
- .Any(
- r =>
- string.Equals(value, r.Emoji.Id?.ToString(), StringComparison.OrdinalIgnoreCase)
- || string.Equals(value, r.Emoji.Name, StringComparison.OrdinalIgnoreCase)
- || string.Equals(value, r.Emoji.Code, StringComparison.OrdinalIgnoreCase)
- );
+ message.Reactions.Any(
+ r =>
+ string.Equals(value, r.Emoji.Id?.ToString(), StringComparison.OrdinalIgnoreCase)
+ || string.Equals(value, r.Emoji.Name, StringComparison.OrdinalIgnoreCase)
+ || string.Equals(value, r.Emoji.Code, StringComparison.OrdinalIgnoreCase)
+ );
}
diff --git a/DiscordChatExporter.Core/Exporting/JsonMessageWriter.cs b/DiscordChatExporter.Core/Exporting/JsonMessageWriter.cs
index 8aa33ddc..2f8a4440 100644
--- a/DiscordChatExporter.Core/Exporting/JsonMessageWriter.cs
+++ b/DiscordChatExporter.Core/Exporting/JsonMessageWriter.cs
@@ -446,14 +446,12 @@ internal class JsonMessageWriter(Stream stream, ExportContext context)
_writer.WriteStartArray("users");
await foreach (
- var user in Context
- .Discord
- .GetMessageReactionsAsync(
- Context.Request.Channel.Id,
- message.Id,
- reaction.Emoji,
- cancellationToken
- )
+ var user in Context.Discord.GetMessageReactionsAsync(
+ Context.Request.Channel.Id,
+ message.Id,
+ reaction.Emoji,
+ cancellationToken
+ )
)
{
_writer.WriteStartObject();
diff --git a/DiscordChatExporter.Core/Exporting/MessageExporter.cs b/DiscordChatExporter.Core/Exporting/MessageExporter.cs
index 87dae680..24b1e622 100644
--- a/DiscordChatExporter.Core/Exporting/MessageExporter.cs
+++ b/DiscordChatExporter.Core/Exporting/MessageExporter.cs
@@ -37,10 +37,10 @@ internal partial class MessageExporter(ExportContext context) : IAsyncDisposable
// Ensure that the partition limit has not been reached
if (
_writer is not null
- && context
- .Request
- .PartitionLimit
- .IsReached(_writer.MessagesWritten, _writer.BytesWritten)
+ && context.Request.PartitionLimit.IsReached(
+ _writer.MessagesWritten,
+ _writer.BytesWritten
+ )
)
{
await ResetWriterAsync(cancellationToken);
diff --git a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
index 0bce895d..fad90a59 100644
--- a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
+++ b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
@@ -14,9 +14,9 @@
-
+
-
+
diff --git a/DiscordChatExporter.Gui/Services/SettingsService.cs b/DiscordChatExporter.Gui/Services/SettingsService.cs
index 7353d0f4..2d11f1c0 100644
--- a/DiscordChatExporter.Gui/Services/SettingsService.cs
+++ b/DiscordChatExporter.Gui/Services/SettingsService.cs
@@ -65,8 +65,7 @@ public partial class SettingsService
try
{
return Registry
- .CurrentUser
- .OpenSubKey(
+ .CurrentUser.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
false
)
diff --git a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
index bd893ef9..cf075d3f 100644
--- a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
@@ -235,8 +235,7 @@ public class DashboardViewModel : PropertyChangedBase
var exporter = new ChannelExporter(_discord);
var channelProgressPairs = dialog
- .Channels!
- .Select(c => new { Channel = c, Progress = _progressMuxer.CreateInput() })
+ .Channels!.Select(c => new { Channel = c, Progress = _progressMuxer.CreateInput() })
.ToArray();
var successfulExportCount = 0;