diff --git a/Samples/LoadRespondersFromAssembly/LoadRespondersFromAssembly.csproj b/Samples/LoadRespondersFromAssembly/LoadRespondersFromAssembly.csproj index f5b7d39a98..c742d19737 100644 --- a/Samples/LoadRespondersFromAssembly/LoadRespondersFromAssembly.csproj +++ b/Samples/LoadRespondersFromAssembly/LoadRespondersFromAssembly.csproj @@ -10,6 +10,7 @@ + diff --git a/Samples/LoadRespondersFromAssembly/Program.cs b/Samples/LoadRespondersFromAssembly/Program.cs index 27f9641c49..c94a52ad3a 100644 --- a/Samples/LoadRespondersFromAssembly/Program.cs +++ b/Samples/LoadRespondersFromAssembly/Program.cs @@ -5,13 +5,12 @@ // using System; -using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Remora.Discord.Gateway.Extensions; +using Remora.Discord.Extensions.Extensions; using Remora.Discord.Hosting.Extensions; namespace Remora.Discord.Samples.LoadRespondersFromAssembly; @@ -52,14 +51,7 @@ private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefau ( (_, services) => { - var responderTypes = typeof(Program).Assembly - .GetExportedTypes() - .Where(t => t.IsResponder()); - - foreach (var responderType in responderTypes) - { - services.AddResponder(responderType); - } + services.AddRespondersFromAssembly(typeof(Program).Assembly); } ) .ConfigureLogging