Fixed some null errors

This commit is contained in:
2024-04-09 20:40:18 +03:00
parent 0323c888b3
commit 123e8e90a1
5 changed files with 18 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
using Discord.WebSocket;
using PluginManager.Interfaces;
using PluginManager.Others;
using PluginManager.Updater.Plugins;
namespace PluginManager.Loaders;
@@ -21,9 +21,9 @@ public class PluginLoader
public EventLoaded? OnEventLoaded;
public SlashCommandLoaded? OnSlashCommandLoaded;
public static List<DBCommand>? Commands;
public static List<DBEvent>? Events;
public static List<DBSlashCommand>? SlashCommands;
public static List<DBCommand> Commands { get; private set; } = new List<DBCommand>();
public static List<DBEvent> Events { get; private set; } = new List<DBEvent>();
public static List<DBSlashCommand> SlashCommands { get; private set; } = new List<DBSlashCommand>();
public PluginLoader(DiscordSocketClient discordSocketClient)
{
@@ -32,10 +32,6 @@ public class PluginLoader
public async Task LoadPlugins()
{
Commands = new List<DBCommand>();
Events = new List<DBEvent>();
SlashCommands = new List<DBSlashCommand>();
Config.Logger.Log("Loading plugins...", typeof(PluginLoader));
var loader = new Loader(Config.AppSettings["PluginFolder"], "dll");