diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-05 06:28:52 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-05 06:28:52 +0200 |
commit | cf455ed8de20bbee011289223e7d8d5775dfd69e (patch) | |
tree | cbdfdbc207af64a105b4d21941a6f0e71ca65e9d /ExampleBots/MediaModeratorPoC/Program.cs | |
parent | Add start of Media Moderator PoC bot (diff) | |
download | LibMatrix-cf455ed8de20bbee011289223e7d8d5775dfd69e.tar.xz |
Media moderator PoC works, abstract command handling to library
Diffstat (limited to '')
-rw-r--r-- | ExampleBots/MediaModeratorPoC/Program.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ExampleBots/MediaModeratorPoC/Program.cs b/ExampleBots/MediaModeratorPoC/Program.cs index 1bc0c62..413d91d 100644 --- a/ExampleBots/MediaModeratorPoC/Program.cs +++ b/ExampleBots/MediaModeratorPoC/Program.cs @@ -1,9 +1,8 @@ // See https://aka.ms/new-console-template for more information -using ArcaneLibs; using LibMatrix.Services; +using LibMatrix.Utilities.Bot; using MediaModeratorPoC.Bot; -using MediaModeratorPoC.Bot.Interfaces; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -17,11 +16,9 @@ var host = Host.CreateDefaultBuilder(args).ConfigureServices((_, services) => { ) ); services.AddSingleton<MediaModBotConfiguration>(); + services.AddRoryLibMatrixServices(); - foreach (var commandClass in new ClassCollector<ICommand>().ResolveFromAllAccessibleAssemblies()) { - Console.WriteLine($"Adding command {commandClass.Name}"); - services.AddScoped(typeof(ICommand), commandClass); - } + services.AddBot(withCommands: true); services.AddHostedService<MediaModBot>(); }).UseConsoleLifetime().Build(); |