mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-05 23:52:35 +02:00
move legacy code to separate branch
This commit is contained in:
parent
68a30c8ee6
commit
11b4c48c3a
3528 changed files with 14477 additions and 53258 deletions
12
Bot/ModuleLoader/IModule.cs
Normal file
12
Bot/ModuleLoader/IModule.cs
Normal 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);
|
||||
}
|
||||
}
|
18
Bot/ModuleLoader/ModuleLoader.cs
Normal file
18
Bot/ModuleLoader/ModuleLoader.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue