From 5d291be907efece4968319c459e6a9ebebdd21e5 Mon Sep 17 00:00:00 2001 From: Quahu Date: Tue, 30 Jul 2024 14:46:41 +0200 Subject: [PATCH] Add conditional serializer replacement to TestBot --- src/Disqord.TestBot/Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Disqord.TestBot/Program.cs b/src/Disqord.TestBot/Program.cs index 409bdfd18..e4d51823f 100644 --- a/src/Disqord.TestBot/Program.cs +++ b/src/Disqord.TestBot/Program.cs @@ -10,6 +10,10 @@ using Serilog; using Serilog.Events; using Serilog.Sinks.SystemConsole.Themes; +#if NET8_0_OR_GREATER +using Microsoft.Extensions.DependencyInjection.Extensions; +using Disqord.Serialization.Json.System; +#endif namespace Disqord.TestBot { @@ -30,8 +34,9 @@ private static void Main(string[] args) }) .ConfigureServices(services => { +#if NET8_0_OR_GREATER services.Replace(ServiceDescriptor.Singleton()); - +#endif services.Configure(x => x.LogsPayloads = true); }) .UseDefaultServiceProvider(provider =>