move legacy code to separate branch

This commit is contained in:
Marco Realacci 2025-01-17 21:06:51 +01:00
parent 68a30c8ee6
commit 11b4c48c3a
3528 changed files with 14477 additions and 53258 deletions

View file

@ -0,0 +1,12 @@
using Telegram.Bot;
using Telegram.Bot.Types;
namespace SoUnBot.ModuleLoader
{
public interface IModule
{
public string Cmd();
public string GetName();
public void ProcessUpdate(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken);
}
}

View file

@ -0,0 +1,18 @@
namespace SoUnBot.ModuleLoader
{
public class ModuleLoader
{
public Dictionary<string, IModule> Modules { get; private set; }
public ModuleLoader()
{
Modules = new Dictionary<string, IModule>();
}
public void LoadModule(IModule module)
{
if (Modules == null) Modules = new Dictionary<string, IModule>();
Modules.Add(module.Cmd(), module);
}
}
}