Cleaned up the Console bot. Added PluginNotFoundException

This commit is contained in:
2024-05-12 21:47:59 +03:00
parent 17147d920d
commit 152e09f4af
10 changed files with 72 additions and 57 deletions

View File

@@ -0,0 +1,12 @@
using System;
namespace DiscordBotCore.Others.Exceptions
{
internal class PluginNotFoundException : Exception
{
public PluginNotFoundException(string pluginName) : base($"Plugin {pluginName} was not found") { }
public PluginNotFoundException(string pluginName, string url, string branch) :
base ($"Plugin {pluginName} was not found on {url} (branch: {branch}") { }
}
}

View File

@@ -15,7 +15,7 @@ public static class Functions
/// The location for the Resources folder
/// String: ./Data/Resources/
/// </summary>
public static readonly string dataFolder = @"./Data/Resources/";
public static string dataFolder => Application.CurrentApplication.DataFolder;
public static Color RandomColor
{

View File

@@ -8,7 +8,7 @@ namespace DiscordBotCore.Others;
public class SettingsDictionary<TKey, TValue>
{
private string _File { get; }
private IDictionary<TKey, TValue> _Dictionary;
protected IDictionary<TKey, TValue> _Dictionary;
public SettingsDictionary(string file)
{
@@ -84,4 +84,6 @@ public class SettingsDictionary<TKey, TValue>
}
set => _Dictionary[key] = value;
}
}