Removed the WebUI. Removed the Modules

This commit is contained in:
2024-10-30 23:10:04 +02:00
parent f8df0f0254
commit 9e8bfbbe16
2133 changed files with 120 additions and 15581 deletions

View File

@@ -22,7 +22,7 @@ public class InternalActionManager
if (this.Actions.ContainsKey(action.ActionName))
{
// This should never happen. If it does, log it and return
Application.Logger.Log($"Action {action.ActionName} already exists", this, LogType.Error);
Application.CurrentApplication.Logger.Log($"Action {action.ActionName} already exists", this, LogType.Error);
return;
}
@@ -50,7 +50,7 @@ public class InternalActionManager
{
if (!Actions.ContainsKey(actionName))
{
Application.Logger.Log($"Action {actionName} not found", this, LogType.Error);
Application.CurrentApplication.Logger.Log($"Action {actionName} not found", this, LogType.Error);
return false;
}
@@ -58,7 +58,7 @@ public class InternalActionManager
{
if (Actions[actionName].RunType == InternalActionRunType.OnStartup)
{
Application.Logger.Log($"Action {actionName} is not executable", this, LogType.Error);
Application.CurrentApplication.Logger.Log($"Action {actionName} is not executable", this, LogType.Error);
return false;
}
@@ -67,7 +67,7 @@ public class InternalActionManager
}
catch (Exception e)
{
Application.Logger.Log(e.Message, type: LogType.Error, sender: this);
Application.CurrentApplication.Logger.LogException(e, this);
return false;
}
}

View File

@@ -105,7 +105,7 @@ public static class ArchiveManager
}
catch (Exception ex)
{
Application.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error); // Write the error to a file
Application.CurrentApplication.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error); // Write the error to a file
await Task.Delay(100);
return await ReadFromPakAsync(fileName, archFile);
}
@@ -141,7 +141,7 @@ public static class ArchiveManager
}
catch (Exception ex)
{
Application.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error);
Application.CurrentApplication.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error);
}
currentZipFile++;
@@ -176,7 +176,7 @@ public static class ArchiveManager
}
catch (Exception ex)
{
Application.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error);
Application.CurrentApplication.Logger.Log(ex.Message, typeof(ArchiveManager), LogType.Error);
}
await Task.Delay(10);

View File

@@ -1,13 +0,0 @@
using System;
using DiscordBotCore.Interfaces.Modules;
namespace DiscordBotCore.Others.Exceptions;
public class ModuleMethodNotFound : Exception
{
private IModule _SearchedModule;
public ModuleMethodNotFound(IModule module, string methodName) : base($"Method not found {methodName} in module {module.Name}")
{
_SearchedModule = module;
}
}

View File

@@ -1,15 +0,0 @@
using System;
using DiscordBotCore.Interfaces.Modules;
namespace DiscordBotCore.Others.Exceptions;
public class ModuleNotFound : Exception
{
public ModuleNotFound(string moduleName) : base($"Module not found: {moduleName}")
{
}
public ModuleNotFound(ModuleType moduleType) : base($"No module with type {moduleType} found")
{
}
}

View File

@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DiscordBotCore.Others.Exceptions
{
internal class ModuleNotFoundException<T> : Exception
{
private Type _type = typeof(T);
public ModuleNotFoundException() : base($"No module loaded with this signature: {typeof(T)}")
{
}
}
}

View File

@@ -1,31 +0,0 @@
using System.Collections.Generic;
using DiscordBotCore.Interfaces.Modules;
using DiscordBotCore.Modules;
namespace DiscordBotCore.Others.Exceptions;
public class ModuleRequirement
{
private List<ModuleType> RequiredModulesWithType { get; }
private List<string> RequiredModulesWithName { get; }
public ModuleRequirement()
{
RequiredModulesWithType = new List<ModuleType>();
RequiredModulesWithName = new List<string>();
}
public void AddType (ModuleType moduleType)
{
RequiredModulesWithType.Add(moduleType);
}
public void AddName (string moduleName)
{
RequiredModulesWithName.Add(moduleName);
}
public bool RequireAny => RequiredModulesWithType.Count > 0 || RequiredModulesWithName.Count > 0;
public IList<ModuleType> RequiredModulesWithTypes => RequiredModulesWithType ;
public IList<string> RequiredModulesWithNames => RequiredModulesWithName;
}