Reworked the plugin loader

This commit is contained in:
2025-04-10 19:13:41 +03:00
parent f19aafcec6
commit c548c6191d
28 changed files with 236 additions and 1715 deletions

View File

@@ -1,15 +1,27 @@
using Discord.WebSocket;
using DiscordBotCore.PluginCore;
using DiscordBotCore.PluginCore.Interfaces;
namespace DiscordBotCore.PluginManagement.Loading;
public interface IPluginLoader
{
List<IDbCommand> Commands { get; }
List<IDbEvent> Events { get; }
List<IDbSlashCommand> SlashCommands { get; }
Task LoadPlugins();
public IReadOnlyList<IDbCommand> Commands { get; }
public IReadOnlyList<IDbEvent> Events { get; }
public IReadOnlyList<IDbSlashCommand> SlashCommands { get; }
void SetClient(DiscordSocketClient client);
/// <summary>
/// Sets the Discord client for the plugin loader. This is used to initialize the slash commands and events.
/// </summary>
/// <param name="discordSocketClient">The socket client that represents the running Discord Bot</param>
public void SetDiscordClient(DiscordSocketClient discordSocketClient);
/// <summary>
/// Loads all the plugins that are installed.
/// </summary>
public Task LoadPlugins();
/// <summary>
/// Unload all plugins from the plugin manager.
/// </summary>
public void UnloadAllPlugins();
}