Bot no longer exits when a plugin fails to load
This commit is contained in:
@@ -144,6 +144,8 @@ public class PluginLoader
|
|||||||
{
|
{
|
||||||
var types = asmb.GetTypes();
|
var types = asmb.GetTypes();
|
||||||
foreach (var type in types)
|
foreach (var type in types)
|
||||||
|
try
|
||||||
|
{
|
||||||
if (type.IsClass && typeof(DBEvent).IsAssignableFrom(type))
|
if (type.IsClass && typeof(DBEvent).IsAssignableFrom(type))
|
||||||
{
|
{
|
||||||
var instance = (DBEvent)Activator.CreateInstance(type);
|
var instance = (DBEvent)Activator.CreateInstance(type);
|
||||||
@@ -171,4 +173,11 @@ public class PluginLoader
|
|||||||
Config.Logger.Log($"[SLASH] Instance: {type.FullName} loaded !", LogLevel.INFO);
|
Config.Logger.Log($"[SLASH] Instance: {type.FullName} loaded !", LogLevel.INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//Console.WriteLine(ex.Message);
|
||||||
|
Config.Logger.Error(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user