about summary refs log tree commit diff
path: root/ExampleBots/MediaModeratorPoC/Program.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-05 06:28:52 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-05 06:28:52 +0200
commitcf455ed8de20bbee011289223e7d8d5775dfd69e (patch)
treecbdfdbc207af64a105b4d21941a6f0e71ca65e9d /ExampleBots/MediaModeratorPoC/Program.cs
parentAdd start of Media Moderator PoC bot (diff)
downloadLibMatrix-cf455ed8de20bbee011289223e7d8d5775dfd69e.tar.xz
Media moderator PoC works, abstract command handling to library
Diffstat (limited to 'ExampleBots/MediaModeratorPoC/Program.cs')
-rw-r--r--ExampleBots/MediaModeratorPoC/Program.cs9
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();