Removed the WebUI. Removed the Modules
@@ -35,7 +35,7 @@ namespace DiscordBot.Bot.Actions
|
||||
{
|
||||
if(args.Length < 1)
|
||||
{
|
||||
Console.WriteLine("Incorrect number of arguments !");
|
||||
Application.CurrentApplication.Logger.Log("Incorrect number of arguments !", LogType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,12 +44,17 @@ namespace DiscordBot.Bot.Actions
|
||||
|
||||
if(!File.Exists(path))
|
||||
{
|
||||
Console.WriteLine("The file does not exist !!");
|
||||
Application.CurrentApplication.Logger.Log("The file does not exist !!", LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (args[^1] is null)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("The plugin name is invalid", LogType.Error);
|
||||
}
|
||||
|
||||
PluginInfo pluginInfo = new PluginInfo(args[^1], new(1, 0, 0), [], false, true, args.Contains("-enabled"));
|
||||
Application.Logger.Log("Adding plugin: " + args[^1]);
|
||||
Application.CurrentApplication.Logger.Log("Adding plugin: " + args[^1]);
|
||||
await Application.CurrentApplication.PluginManager.AppendPluginToDatabase(pluginInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Exit: ICommandAction
|
||||
{
|
||||
if (args is null || args.Length == 0)
|
||||
{
|
||||
Application.Logger.Log("Exiting...", this, LogType.Warning);
|
||||
Application.CurrentApplication.Logger.Log("Exiting...", this, LogType.Warning);
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class Exit: ICommandAction
|
||||
|
||||
case "-f":
|
||||
case "force":
|
||||
Application.Logger.Log("Exiting (FORCE)...", this, LogType.Warning);
|
||||
Application.CurrentApplication.Logger.Log("Exiting (FORCE)...", this, LogType.Warning);
|
||||
Environment.Exit(0);
|
||||
break;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ internal static class PluginMethods
|
||||
|
||||
}catch(Exception ex)
|
||||
{
|
||||
Application.Logger.LogException(ex, typeof(PluginMethods), false);
|
||||
Application.CurrentApplication.Logger.LogException(ex, typeof(PluginMethods), false);
|
||||
} finally
|
||||
{
|
||||
await Application.CurrentApplication.InternalActionManager.Initialize();
|
||||
@@ -219,22 +219,22 @@ internal static class PluginMethods
|
||||
|
||||
loader.OnCommandLoaded += (command) =>
|
||||
{
|
||||
Application.Logger.Log($"Command {command.Command} loaded successfully", LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log($"Command {command.Command} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnEventLoaded += (eEvent) =>
|
||||
{
|
||||
Application.Logger.Log($"Event {eEvent.Name} loaded successfully",LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log($"Event {eEvent.Name} loaded successfully",LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnActionLoaded += (action) =>
|
||||
{
|
||||
Application.Logger.Log($"Action {action.ActionName} loaded successfully", LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log($"Action {action.ActionName} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnSlashCommandLoaded += (slashCommand) =>
|
||||
{
|
||||
Application.Logger.Log($"Slash Command {slashCommand.Name} loaded successfully", LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log($"Slash Command {slashCommand.Name} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
await loader.LoadPlugins();
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DiscordBotCore;
|
||||
using DiscordBotCore.Interfaces;
|
||||
using DiscordBotCore.Others;
|
||||
using DiscordBotCore.Others.Actions;
|
||||
|
||||
namespace DiscordBot.Bot.Actions
|
||||
{
|
||||
internal class Module : ICommandAction
|
||||
{
|
||||
public string ActionName => "module";
|
||||
|
||||
public string Description => "Access module commands";
|
||||
|
||||
public string Usage => "module <command>";
|
||||
|
||||
public IEnumerable<InternalActionOption> ListOfOptions => [
|
||||
new InternalActionOption("list", "List all loaded modules")
|
||||
];
|
||||
|
||||
public InternalActionRunType RunType => InternalActionRunType.OnCall;
|
||||
|
||||
public bool RequireOtherThread => false;
|
||||
|
||||
public Task Execute(string[] args)
|
||||
{
|
||||
string command = args?[0];
|
||||
switch(command)
|
||||
{
|
||||
case "list":
|
||||
ListLoadedModules();
|
||||
break;
|
||||
default:
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void ListLoadedModules()
|
||||
{
|
||||
var modules = Application.CurrentApplication.ModuleManager.GetLocalModules();
|
||||
foreach (var module in modules)
|
||||
{
|
||||
Application.Logger.Log("Module: " + module.ModuleName, this, LogType.Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class Plugin: ICommandAction
|
||||
case "load":
|
||||
if (pluginsLoaded)
|
||||
{
|
||||
Application.Logger.Log("Plugins already loaded", this, LogType.Warning);
|
||||
Application.CurrentApplication.Logger.Log("Plugins already loaded", this, LogType.Warning);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public static class Installer
|
||||
{
|
||||
if(!ulong.TryParse(id, out ulong sID))
|
||||
{
|
||||
Application.Logger.Log($"Invalid server ID {id}", LogType.Warning);
|
||||
Application.CurrentApplication.Logger.Log($"Invalid server ID {id}", LogType.Warning);
|
||||
}
|
||||
|
||||
serverIds.Add(sID);
|
||||
@@ -58,7 +58,7 @@ public static class Installer
|
||||
|
||||
if(!serverIds.Any())
|
||||
{
|
||||
Application.Logger.Log($"No valid server id provided", LogType.Critical);
|
||||
Application.CurrentApplication.Logger.Log($"No valid server id provided", LogType.Critical);
|
||||
Environment.Exit(-20);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,6 @@ public static class Installer
|
||||
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
|
||||
Application.Logger.Log("Config Saved", typeof(Installer));
|
||||
Application.CurrentApplication.Logger.Log("Config Saved", typeof(Installer));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ public class Program
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[yellow]Running on version: {Assembly.GetExecutingAssembly().GetName().Version}[/]");
|
||||
AnsiConsole.MarkupLine("[yellow]Git SethBot: https://github.com/andreitdr/SethDiscordBot [/]");
|
||||
AnsiConsole.MarkupLine("[yellow]Git Plugins: https://github.com/andreitdr/SethPlugins [/]");
|
||||
|
||||
AnsiConsole.MarkupLine("[yellow]Remember to close the bot using the shutdown command ([/][red]exit[/][yellow]) or some settings won't be saved[/]");
|
||||
AnsiConsole.MarkupLine($"[yellow]Running on [/][magenta]{(OperatingSystem.IsWindows() ? "Windows" : "Linux")}[/]");
|
||||
@@ -70,7 +69,7 @@ public class Program
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.Logger.Log(ex.ToString(), typeof(Program), LogType.Critical);
|
||||
Application.CurrentApplication.Logger.Log(ex.ToString(), typeof(Program), LogType.Critical);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +79,7 @@ public class Program
|
||||
/// <param name="args">The startup arguments</param>
|
||||
private static async Task LoadComponents(string[] args)
|
||||
{
|
||||
await Application.CreateApplication(default);
|
||||
await Application.CreateApplication();
|
||||
|
||||
AppUpdater updater = new AppUpdater();
|
||||
Update? update = await updater.PrepareUpdate();
|
||||
@@ -113,7 +112,7 @@ public class Program
|
||||
AnsiConsole.MarkupLine(messageAsString);
|
||||
}
|
||||
|
||||
Application.Logger.SetOutFunction(LogMessageFunction);
|
||||
Application.CurrentApplication.Logger.SetOutFunction(LogMessageFunction);
|
||||
|
||||
|
||||
if (!Application.CurrentApplication.ApplicationEnvironmentVariables.ContainsKey("ServerID") ||
|
||||
|
||||
@@ -4,18 +4,14 @@ using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using DiscordBotCore.Bot;
|
||||
using DiscordBotCore.Interfaces.Logger;
|
||||
using DiscordBotCore.Online;
|
||||
using DiscordBotCore.Online.Helpers;
|
||||
|
||||
using DiscordBotCore.Others;
|
||||
using DiscordBotCore.Others.Actions;
|
||||
using DiscordBotCore.Others.Exceptions;
|
||||
using DiscordBotCore.Others.Settings;
|
||||
|
||||
using DiscordBotCore.Modules;
|
||||
using DiscordBotCore.Plugin;
|
||||
|
||||
using DiscordBotCore.Interfaces.Modules;
|
||||
using DiscordBotCore.Logging;
|
||||
using DiscordBotCore.Repository;
|
||||
|
||||
namespace DiscordBotCore
|
||||
@@ -39,7 +35,8 @@ namespace DiscordBotCore
|
||||
private static readonly string _PluginsFolder = "./Data/Plugins";
|
||||
private static readonly string _LogsFolder = "./Data/Logs";
|
||||
|
||||
public ModuleManager ModuleManager = null!;
|
||||
private static readonly string _LogFormat = "{ThrowTime} {SenderName} {Message}";
|
||||
|
||||
public DiscordBotApplication DiscordBotClient { get; set; } = null!;
|
||||
|
||||
public List<ulong> ServerIDs => ApplicationEnvironmentVariables.GetList("ServerID", new List<ulong>());
|
||||
@@ -47,12 +44,12 @@ namespace DiscordBotCore
|
||||
public CustomSettingsDictionary ApplicationEnvironmentVariables { get; private set; } = null!;
|
||||
public InternalActionManager InternalActionManager { get; private set; } = null!;
|
||||
public PluginManager PluginManager { get; private set; } = null!;
|
||||
public ILogger Logger { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Create the application. This method is used to initialize the application. Can not initialize multiple times.
|
||||
/// </summary>
|
||||
/// <param name="moduleRequirementsSolver">A function that will be called when a module is required to be installed. If set to default, will use the built in method(console)</param>
|
||||
public static async Task CreateApplication(Func<ModuleRequirement, Task>? moduleRequirementsSolver)
|
||||
public static async Task CreateApplication()
|
||||
{
|
||||
if (!await OnlineFunctions.IsInternetConnected())
|
||||
{
|
||||
@@ -62,7 +59,7 @@ namespace DiscordBotCore
|
||||
|
||||
if (CurrentApplication is not null)
|
||||
{
|
||||
Logger.Log("Application is already initialized. Reinitialization is not allowed", LogType.Error);
|
||||
CurrentApplication.Logger.Log("Application is already initialized. Reinitialization is not allowed", LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,20 +74,10 @@ namespace DiscordBotCore
|
||||
CurrentApplication.ApplicationEnvironmentVariables.Add("PluginFolder", _PluginsFolder);
|
||||
CurrentApplication.ApplicationEnvironmentVariables.Add("ResourceFolder", _ResourcesFolder);
|
||||
CurrentApplication.ApplicationEnvironmentVariables.Add("LogsFolder", _LogsFolder);
|
||||
|
||||
CurrentApplication.ModuleManager = new ModuleManager(ModuleRepository.SolveRepo());
|
||||
await CurrentApplication.ModuleManager.LoadModules();
|
||||
var requirements = await CurrentApplication.ModuleManager.CheckRequiredModules();
|
||||
if(requirements.RequireAny)
|
||||
{
|
||||
moduleRequirementsSolver ??= requirement => CurrentApplication.ModuleManager.SolveRequirementIssues(requirement);
|
||||
await moduleRequirementsSolver(requirements);
|
||||
|
||||
await CurrentApplication.ModuleManager.LoadModules();
|
||||
}
|
||||
|
||||
Logger._LoggerModule = CurrentApplication.ModuleManager.GetLoadedModuleWithTag(ModuleType.Logger);
|
||||
if (!File.Exists(_PluginsDatabaseFile))
|
||||
CurrentApplication.Logger = new Logger(_LogsFolder, _LogFormat);
|
||||
|
||||
if (!File.Exists(_PluginsDatabaseFile))
|
||||
{
|
||||
List<PluginInfo> plugins = new();
|
||||
await JsonManager.SaveToJsonFile(_PluginsDatabaseFile, plugins);
|
||||
@@ -106,128 +93,6 @@ namespace DiscordBotCore
|
||||
|
||||
IsRunning = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes an external method from a module.
|
||||
/// </summary>
|
||||
/// <param name="moduleName">The module name</param>
|
||||
/// <param name="methodFriendlyName">The method to be invoked. This should be in the documentation of the module</param>
|
||||
/// <param name="parameters">The parameters of the invoked method</param>
|
||||
public static async Task InvokeMethod(string moduleName, string methodFriendlyName, params object[] parameters)
|
||||
{
|
||||
var module = CurrentApplication.ModuleManager.GetModule(moduleName);
|
||||
var methodName = module.Value.MethodMapping[methodFriendlyName];
|
||||
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(module.Value, methodName, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes an external method from a module and returns the result.
|
||||
/// </summary>
|
||||
/// <param name="moduleName">The module name</param>
|
||||
/// <param name="methodFriendlyName">The method to be invoked. This should be in the documentation of the module</param>
|
||||
/// <param name="parameters">The parameters for the invoked function</param>
|
||||
/// <returns>An object that has the expected result, otherwise method returns null</returns>
|
||||
public static async Task<object?> InvokeMethodWithReturnValue(string moduleName, string methodFriendlyName, params object[] parameters)
|
||||
{
|
||||
var module = CurrentApplication.ModuleManager.GetModule(moduleName).Value;
|
||||
var methodName = module.MethodMapping[methodFriendlyName];
|
||||
|
||||
var response = await CurrentApplication.ModuleManager.InvokeMethodWithReturnValue(module, methodName, parameters);
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A special class that is designed to log messages. It is a wrapper around the Logger module
|
||||
/// The logger module is required to have this specific methods:
|
||||
/// <br/><br/>
|
||||
/// BaseLogException(Exception ex, object sender, bool fullStackTrace)<br/>
|
||||
/// BaseLog(string message)<br/>
|
||||
/// LogWithTypeAndFormat(string message, LogType logType, string format)<br/>
|
||||
/// LogWithType(string message, LogType logType)<br/>
|
||||
/// LogWithSender(string message, object sender)<br/>
|
||||
/// LogWithTypeAndSender(string message, object sender, LogType type)<br/>
|
||||
/// SetPrintFunction(Action[in string] outFunction)<br/><br/>
|
||||
///
|
||||
/// If your custom logger does not have the methods from above, the application might crash.
|
||||
/// Please refer to the official logger documentation for more information.
|
||||
/// </summary>
|
||||
public static class Logger
|
||||
{
|
||||
internal static LoadedModule _LoggerModule = null!; // initial is null, will be populated when the application will load all modules !!
|
||||
|
||||
/// <summary>
|
||||
/// Logs an exception with the default log type.
|
||||
/// </summary>
|
||||
/// <param name="ex">The exception to be logged</param>
|
||||
/// <param name="sender">The type that sent this error</param>
|
||||
/// <param name="fullStackTrace">True if it should keep all stack, otherwise false</param>
|
||||
public static async void LogException(Exception ex, object sender, bool fullStackTrace = false)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["BaseLogException"], [ex, sender, fullStackTrace]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message with the default log type.
|
||||
/// </summary>
|
||||
/// <param name="message">The message in a normal string format</param>
|
||||
public static async void Log(string message)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["BaseLog"], [message]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message with a specific type and format.
|
||||
/// </summary>
|
||||
/// <param name="message">The message in a normal string format</param>
|
||||
/// <param name="logType">The log type</param>
|
||||
/// <param name="format">The format in which the log should be written. Please refer to the documentation for placeholders</param>
|
||||
public static async void Log(string message, LogType logType, string format)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["LogWithTypeAndFormat"], [message, logType, format]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message with a specific type.
|
||||
/// </summary>
|
||||
/// <param name="message">The message in a normal string format</param>
|
||||
/// <param name="logType">The log type</param>
|
||||
public static async void Log(string message, LogType logType)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["LogWithType"], [message, logType]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message with a specific sender.
|
||||
/// </summary>
|
||||
/// <param name="message">The message in a normal string format.</param>
|
||||
/// <param name="sender">The sender of the log message.</param>
|
||||
public static async void Log(string message, object sender)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["LogWithSender"], [message, sender]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message with a specific type and sender
|
||||
/// </summary>
|
||||
/// <param name="message">The message in a normal string format</param>
|
||||
/// <param name="sender">The sender of the log message. It should be a type or a string</param>
|
||||
/// <param name="type">The log type</param>
|
||||
public static async void Log(string message, object sender, LogType type)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["LogWithTypeAndSender"], [message, sender, type]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the output function. This function is called whenever a new log message was created.
|
||||
/// </summary>
|
||||
/// <param name="outFunction">The function to be used to process the log message.</param>
|
||||
public static async void SetOutFunction(Action<string, LogType> outFunction)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["SetPrintFunction"], [outFunction]);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetResourceFullPath(string path)
|
||||
{
|
||||
var result = Path.Combine(_ResourcesFolder, path);
|
||||
|
||||
@@ -56,7 +56,7 @@ internal class CommandHandler
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.Logger.LogException(ex, this);
|
||||
Application.CurrentApplication.Logger.LogException(ex, this);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
@@ -140,7 +140,7 @@ internal class CommandHandler
|
||||
|
||||
DbCommandExecutingArguments cmd = new(context, cleanMessage, split[0], argsClean);
|
||||
|
||||
Application.Logger.Log(
|
||||
Application.CurrentApplication.Logger.Log(
|
||||
$"User ({context.User.Username}) from Guild \"{context.Guild.Name}\" executed command \"{cmd.CleanContent}\"",
|
||||
this,
|
||||
LogType.Info
|
||||
@@ -152,7 +152,7 @@ internal class CommandHandler
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.Logger.LogException(ex, this);
|
||||
Application.CurrentApplication.Logger.LogException(ex, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class DiscordBotApplication
|
||||
if (arg.Message.Contains("401"))
|
||||
{
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Remove("token");
|
||||
Application.Logger.Log("The token is invalid.", this, LogType.Critical);
|
||||
Application.CurrentApplication.Logger.Log("The token is invalid.", this, LogType.Critical);
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class DiscordBotApplication
|
||||
|
||||
private Task LoggedIn()
|
||||
{
|
||||
Application.Logger.Log("Successfully Logged In", this);
|
||||
Application.CurrentApplication.Logger.Log("Successfully Logged In", this);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -138,12 +138,12 @@ public class DiscordBotApplication
|
||||
{
|
||||
case LogSeverity.Error:
|
||||
case LogSeverity.Critical:
|
||||
Application.Logger.Log(message.Message, this, LogType.Error);
|
||||
Application.CurrentApplication.Logger.Log(message.Message, this, LogType.Error);
|
||||
break;
|
||||
|
||||
case LogSeverity.Info:
|
||||
case LogSeverity.Debug:
|
||||
Application.Logger.Log(message.Message, this, LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log(message.Message, this, LogType.Info);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using DiscordBotCore.Others;
|
||||
using System;
|
||||
using DiscordBotCore.Others;
|
||||
|
||||
namespace LoggerModule;
|
||||
namespace DiscordBotCore.Interfaces.Logger;
|
||||
|
||||
public interface ILogMessage
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
using DiscordBotCore.Others;
|
||||
using System;
|
||||
using DiscordBotCore.Others;
|
||||
|
||||
namespace LoggerModule;
|
||||
namespace DiscordBotCore.Interfaces.Logger;
|
||||
|
||||
public interface ILogger
|
||||
{
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DiscordBotCore.Interfaces.Modules
|
||||
{
|
||||
|
||||
public enum ModuleType
|
||||
{
|
||||
Logger,
|
||||
Compatibility,
|
||||
Other
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define a module.
|
||||
/// </summary>
|
||||
public interface IModule
|
||||
{
|
||||
public ModuleType ModuleType { get; }
|
||||
public string Name { get; }
|
||||
public IDictionary<string, string> MethodMapping { get; }
|
||||
|
||||
public Task Initialize();
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using DiscordBotCore.Interfaces.Modules;
|
||||
using System.Reflection;
|
||||
using DiscordBotCore.Modules;
|
||||
|
||||
namespace DiscordBotCore.Loaders
|
||||
{
|
||||
internal class ModuleLoader
|
||||
{
|
||||
private readonly List<ModuleData> _ModuleData;
|
||||
|
||||
public ModuleLoader(List<ModuleData> moduleFolder)
|
||||
{
|
||||
_ModuleData = moduleFolder;
|
||||
}
|
||||
|
||||
public Task LoadFileModules()
|
||||
{
|
||||
var paths = _ModuleData.Select(module => module.ModulePath);
|
||||
|
||||
foreach (var file in paths)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assembly.LoadFrom(file);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"Error loading module {file}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<List<IModule>> LoadModules()
|
||||
{
|
||||
var moduleType = typeof(IModule);
|
||||
var moduleTypes = AppDomain.CurrentDomain.GetAssemblies()
|
||||
.SelectMany(s => s.GetTypes())
|
||||
.Where(p => moduleType.IsAssignableFrom(p) && !p.IsInterface);
|
||||
|
||||
var modules = new List<IModule>();
|
||||
foreach (var module in moduleTypes)
|
||||
{
|
||||
try
|
||||
{
|
||||
var instance = (IModule?)Activator.CreateInstance(module);
|
||||
if (instance is null)
|
||||
{
|
||||
Console.WriteLine($"Error loading module {module.Name}: Could not create instance");
|
||||
continue;
|
||||
}
|
||||
|
||||
modules.Add(instance);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"Error loading module {module.Name}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult(modules);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public sealed class PluginLoader
|
||||
SlashCommands.Clear();
|
||||
Actions.Clear();
|
||||
|
||||
Application.Logger.Log("Loading plugins...", this);
|
||||
Application.CurrentApplication.Logger.Log("Loading plugins...", this);
|
||||
|
||||
var loader = new Loader();
|
||||
|
||||
@@ -51,7 +51,7 @@ public sealed class PluginLoader
|
||||
|
||||
private void FileLoadedException(FileLoaderResult result)
|
||||
{
|
||||
Application.Logger.Log(result.ErrorMessage, this, LogType.Error);
|
||||
Application.CurrentApplication.Logger.Log(result.ErrorMessage, this, LogType.Error);
|
||||
}
|
||||
|
||||
private async void InitializeCommand(ICommandAction action)
|
||||
@@ -99,7 +99,7 @@ public sealed class PluginLoader
|
||||
|
||||
private void HandleError(Exception exception)
|
||||
{
|
||||
Application.Logger.Log(exception.Message, this, LogType.Error);
|
||||
Application.CurrentApplication.Logger.Log(exception.Message, this, LogType.Error);
|
||||
}
|
||||
|
||||
private void OnPluginLoaded(PluginLoaderResult result)
|
||||
|
||||
@@ -28,8 +28,8 @@ internal static class PluginLoaderExtensions
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Application.Logger.Log($"Error starting event {dbEvent.Name}: {e.Message}", typeof(PluginLoader), LogType.Error);
|
||||
Application.Logger.LogException(e, typeof(PluginLoader));
|
||||
Application.CurrentApplication.Logger.Log($"Error starting event {dbEvent.Name}: {e.Message}", typeof(PluginLoader), LogType.Error);
|
||||
Application.CurrentApplication.Logger.LogException(e, typeof(PluginLoader));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ internal static class PluginLoaderExtensions
|
||||
SocketGuild? guild = Application.CurrentApplication.DiscordBotClient.Client.GetGuild(guildId);
|
||||
if (guild is null)
|
||||
{
|
||||
Application.Logger.Log("Failed to get guild with ID " + guildId, typeof(PluginLoader), LogType.Error);
|
||||
Application.CurrentApplication.Logger.Log("Failed to get guild with ID " + guildId, typeof(PluginLoader), LogType.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using DiscordBotCore.Others;
|
||||
using System;
|
||||
using DiscordBotCore.Interfaces.Logger;
|
||||
using DiscordBotCore.Others;
|
||||
|
||||
namespace LoggerModule
|
||||
namespace DiscordBotCore.Logging
|
||||
{
|
||||
internal sealed class LogMessage : ILogMessage
|
||||
{
|
||||
@@ -1,21 +1,31 @@
|
||||
using DiscordBotCore.Others;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using DiscordBotCore.Interfaces.Logger;
|
||||
using DiscordBotCore.Others;
|
||||
|
||||
namespace LoggerModule;
|
||||
namespace DiscordBotCore.Logging;
|
||||
|
||||
public sealed class Logger : ILogger
|
||||
{
|
||||
private readonly FileStream _LogFileStream;
|
||||
|
||||
public List<string> LogMessageProperties = typeof(ILogMessage).GetProperties().Select(p => p.Name).ToList();
|
||||
private Action<string, LogType>? _OutFunction;
|
||||
private readonly List<string> _LogMessageProperties = typeof(ILogMessage).GetProperties().Select(p => p.Name).ToList();
|
||||
private Action<string, LogType>? _OutFunction;
|
||||
public string LogMessageFormat { get ; set; }
|
||||
|
||||
public Logger(string logFolder, string logMessageFormat, Action<string,LogType>? outFunction = null)
|
||||
public Logger(string logFolder, string logMessageFormat, Action<string, LogType>? outFunction = null)
|
||||
{
|
||||
this.LogMessageFormat = logMessageFormat;
|
||||
this._OutFunction = outFunction;
|
||||
var logFile = logFolder + DateTime.Now.ToString("yyyy-MM-dd") + ".log";
|
||||
_LogFileStream = File.Open(logFile, FileMode.Append, FileAccess.Write, FileShare.Read);
|
||||
this._OutFunction = outFunction ?? DefaultLogFunction;
|
||||
}
|
||||
|
||||
private void DefaultLogFunction(string message, LogType logType)
|
||||
{
|
||||
Console.WriteLine($"[{logType}] {message}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -26,7 +36,7 @@ public sealed class Logger : ILogger
|
||||
private string GenerateLogMessage(ILogMessage message)
|
||||
{
|
||||
string messageAsString = new string(LogMessageFormat);
|
||||
foreach (var prop in LogMessageProperties)
|
||||
foreach (var prop in _LogMessageProperties)
|
||||
{
|
||||
Type messageType = typeof(ILogMessage);
|
||||
messageAsString = messageAsString.Replace("{" + prop + "}", messageType?.GetProperty(prop)?.GetValue(message)?.ToString());
|
||||
@@ -49,7 +59,7 @@ public sealed class Logger : ILogger
|
||||
private string GenerateLogMessage(ILogMessage message, string customFormat)
|
||||
{
|
||||
string messageAsString = customFormat;
|
||||
foreach (var prop in LogMessageProperties)
|
||||
foreach (var prop in _LogMessageProperties)
|
||||
{
|
||||
Type messageType = typeof(ILogMessage);
|
||||
messageAsString = messageAsString.Replace("{" + prop + "}", messageType?.GetProperty(prop)?.GetValue(message)?.ToString());
|
||||
@@ -1,17 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscordBotCore.Modules;
|
||||
|
||||
public class ModuleData
|
||||
{
|
||||
public string ModuleName { get; set; }
|
||||
public string ModulePath { get; set; }
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
public ModuleData(string moduleName, string modulePath, bool isEnabled)
|
||||
{
|
||||
ModuleName = moduleName;
|
||||
ModulePath = modulePath;
|
||||
IsEnabled = isEnabled;
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using DiscordBotCore.Interfaces.Modules;
|
||||
using DiscordBotCore.Loaders;
|
||||
using DiscordBotCore.Online;
|
||||
using DiscordBotCore.Others;
|
||||
using DiscordBotCore.Others.Exceptions;
|
||||
using DiscordBotCore.Repository;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DiscordBotCore.Modules
|
||||
{
|
||||
|
||||
public class LoadedModule
|
||||
{
|
||||
public IModule Value { get; init; }
|
||||
public ModuleData ModuleData { get; init; }
|
||||
public LoadedModule(IModule module, ModuleData moduleData)
|
||||
{
|
||||
Value = module;
|
||||
ModuleData = moduleData;
|
||||
}
|
||||
}
|
||||
|
||||
public class ModuleManager
|
||||
{
|
||||
private static readonly string _BaseModuleFolder = "./Data/Modules";
|
||||
private static readonly string _BaseModuleConfig = "./Data/Resources/modules.json";
|
||||
|
||||
// private const string _ModuleDatabase = "https://raw.githubusercontent.com/andreitdr/SethPlugins/tests/modules.json";
|
||||
private ModuleRepository _ModuleRepository;
|
||||
private List<LoadedModule> Modules { get; }
|
||||
|
||||
public IEnumerable<ModuleData> GetLocalModules()
|
||||
{
|
||||
return Modules.Select(module => module.ModuleData);
|
||||
}
|
||||
|
||||
internal ModuleManager(ModuleRepository moduleRepository)
|
||||
{
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Get<string>("ModuleFolder", _BaseModuleFolder);
|
||||
Modules = new();
|
||||
_ModuleRepository = moduleRepository;
|
||||
}
|
||||
|
||||
public async Task<ModuleOnlineData?> ServerGetModuleWithName(string moduleName)
|
||||
{
|
||||
var modules = await ServerGetAllModules();
|
||||
return modules.FirstOrDefault(module => module?.ModuleName == moduleName, null);
|
||||
}
|
||||
|
||||
public async Task<List<ModuleOnlineData>> ServerGetAllModules(ModuleType? moduleTypeFilter = null)
|
||||
{
|
||||
var jsonDatabaseRemote = await _ModuleRepository.JsonGetAllModules();
|
||||
|
||||
var modules = await JsonManager.ConvertFromJson<List<ModuleOnlineData>>(jsonDatabaseRemote);
|
||||
|
||||
if(moduleTypeFilter is not null)
|
||||
modules = modules.FindAll(m => m.ModuleType == moduleTypeFilter);
|
||||
|
||||
return modules;
|
||||
}
|
||||
|
||||
public async Task InstallModule(string moduleName, IProgress<float> progressToWrite)
|
||||
{
|
||||
string? moduleFolder = Application.CurrentApplication.ApplicationEnvironmentVariables.Get<string>("ModuleFolder");
|
||||
|
||||
if(moduleFolder is null)
|
||||
throw new DirectoryNotFoundException("Module folder not found"); // Should never happen
|
||||
|
||||
Directory.CreateDirectory(moduleFolder);
|
||||
|
||||
List<ModuleOnlineData> modules = await ServerGetAllModules();
|
||||
|
||||
string url = modules.Find(m => m.ModuleName == moduleName)?.ModuleDownloadUrl ?? string.Empty;
|
||||
|
||||
if(string.IsNullOrEmpty(url))
|
||||
return;
|
||||
|
||||
string filePath = moduleFolder + "/" + moduleName + ".dll";
|
||||
await ServerCom.DownloadFileAsync(url, filePath, progressToWrite);
|
||||
|
||||
ModuleData localModuleData = new ModuleData(moduleName, filePath, true);
|
||||
|
||||
await AddModuleToDatabase(localModuleData);
|
||||
}
|
||||
|
||||
public LoadedModule GetModule(string moduleName)
|
||||
{
|
||||
var result = Modules.FirstOrDefault(module => module.ModuleData.ModuleName == moduleName);
|
||||
|
||||
if(result is null)
|
||||
{
|
||||
throw new ModuleNotFound(moduleName);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public LoadedModule GetLoadedModuleWithTag(ModuleType moduleType)
|
||||
{
|
||||
var result = Modules.FirstOrDefault(module => module.Value.ModuleType == moduleType);
|
||||
|
||||
if(result is null)
|
||||
{
|
||||
throw new ModuleNotFound(moduleType);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task AddModuleToDatabase(ModuleData moduleData)
|
||||
{
|
||||
string moduleConfigPath = Application.CurrentApplication.ApplicationEnvironmentVariables
|
||||
.Get<string>("ModuleConfig", _BaseModuleConfig);
|
||||
|
||||
List<ModuleData>? listOfModuleData = null;
|
||||
if (File.Exists(moduleConfigPath))
|
||||
{
|
||||
string moduleConfigFile = await File.ReadAllTextAsync(moduleConfigPath);
|
||||
listOfModuleData = JsonConvert.DeserializeObject<List<ModuleData>>(moduleConfigFile);
|
||||
}
|
||||
|
||||
|
||||
if (listOfModuleData is null)
|
||||
{
|
||||
listOfModuleData = new List<ModuleData>();
|
||||
}
|
||||
|
||||
listOfModuleData.Add(moduleData);
|
||||
|
||||
string json = JsonConvert.SerializeObject(listOfModuleData, Formatting.Indented);
|
||||
await File.WriteAllTextAsync(moduleConfigPath, json);
|
||||
}
|
||||
|
||||
internal Task<ModuleRequirement> CheckRequiredModules()
|
||||
{
|
||||
ModuleRequirement moduleRequirement = new ModuleRequirement();
|
||||
if (Modules.All(module => module.Value.ModuleType != ModuleType.Logger))
|
||||
{
|
||||
moduleRequirement.AddType(ModuleType.Logger);
|
||||
}
|
||||
|
||||
return Task.FromResult(moduleRequirement);
|
||||
}
|
||||
|
||||
internal async Task SolveRequirementIssues(ModuleRequirement requirements)
|
||||
{
|
||||
if (!requirements.RequireAny)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var module in requirements.RequiredModulesWithTypes)
|
||||
{
|
||||
var availableModules = await ServerGetAllModules(module);
|
||||
|
||||
Console.WriteLine("Please select a module of type " + module);
|
||||
for (var i = 0; i < availableModules.Count; i++)
|
||||
{
|
||||
Console.WriteLine((i+1) + " - " + availableModules[i].ModuleName);
|
||||
Console.WriteLine("Author: " + availableModules[i].ModuleAuthor);
|
||||
Console.WriteLine("Description: " + availableModules[i].ModuleDescription);
|
||||
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Please select a module by typing the number:");
|
||||
int selectedModule = int.Parse(Console.ReadLine() ?? string.Empty);
|
||||
|
||||
if (selectedModule < 1 || selectedModule > availableModules.Count)
|
||||
{
|
||||
Console.WriteLine("Invalid module selected");
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
|
||||
IProgress<float> progress = new Progress<float>(f => Console.Write($"\b{f}"));
|
||||
await InstallModule(availableModules[selectedModule - 1].ModuleName, progress);
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine("All required modules installed. Please restart the application");
|
||||
System.Diagnostics.Process.Start(System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName);
|
||||
}
|
||||
|
||||
internal async Task LoadModules()
|
||||
{
|
||||
Modules.Clear();
|
||||
|
||||
string moduleConfigPath = Application.CurrentApplication.ApplicationEnvironmentVariables
|
||||
.Get<string>("ModuleConfig", _BaseModuleConfig);
|
||||
|
||||
if(!File.Exists(moduleConfigPath))
|
||||
return;
|
||||
|
||||
string moduleConfigFile = await File.ReadAllTextAsync(moduleConfigPath);
|
||||
List<ModuleData>? listOfModuleData = JsonConvert.DeserializeObject<List<ModuleData>>(moduleConfigFile);
|
||||
|
||||
if (listOfModuleData is null)
|
||||
return;
|
||||
|
||||
if (!listOfModuleData.Any())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleLoader moduleLoader = new ModuleLoader(listOfModuleData);
|
||||
await moduleLoader.LoadFileModules();
|
||||
var modules = await moduleLoader.LoadModules();
|
||||
|
||||
foreach (var module in modules)
|
||||
{
|
||||
|
||||
ModuleData? moduleData = listOfModuleData.FirstOrDefault(data => data.ModuleName == module.Name);
|
||||
|
||||
if (moduleData is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (moduleData.IsEnabled)
|
||||
{
|
||||
try{
|
||||
await module.Initialize();
|
||||
Modules.Add(new LoadedModule(module, moduleData));
|
||||
}catch(Exception e){
|
||||
Console.WriteLine($"Error loading module {moduleData.ModuleName}: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task<object?> InvokeMethodWithReturnValue(string moduleName, string methodName, object[] parameters)
|
||||
{
|
||||
IModule module = GetModule(moduleName).Value;
|
||||
var method = module.GetType().GetMethod(methodName);
|
||||
|
||||
if (method is null)
|
||||
{
|
||||
throw new ModuleMethodNotFound(module, methodName);
|
||||
}
|
||||
|
||||
object? result = await Task.Run(() => method.Invoke(module, parameters));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal async Task<object?> InvokeMethodWithReturnValue(IModule module, string methodName, object[] parameters)
|
||||
{
|
||||
var method = module.GetType().GetMethod(methodName);
|
||||
|
||||
if (method is null)
|
||||
{
|
||||
throw new ModuleMethodNotFound(module, methodName);
|
||||
}
|
||||
|
||||
object? result = await Task.Run(() => method.Invoke(module, parameters));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
internal async Task InvokeMethod(string moduleName, string methodName, object[] parameters)
|
||||
{
|
||||
IModule module = GetModule(moduleName).Value;
|
||||
var method = module.GetType().GetMethod(methodName);
|
||||
|
||||
if (method is null)
|
||||
{
|
||||
throw new ModuleMethodNotFound(module, methodName);
|
||||
}
|
||||
|
||||
await Task.Run(() => method.Invoke(module, parameters));
|
||||
}
|
||||
|
||||
internal async Task InvokeMethod(IModule module, string methodName, object[] parameters)
|
||||
{
|
||||
var method = module.GetType().GetMethod(methodName);
|
||||
|
||||
if (method is null)
|
||||
{
|
||||
throw new ModuleMethodNotFound(module, methodName);
|
||||
}
|
||||
|
||||
await Task.Run(() => method.Invoke(module, parameters));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using DiscordBotCore.Interfaces.Modules;
|
||||
|
||||
namespace DiscordBotCore.Modules;
|
||||
|
||||
public class ModuleOnlineData
|
||||
{
|
||||
public string ModuleName { get; set; }
|
||||
public string ModuleDownloadUrl { get; set; }
|
||||
public string ModuleDescription { get; set; }
|
||||
public string ModuleAuthor { get; set; }
|
||||
public ModuleType ModuleType { get; set; }
|
||||
|
||||
public ModuleOnlineData(string moduleName, string moduleDownloadUrl, ModuleType moduleType, string moduleDescription, string moduleAuthor)
|
||||
{
|
||||
ModuleName = moduleName;
|
||||
ModuleDownloadUrl = moduleDownloadUrl;
|
||||
ModuleType = moduleType;
|
||||
ModuleDescription = moduleDescription;
|
||||
ModuleAuthor = moduleAuthor;
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ public class PluginManager
|
||||
{
|
||||
if (await pluginUpdater.HasUpdate(plugin.PluginName))
|
||||
{
|
||||
Application.Logger.Log("Updating plugin: " + plugin.PluginName, this, LogType.Info);
|
||||
Application.CurrentApplication.Logger.Log("Updating plugin: " + plugin.PluginName, this, LogType.Info);
|
||||
await pluginUpdater.UpdatePlugin(plugin.PluginName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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")
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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)}")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using DiscordBotCore.Online;
|
||||
|
||||
namespace DiscordBotCore.Repository;
|
||||
|
||||
public sealed class ModuleRepository : RepositoryBase
|
||||
{
|
||||
public static readonly ModuleRepository Default = new ModuleRepository("Testing", "https://wizzy-server.ro/SethDiscordBot/ModulesRepo", "modules.json");
|
||||
private ModuleRepository(string repositoryName, string repositoryUrl, string databaseFile) : base(repositoryName, repositoryUrl, databaseFile)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<string> JsonGetAllModules()
|
||||
{
|
||||
var jsonResponse = await ServerCom.GetAllTextFromUrl(DatabasePath);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
private static ModuleRepository From(string repositoryName, string repositoryUrl, string databaseFile)
|
||||
{
|
||||
return new ModuleRepository(repositoryName, repositoryUrl, databaseFile);
|
||||
}
|
||||
|
||||
internal static ModuleRepository SolveRepo()
|
||||
{
|
||||
if (!Application.CurrentApplication.ApplicationEnvironmentVariables.ContainsKey("ModuleRepository"))
|
||||
{
|
||||
return Default;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var moduleRepoDict = Application.CurrentApplication.ApplicationEnvironmentVariables.GetDictionary<string, string>("ModuleRepository");
|
||||
var moduleRepo = From(
|
||||
moduleRepoDict["Name"],
|
||||
moduleRepoDict["Url"],
|
||||
moduleRepoDict["DatabaseFile"]
|
||||
);
|
||||
return moduleRepo;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Application.Logger.LogException(ex, Application.CurrentApplication);
|
||||
|
||||
return Default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public sealed class PluginRepository : RepositoryBase
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Application.Logger.LogException(ex, Application.CurrentApplication);
|
||||
Application.CurrentApplication.Logger.LogException(ex, Application.CurrentApplication);
|
||||
|
||||
return Default;
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<base href="/"/>
|
||||
<link rel="stylesheet" href="bootstrap/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="app.css"/>
|
||||
<link rel="stylesheet" href="DiscordBotWebUI.styles.css"/>
|
||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||
<RadzenTheme Theme="material" @rendermode="InteractiveServer" />
|
||||
<HeadOutlet/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<Routes @rendermode="InteractiveServer"/>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,68 +0,0 @@
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotCore.Plugin
|
||||
@using DiscordBotWebUI.Types
|
||||
|
||||
<RadzenDataGrid AllowColumnResize="true" PageSize="5" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" Data="ListedItems">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(MarketItem.Name)" Title="Item Name"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="@nameof(MarketItem.Author)" Title="Item Author"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="@nameof(MarketItem.Description)" Title="Item Description"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="@nameof(MarketItem.Type)" Title="Item type"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="Item Download">
|
||||
<Template Context="item">
|
||||
<RadzenButton Click="() => DownloadAction(item.Name, item.Type)">Download</RadzenButton>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
<RadzenProgressBar Value="_ProgressValue" Visible="_ProgressBarVisible"/>
|
||||
|
||||
@code {
|
||||
private float _ProgressValue = .0f;
|
||||
private bool _ProgressBarVisible = false;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public List<MarketItem> ListedItems { get; set; }
|
||||
|
||||
public async void DownloadAction(string name, ItemType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ItemType.Module:
|
||||
await DownloadModule(name);
|
||||
break;
|
||||
case ItemType.Plugin:
|
||||
await DownloadPlugin(name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DownloadModule(string moduleName)
|
||||
{
|
||||
_ProgressBarVisible = true;
|
||||
IProgress<float> downloadProgress = new Progress<float>(p => {
|
||||
_ProgressValue = p;
|
||||
StateHasChanged();
|
||||
});
|
||||
await Application.CurrentApplication.ModuleManager.InstallModule(moduleName, downloadProgress);
|
||||
_ProgressBarVisible = false;
|
||||
}
|
||||
|
||||
private async Task DownloadPlugin(string pluginName)
|
||||
{
|
||||
_ProgressBarVisible = true;
|
||||
IProgress<float> downloadProgress = new Progress<float>(p => {
|
||||
_ProgressValue = p;
|
||||
StateHasChanged();
|
||||
});
|
||||
PluginOnlineInfo? pluginInfo = await Application.CurrentApplication.PluginManager.GetPluginDataByName(pluginName);
|
||||
if (pluginInfo is null)
|
||||
return;
|
||||
|
||||
await Application.CurrentApplication.PluginManager.InstallPlugin(pluginInfo, downloadProgress);
|
||||
|
||||
_ProgressBarVisible = false;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
@code {
|
||||
[Parameter] public Action CompleteSetup { get; set; }
|
||||
}
|
||||
|
||||
<RadzenHeading Size="H4">Final Setup</RadzenHeading>
|
||||
<p>Your bot is almost ready! Click 'Finish' to complete the setup.</p>
|
||||
|
||||
<RadzenButton Text="Finish" Click="CompleteSetup" Style="margin-top: 20px;" />
|
||||
@@ -1,48 +0,0 @@
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotCore.Modules
|
||||
@using DiscordBotCore.Others.Exceptions
|
||||
@using DiscordBotWebUI.Types
|
||||
@code {
|
||||
[Parameter] public Action NextStep { get; set; }
|
||||
[Parameter] public ModuleRequirement ModuleRequirementReference { get; set; }
|
||||
|
||||
private List<MarketItem> MarketItems = new List<MarketItem>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
foreach(var requirement in ModuleRequirementReference.RequiredModulesWithTypes)
|
||||
{
|
||||
var modulesWithType = await Application.CurrentApplication.ModuleManager.ServerGetAllModules(requirement);
|
||||
AppendToList(modulesWithType);
|
||||
}
|
||||
|
||||
foreach (var moduleName in ModuleRequirementReference.RequiredModulesWithNames)
|
||||
{
|
||||
var module = await Application.CurrentApplication.ModuleManager.ServerGetModuleWithName(moduleName);
|
||||
MarketItem item = new MarketItem(module.ModuleName, module.ModuleAuthor, module.ModuleDescription, ItemType.Module);
|
||||
MarketItems.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void AppendToList(List<ModuleOnlineData> listOfModules)
|
||||
{
|
||||
foreach (var module in listOfModules)
|
||||
{
|
||||
MarketItem item = new MarketItem(module.ModuleName, module.ModuleAuthor, module.ModuleDescription, ItemType.Module);
|
||||
MarketItems.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<RadzenHeading Size="H4">Download Dependencies</RadzenHeading>
|
||||
<p>The bot needs to download certain files to function properly.</p>
|
||||
|
||||
@if (MarketItems.Any())
|
||||
{
|
||||
<Marketplace ListedItems="MarketItems"/>
|
||||
}
|
||||
|
||||
<RadzenButton Click="NextStep" Text="Next"/>
|
||||
@@ -1,60 +0,0 @@
|
||||
@using DiscordBotCore
|
||||
@code {
|
||||
[Parameter] public Action NextStep { get; set; }
|
||||
private string BotToken { get; set; }
|
||||
private string BotPrefix { get; set; }
|
||||
private List<ulong> BotServers { get; set; }
|
||||
|
||||
private string BotServersString { get; set; }
|
||||
|
||||
private async void DoNextStep()
|
||||
{
|
||||
if(string.IsNullOrEmpty(BotToken) || string.IsNullOrEmpty(BotPrefix) || string.IsNullOrEmpty(BotServersString))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(BotServersString.Contains(","))
|
||||
{
|
||||
BotServersString = BotServersString.Replace(",", ";");
|
||||
}
|
||||
|
||||
var stringList = BotServersString.Split(';');
|
||||
BotServers = new List<ulong>();
|
||||
foreach(var serverId in stringList)
|
||||
{
|
||||
if(ulong.TryParse(serverId, out ulong id))
|
||||
{
|
||||
BotServers.Add(id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!BotServers.Any())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Add("token", BotToken);
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Add("prefix", BotPrefix);
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Add("ServerID", BotServers);
|
||||
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
|
||||
NextStep.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
<RadzenHeading Size="H4">Basic Configuration</RadzenHeading>
|
||||
<p>Please provide some basic settings to get started.</p>
|
||||
|
||||
<RadzenLabel Text="Token" />
|
||||
<RadzenTextBox @bind-Value="BotToken" Placeholder="Enter bot token here" Style="width: 100%;" />
|
||||
|
||||
<RadzenLabel Text="Prefix" Style="margin-top: 10px;" />
|
||||
<RadzenTextBox @bind-Value="BotPrefix" Placeholder="Enter the prefix here" Style="width: 100%;" />
|
||||
|
||||
<RadzenLabel Text="Server Ids separated by ;" Style="margin-top: 20px;" />
|
||||
<RadzenTextBox @bind-Value="BotServersString" Placeholder="Enter Server Ids here. Separated by commas (;)" Style="width: 100%;" />
|
||||
|
||||
<RadzenButton Text="Next" Click="DoNextStep" Style="margin-top: 30px;" />
|
||||
@@ -1,7 +0,0 @@
|
||||
@code {
|
||||
[Parameter] public Action NextStep { get; set; }
|
||||
}
|
||||
|
||||
<RadzenHeading Size="H4">Welcome to the Bot Setup Wizard</RadzenHeading>
|
||||
<p>This setup wizard will guide you through the process of configuring your bot and downloading the necessary dependencies.</p>
|
||||
<RadzenButton Text="Start Setup" Click="NextStep" Style="margin-top: 20px;" />
|
||||
@@ -1,23 +0,0 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<RadzenComponents @rendermode="InteractiveServer" />
|
||||
<div class="page">
|
||||
<div class="sidebar">
|
||||
<NavMenu/>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<RadzenPanel Style="height: 100%; width: 100%">
|
||||
<article class="content px-4">
|
||||
@Body
|
||||
</article>
|
||||
</RadzenPanel>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
@@ -1,96 +0,0 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #d6d5d5;
|
||||
justify-content: flex-end;
|
||||
height: 3.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.top-row ::deep a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.page {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row.auth ::deep a:first-child {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.top-row, article {
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 1.5rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<link rel="stylesheet" href="bootstrap/bootstrap_icons/font/bootstrap-icons.css"/>
|
||||
|
||||
|
||||
<div class="top-row ps-3 navbar navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="">DiscordBotWebUI</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" title="Navigation menu" class="navbar-toggler"/>
|
||||
|
||||
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||
<span class="bi bi-house-door-fill" style="position: relative; top: -.75rem; font-size: 1rem;" aria-hidden="true"></span> Home
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="/settings" Match="NavLinkMatch.All">
|
||||
<span class="bi bi-gear-fill" style="position: relative; top: -.75rem; font-size: 1rem;" aria-hidden="true"></span> Settings
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="/market/plugins" Match="NavLinkMatch.All">
|
||||
<span class="bi bi-database-fill" style="position: relative; top: -.75rem; font-size: 1rem;" aria-hidden="true"></span> Plugins
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="/market/modules" Match="NavLinkMatch.All">
|
||||
<span class="bi bi-database-fill" style="position: relative; top: -.75rem; font-size: 1rem;" aria-hidden="true"></span> Modules
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -1,104 +0,0 @@
|
||||
.navbar-toggler {
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
width: 3.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 1rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.navbar-toggler:checked {
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
height: 3.5rem;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.bi {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
margin-right: 0.75rem;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.bi-house-door-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-plus-square-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-list-nested-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link {
|
||||
color: #d7d7d7;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.37);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-toggler:checked ~ .nav-scrollable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
|
||||
/* Allow sidebar to scroll for tall menus */
|
||||
height: calc(100vh - 3.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
@page "/setup-wizard"
|
||||
@inject DialogService DialogService
|
||||
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotCore.Others.Exceptions
|
||||
@using DiscordBotWebUI.Components.Items.Setup
|
||||
|
||||
<RadzenCard Style="max-width: 600px; margin: auto; margin-top: 50px; padding: 20px;">
|
||||
<RadzenSteps @bind-Value="currentStep" ShowStepsButtons="false">
|
||||
<RadzenStepsItem Text="Welcome" />
|
||||
<RadzenStepsItem Text="Basic Configuration" />
|
||||
<RadzenStepsItem Text="Download Dependencies" />
|
||||
<RadzenStepsItem Text="Final Setup" />
|
||||
</RadzenSteps>
|
||||
|
||||
<div>
|
||||
@if (currentStep == 0)
|
||||
{
|
||||
<WelcomeComponent NextStep="NextStep" />
|
||||
}
|
||||
else if (currentStep == 1)
|
||||
{
|
||||
<StartupConfigurationComponent NextStep="NextStep" />
|
||||
}
|
||||
else if (currentStep == 2)
|
||||
{
|
||||
<ModuleSetupComponent ModuleRequirementReference="RequirementsToDownload" NextStep="NextStep" />
|
||||
}
|
||||
else if (currentStep == 3)
|
||||
{
|
||||
<FinishSetupComponent CompleteSetup="FinishSetup" />
|
||||
}
|
||||
</div>
|
||||
</RadzenCard>
|
||||
|
||||
@code {
|
||||
[Parameter] public ModuleRequirement RequirementsToDownload { get; set; }
|
||||
|
||||
private int currentStep = 0;
|
||||
|
||||
private void NextStep()
|
||||
{
|
||||
currentStep++;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void FinishSetup()
|
||||
{
|
||||
DialogService.Close(true);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
@page "/Error"
|
||||
@using System.Diagnostics
|
||||
|
||||
<PageTitle>Error</PageTitle>
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
|
||||
@code{
|
||||
[CascadingParameter] private HttpContext? HttpContext { get; set; }
|
||||
|
||||
private string? RequestId { get; set; }
|
||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
protected override void OnInitialized() =>
|
||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
@page "/"
|
||||
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotCore.Others
|
||||
@using DiscordBotCore.Others.Exceptions
|
||||
@using DiscordBotWebUI.Components.Pages.Setup
|
||||
@using DiscordBotWebUI.DiscordBot
|
||||
|
||||
@inject DialogService DialogService
|
||||
|
||||
|
||||
@if (RestartAppMessage)
|
||||
{
|
||||
<RadzenText Text="The application is not running. Click this button to close the application and restart"/>
|
||||
<RadzenButton Text="Close Application" Click="RestartApplication"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenButton Text="Start" Click="Initialize"/>
|
||||
<RadzenTextArea Placeholder="Logs..." Value="@_TextValue" Style="width: 100%; height: 80%"/>
|
||||
}
|
||||
|
||||
@code {
|
||||
private string? _TextValue;
|
||||
private bool RestartAppMessage;
|
||||
|
||||
private async Task Solver(ModuleRequirement moduleRequirement)
|
||||
{
|
||||
while (await DialogService.OpenAsync<SetupWizard>("Setup Wizard", new Dictionary<string, object> {{"RequirementsToDownload", moduleRequirement}}, new DialogOptions()
|
||||
{
|
||||
ShowTitle = false,
|
||||
CloseDialogOnEsc = false,
|
||||
CloseDialogOnOverlayClick = false,
|
||||
ShowClose = false
|
||||
}) != true)
|
||||
{
|
||||
Console.WriteLine("Failed to complete the setup. Invalid data acquired ...");
|
||||
}
|
||||
}
|
||||
|
||||
private void RestartApplication()
|
||||
{
|
||||
var appExecutable = System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName;
|
||||
if (appExecutable is null)
|
||||
{
|
||||
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||
return;
|
||||
}
|
||||
|
||||
System.Diagnostics.Process.Start(appExecutable);
|
||||
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
|
||||
private async Task Initialize()
|
||||
{
|
||||
if (!Application.IsRunning && Application.CurrentApplication is not null)
|
||||
{
|
||||
RestartAppMessage = true;
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
Action<string, LogType> logging = async (str, type) => {
|
||||
_TextValue += $"[{type}] {str} \n";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
};
|
||||
|
||||
var discordApplication = new DiscordApplication(logging, Solver);
|
||||
await discordApplication.Start();
|
||||
|
||||
if (!Application.IsRunning)
|
||||
{
|
||||
RestartAppMessage = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// private async void Initialize()
|
||||
// {
|
||||
// _DiscordBotStartup = new DiscordBotStartup { RequirementsSolver = default! };
|
||||
// await _DiscordBotStartup.CreateApplication();
|
||||
//
|
||||
// _DiscordBotStartup.Log = async (str, type) => {
|
||||
// _TextValue += $"[{type}] {str} \n";
|
||||
// await InvokeAsync(StateHasChanged);
|
||||
//
|
||||
// Console.WriteLine(str);
|
||||
// };
|
||||
//
|
||||
// if (_DiscordBotStartup.LoadComponents())
|
||||
// {
|
||||
// await _DiscordBotStartup.PrepareBot();
|
||||
// await _DiscordBotStartup.RefreshPlugins(false);
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// while (await DialogService.OpenAsync<Settings>("Please complete this setup before starting the bot") == false)
|
||||
// {
|
||||
// Console.WriteLine("Failed to complete the setup. Invalid data acquired ...");
|
||||
// }
|
||||
//
|
||||
// await _DiscordBotStartup.PrepareBot();
|
||||
// await _DiscordBotStartup.RefreshPlugins(false);
|
||||
// }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
@page "/market/modules"
|
||||
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotWebUI.Types
|
||||
@using DiscordBotWebUI.Components.Items
|
||||
|
||||
@if(_MarketItems is not null && _MarketItems.Any())
|
||||
{
|
||||
<Marketplace ListedItems="_MarketItems"/>
|
||||
} else
|
||||
{
|
||||
<RadzenText Text="There are no modules available right now ..."></RadzenText>
|
||||
}
|
||||
|
||||
@code {
|
||||
private readonly List<MarketItem>? _MarketItems = new List<MarketItem>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
if (!Application.IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var modules = await Application.CurrentApplication.ModuleManager.ServerGetAllModules();
|
||||
foreach(var onlineModule in modules)
|
||||
{
|
||||
var item = new MarketItem(onlineModule.ModuleName, onlineModule.ModuleAuthor, onlineModule.ModuleDescription, ItemType.Module);
|
||||
_MarketItems.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
@page "/market/plugins"
|
||||
@using DiscordBotCore
|
||||
@using DiscordBotWebUI.Types
|
||||
@using DiscordBotWebUI.Components.Items
|
||||
|
||||
@if(_MarketItems is null)
|
||||
{
|
||||
<RadzenText Text="There are no plugins available right now ..."></RadzenText>
|
||||
}
|
||||
|
||||
@if(_MarketItems is not null && _MarketItems.Any())
|
||||
{
|
||||
<Marketplace ListedItems="_MarketItems"/>
|
||||
}
|
||||
|
||||
@code {
|
||||
private List<MarketItem>? _MarketItems;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
if(!Application.IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var plugins = await Application.CurrentApplication.PluginManager.GetPluginsList();
|
||||
|
||||
if(plugins is null)
|
||||
{
|
||||
_MarketItems = null;
|
||||
return;
|
||||
}
|
||||
|
||||
_MarketItems = new List<MarketItem>();
|
||||
|
||||
foreach (var onlinePlugin in plugins)
|
||||
{
|
||||
var marketItem = new MarketItem(onlinePlugin.Name, onlinePlugin.Author, onlinePlugin.Description, ItemType.Plugin);
|
||||
_MarketItems.Add(marketItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
@page "/settings"
|
||||
@using DiscordBotCore
|
||||
@inject NotificationService NotificationService
|
||||
@inject DialogService DialogService
|
||||
|
||||
@if (Application.IsRunning)
|
||||
{
|
||||
<RadzenPanel>
|
||||
<HeaderTemplate>
|
||||
<RadzenText>Discord Bot requires a Bot Token, a prefix for normal commands and the server Ids on the servers it will be in</RadzenText>
|
||||
</HeaderTemplate>
|
||||
<ChildContent>
|
||||
<RadzenRow>
|
||||
<RadzenColumn>
|
||||
<RadzenText>Discord Bot Token</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn>
|
||||
<RadzenTextBox Placeholder="Token..." Value="@_Token" ValueChanged="TokenValueChanged"></RadzenTextBox>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow>
|
||||
<RadzenColumn>
|
||||
<RadzenText>Bot prefix</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn>
|
||||
<RadzenTextBox Placeholder="Bot prefix ..." MaxLength="1" Value="@_Prefix" ValueChanged="PrefixValueChanged"></RadzenTextBox>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow>
|
||||
<RadzenColumn>
|
||||
<RadzenText>Bot Server Ids:</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn>
|
||||
<RadzenTextArea Placeholder="One per line ..." Value="@_ServerIds" ValueChanged="ServerIDsValueChanged"></RadzenTextArea>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</ChildContent>
|
||||
|
||||
<FooterTemplate>
|
||||
<RadzenButton Text="Save" Click="SaveChanges"></RadzenButton>
|
||||
</FooterTemplate>
|
||||
</RadzenPanel>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenText>The application is not running. Please start the application first from the Home page</RadzenText>
|
||||
}
|
||||
|
||||
|
||||
@code {
|
||||
private string _Token = string.Empty;
|
||||
private string _Prefix = string.Empty;
|
||||
private string _ServerIds = string.Empty;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
|
||||
if (!Application.IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(Application.CurrentApplication.ApplicationEnvironmentVariables.TryGetValue("token", out var token))
|
||||
{
|
||||
_Token = token as string;
|
||||
}
|
||||
|
||||
if(Application.CurrentApplication.ApplicationEnvironmentVariables.TryGetValue("prefix", out var prefix))
|
||||
{
|
||||
_Prefix = prefix as string;
|
||||
}
|
||||
|
||||
if(Application.CurrentApplication.ApplicationEnvironmentVariables.TryGetValue("ServerID", out var serverIds))
|
||||
{
|
||||
if (serverIds is List<object> listServerIds)
|
||||
{
|
||||
foreach(var item in listServerIds)
|
||||
{
|
||||
_ServerIds += $"{item}\n";
|
||||
}
|
||||
|
||||
_ServerIds.TrimEnd();
|
||||
}
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
}
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
|
||||
if (_Prefix.Length != 1)
|
||||
{
|
||||
DialogService.Close(false);
|
||||
}
|
||||
|
||||
List<ulong> serverIds = new List<ulong>();
|
||||
string[] values = _ServerIds.Split('\n');
|
||||
foreach(var value in values)
|
||||
{
|
||||
string clearValue = value.TrimEnd().Replace("\r", "");
|
||||
if(ulong.TryParse(clearValue, out ulong actualValue))
|
||||
{
|
||||
serverIds.Add(actualValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (serverIds.Count == 0)
|
||||
{
|
||||
DialogService.Close(false);
|
||||
}
|
||||
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Set("token", _Token);
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Set("prefix", _Prefix);
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.Set("ServerID", serverIds);
|
||||
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
|
||||
NotificationService.Notify(NotificationSeverity.Success, "Configuration", "Configuration has been saved !", 4000);
|
||||
|
||||
DialogService.Close(true);
|
||||
}
|
||||
|
||||
private void ServerIDsValueChanged(string obj)
|
||||
{
|
||||
_ServerIds = obj;
|
||||
}
|
||||
private void PrefixValueChanged(string obj)
|
||||
{
|
||||
_Prefix = obj;
|
||||
}
|
||||
private void TokenValueChanged(string obj)
|
||||
{
|
||||
_Token = obj;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)"/>
|
||||
<FocusOnNavigate RouteData="routeData" Selector="h1"/>
|
||||
</Found>
|
||||
</Router>
|
||||
@@ -1,12 +0,0 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using DiscordBotWebUI
|
||||
@using DiscordBotWebUI.Components
|
||||
@using Radzen
|
||||
@using Radzen.Blazor
|
||||
@@ -1,90 +0,0 @@
|
||||
using DiscordBotCore;
|
||||
using DiscordBotCore.Bot;
|
||||
using DiscordBotCore.Loaders;
|
||||
using DiscordBotCore.Others;
|
||||
using DiscordBotCore.Others.Exceptions;
|
||||
|
||||
namespace DiscordBotWebUI.DiscordBot;
|
||||
|
||||
public class DiscordApplication
|
||||
{
|
||||
public bool IsRunning { get; private set; }
|
||||
private Action<string, LogType> LogWriter { get; set; }
|
||||
private Func<ModuleRequirement, Task> RequirementsSolver { get; set; }
|
||||
|
||||
public DiscordApplication(Action<string, LogType> logWriter, Func<ModuleRequirement, Task> requirementsSolver)
|
||||
{
|
||||
this.LogWriter = logWriter;
|
||||
this.RequirementsSolver = requirementsSolver;
|
||||
IsRunning = false;
|
||||
|
||||
}
|
||||
|
||||
private async Task<bool> LoadComponents()
|
||||
{
|
||||
await Application.CreateApplication(RequirementsSolver);
|
||||
Application.Logger.SetOutFunction(LogWriter);
|
||||
|
||||
return Application.CurrentApplication.ApplicationEnvironmentVariables.ContainsKey("ServerID") &&
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.ContainsKey("token") &&
|
||||
Application.CurrentApplication.ApplicationEnvironmentVariables.ContainsKey("prefix");
|
||||
|
||||
}
|
||||
|
||||
public async Task Start()
|
||||
{
|
||||
if (!await LoadComponents())
|
||||
{
|
||||
Console.WriteLine("Failed to load components");
|
||||
return;
|
||||
}
|
||||
|
||||
var token = Application.CurrentApplication.ApplicationEnvironmentVariables.Get<string>("token");
|
||||
var prefix = Application.CurrentApplication.ApplicationEnvironmentVariables.Get<string>("prefix");
|
||||
|
||||
var coreApplication = new DiscordBotApplication(token, prefix);
|
||||
await coreApplication.StartAsync();
|
||||
|
||||
await RefreshPlugins(false);
|
||||
|
||||
IsRunning = true;
|
||||
}
|
||||
|
||||
public async Task RefreshPlugins(bool quiet)
|
||||
{
|
||||
await LoadPlugins(quiet ? ["-q"] : null);
|
||||
await InitializeInternalActionManager();
|
||||
}
|
||||
|
||||
private async Task LoadPlugins(string[]? args)
|
||||
{
|
||||
var loader = new PluginLoader(Application.CurrentApplication.DiscordBotClient.Client);
|
||||
if (args is not null && args.Contains("-q"))
|
||||
{
|
||||
await loader.LoadPlugins();
|
||||
}
|
||||
|
||||
loader.OnCommandLoaded += (command) => {
|
||||
Application.Logger.Log($"Command {command.Command} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnEventLoaded += (eEvent) => {
|
||||
Application.Logger.Log($"Event {eEvent.Name} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnActionLoaded += (action) => {
|
||||
Application.Logger.Log($"Action {action.ActionName} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
loader.OnSlashCommandLoaded += (slashCommand) => {
|
||||
Application.Logger.Log($"Slash Command {slashCommand.Name} loaded successfully", LogType.Info);
|
||||
};
|
||||
|
||||
await loader.LoadPlugins();
|
||||
}
|
||||
|
||||
private async Task InitializeInternalActionManager()
|
||||
{
|
||||
await Application.CurrentApplication.InternalActionManager.Initialize();
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DiscordBotCore\DiscordBotCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Radzen.Blazor" Version="5.1.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="Data\Resources\config.json" />
|
||||
<_ContentIncludedByDefault Remove="Data\Resources\plugins.json" />
|
||||
<_ContentIncludedByDefault Remove="Components\Items\MarketplaceItems\MarketplaceItem.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,89 +0,0 @@
|
||||
using System.Reflection;
|
||||
using DiscordBotWebUI.Components;
|
||||
using DiscordBotWebUI.StartupActions;
|
||||
using Radzen;
|
||||
|
||||
|
||||
string logo =
|
||||
@"
|
||||
|
||||
_____ _ _ _____ _ _ ____ _
|
||||
/ ____| | | | | | __ \(_) | | | _ \ | |
|
||||
| (___ ___| |_| |__ | | | |_ ___ ___ ___ _ __ __| | | |_) | ___ | |_
|
||||
\___ \ / _ \ __| '_ \ | | | | / __|/ __/ _ \| '__/ _` | | _ < / _ \| __|
|
||||
____) | __/ |_| | | | | |__| | \__ \ (_| (_) | | | (_| | | |_) | (_) | |_
|
||||
|_____/ \___|\__|_| |_| |_____/|_|___/\___\___/|_| \__,_| |____/ \___/ \__|
|
||||
(WEB Edition)
|
||||
|
||||
";
|
||||
|
||||
var currentDomain = AppDomain.CurrentDomain;
|
||||
currentDomain.AssemblyResolve += LoadFromSameFolder;
|
||||
|
||||
static Assembly LoadFromSameFolder(object sender, ResolveEventArgs args)
|
||||
{
|
||||
Directory.CreateDirectory("./Libraries");
|
||||
string requestingAssembly = args.RequestingAssembly?.GetName().Name;
|
||||
var folderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, $"Libraries/{requestingAssembly}");
|
||||
var assemblyName = new AssemblyName(args.Name).Name + ".dll";
|
||||
var assemblyPath = Path.Combine(folderPath, assemblyName);
|
||||
|
||||
if (File.Exists(assemblyPath))
|
||||
{
|
||||
var fileAssembly = Assembly.LoadFrom(assemblyPath);
|
||||
return fileAssembly;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// Start startup actions if any
|
||||
if (args.Length > 0)
|
||||
{
|
||||
// get all classes that derive from IStartupAction
|
||||
var startupActions = Assembly.GetExecutingAssembly()
|
||||
.GetTypes()
|
||||
.Where(t => t.IsSubclassOf(typeof(IStartupAction)))
|
||||
.Select(t => Activator.CreateInstance(t) as IStartupAction)
|
||||
.ToList();
|
||||
|
||||
foreach(var argument in args)
|
||||
{
|
||||
startupActions.FirstOrDefault(action => action?.Command == argument)?.RunAction(argument.Split(' ')[1..]);
|
||||
}
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||
Console.WriteLine(logo);
|
||||
Console.ResetColor();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
builder.Services.AddRadzenComponents();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
|
||||
app.Run();
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:31569",
|
||||
"sslPort": 44363
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:5255",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7046;http://localhost:5255",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
namespace DiscordBotWebUI.StartupActions.Actions;
|
||||
|
||||
public class PurgePlugins : IStartupAction
|
||||
{
|
||||
public string Command => "purge_plugins";
|
||||
public void RunAction(string[] args)
|
||||
{
|
||||
foreach (var plugin in Directory.GetFiles("./Data/Plugins", "*.dll", SearchOption.AllDirectories))
|
||||
{
|
||||
File.Delete(plugin);
|
||||
}
|
||||
|
||||
File.Delete("./Data/Resources/plugins.json");
|
||||
Directory.Delete("./Libraries/", true);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace DiscordBotWebUI.StartupActions.Actions;
|
||||
|
||||
public class UpdateCleanup : IStartupAction
|
||||
{
|
||||
public string Command => "update-cleanup";
|
||||
|
||||
public void RunAction(string[] args)
|
||||
{
|
||||
List<string> files = new List<string>();
|
||||
files.AddRange(Directory.GetFiles("./"));
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
if (file.EndsWith(".bak"))
|
||||
File.Delete(file);
|
||||
}
|
||||
|
||||
Directory.Delete("temp");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace DiscordBotWebUI.StartupActions;
|
||||
|
||||
internal interface IStartupAction
|
||||
{
|
||||
string Command { get; }
|
||||
void RunAction(string[] args);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace DiscordBotWebUI.Types;
|
||||
public enum ItemType
|
||||
{
|
||||
Module,
|
||||
Plugin
|
||||
}
|
||||
|
||||
|
||||
public class MarketItem
|
||||
{
|
||||
public ItemType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public MarketItem(string name, string author, string description, ItemType type)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Author = author;
|
||||
this.Description = description;
|
||||
this.Type = type;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
html, body {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
a, .btn-link {
|
||||
color: #006bb7;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
|
||||
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 1.1rem;
|
||||
}
|
||||
|
||||
h1:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.valid.modified:not([type=checkbox]) {
|
||||
outline: 1px solid #26b050;
|
||||
}
|
||||
|
||||
.invalid {
|
||||
outline: 1px solid #e50000;
|
||||
}
|
||||
|
||||
.validation-message {
|
||||
color: #e50000;
|
||||
}
|
||||
|
||||
.blazor-error-boundary {
|
||||
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
|
||||
padding: 1rem 1rem 1rem 3.7rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.blazor-error-boundary::after {
|
||||
content: "An error has occurred."
|
||||
}
|
||||
|
||||
.darker-border-checkbox.form-check-input {
|
||||
border-color: #929292;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-0-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895"/>
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.012 4.158c1.858 0 2.96-1.582 2.96-3.99V7.84c0-2.426-1.079-3.996-2.936-3.996-1.864 0-2.965 1.588-2.965 3.996v.328c0 2.42 1.09 3.99 2.941 3.99"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 476 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-0-circle" viewBox="0 0 16 16">
|
||||
<path d="M7.988 12.158c-1.851 0-2.941-1.57-2.941-3.99V7.84c0-2.408 1.101-3.996 2.965-3.996 1.857 0 2.935 1.57 2.935 3.996v.328c0 2.408-1.101 3.99-2.959 3.99M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895"/>
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 507 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-0-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895"/>
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm5.988 12.158c-1.851 0-2.941-1.57-2.941-3.99V7.84c0-2.408 1.101-3.996 2.965-3.996 1.857 0 2.935 1.57 2.935 3.996v.328c0 2.408-1.101 3.99-2.959 3.99"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 514 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-0-square" viewBox="0 0 16 16">
|
||||
<path d="M7.988 12.158c-1.851 0-2.941-1.57-2.941-3.99V7.84c0-2.408 1.101-3.996 2.965-3.996 1.857 0 2.935 1.57 2.935 3.996v.328c0 2.408-1.101 3.99-2.959 3.99M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 579 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-1-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M9.283 4.002H7.971L6.072 5.385v1.271l1.834-1.318h.065V12h1.312z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 250 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-1-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0M9.283 4.002V12H7.971V5.338h-.065L6.072 6.656V5.385l1.899-1.383z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 279 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-1-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm7.283 4.002V12H7.971V5.338h-.065L6.072 6.656V5.385l1.899-1.383z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 286 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-1-square" viewBox="0 0 16 16">
|
||||
<path d="M9.283 4.002V12H7.971V5.338h-.065L6.072 6.656V5.385l1.899-1.383z"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 366 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-123" viewBox="0 0 16 16">
|
||||
<path d="M2.873 11.297V4.142H1.699L0 5.379v1.137l1.64-1.18h.06v5.961zm3.213-5.09v-.063c0-.618.44-1.169 1.196-1.169.676 0 1.174.44 1.174 1.106 0 .624-.42 1.101-.807 1.526L4.99 10.553v.744h4.78v-.99H6.643v-.069L8.41 8.252c.65-.724 1.237-1.332 1.237-2.27C9.646 4.849 8.723 4 7.308 4c-1.573 0-2.36 1.064-2.36 2.15v.057zm6.559 1.883h.786c.823 0 1.374.481 1.379 1.179.01.707-.55 1.216-1.421 1.21-.77-.005-1.326-.419-1.379-.953h-1.095c.042 1.053.938 1.918 2.464 1.918 1.478 0 2.642-.839 2.62-2.144-.02-1.143-.922-1.651-1.551-1.714v-.063c.535-.09 1.347-.66 1.326-1.678-.026-1.053-.933-1.855-2.359-1.845-1.5.005-2.317.88-2.348 1.898h1.116c.032-.498.498-.944 1.206-.944.703 0 1.206.435 1.206 1.07.005.64-.504 1.106-1.2 1.106h-.75z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 854 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-2-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M6.646 6.24c0-.691.493-1.306 1.336-1.306.756 0 1.313.492 1.313 1.236 0 .697-.469 1.23-.902 1.705l-2.971 3.293V12h5.344v-1.107H7.268v-.077l1.974-2.22.096-.107c.688-.763 1.287-1.428 1.287-2.43 0-1.266-1.031-2.215-2.613-2.215-1.758 0-2.637 1.19-2.637 2.402v.065h1.271v-.07Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 457 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-2-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0M6.646 6.24v.07H5.375v-.064c0-1.213.879-2.402 2.637-2.402 1.582 0 2.613.949 2.613 2.215 0 1.002-.6 1.667-1.287 2.43l-.096.107-1.974 2.22v.077h3.498V12H5.422v-.832l2.97-3.293c.434-.475.903-1.008.903-1.705 0-.744-.557-1.236-1.313-1.236-.843 0-1.336.615-1.336 1.306"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 477 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-2-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm4.646 6.24v.07H5.375v-.064c0-1.213.879-2.402 2.637-2.402 1.582 0 2.613.949 2.613 2.215 0 1.002-.6 1.667-1.287 2.43l-.096.107-1.974 2.22v.077h3.498V12H5.422v-.832l2.97-3.293c.434-.475.903-1.008.903-1.705 0-.744-.557-1.236-1.313-1.236-.843 0-1.336.615-1.336 1.306"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 484 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-2-square" viewBox="0 0 16 16">
|
||||
<path d="M6.646 6.24v.07H5.375v-.064c0-1.213.879-2.402 2.637-2.402 1.582 0 2.613.949 2.613 2.215 0 1.002-.6 1.667-1.287 2.43l-.096.107-1.974 2.22v.077h3.498V12H5.422v-.832l2.97-3.293c.434-.475.903-1.008.903-1.705 0-.744-.557-1.236-1.313-1.236-.843 0-1.336.615-1.336 1.306"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 564 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-3-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.082.414c.92 0 1.535.54 1.541 1.318.012.791-.615 1.36-1.588 1.354-.861-.006-1.482-.469-1.54-1.066H5.104c.047 1.177 1.05 2.144 2.754 2.144 1.653 0 2.954-.937 2.93-2.396-.023-1.278-1.031-1.846-1.734-1.916v-.07c.597-.1 1.505-.739 1.482-1.876-.03-1.177-1.043-2.074-2.637-2.062-1.675.006-2.59.984-2.625 2.12h1.248c.036-.556.557-1.054 1.348-1.054.785 0 1.348.486 1.348 1.195.006.715-.563 1.237-1.342 1.237h-.838v1.072h.879Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 607 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-3-circle" viewBox="0 0 16 16">
|
||||
<path d="M7.918 8.414h-.879V7.342h.838c.78 0 1.348-.522 1.342-1.237 0-.709-.563-1.195-1.348-1.195-.79 0-1.312.498-1.348 1.055H5.275c.036-1.137.95-2.115 2.625-2.121 1.594-.012 2.608.885 2.637 2.062.023 1.137-.885 1.776-1.482 1.875v.07c.703.07 1.71.64 1.734 1.917.024 1.459-1.277 2.396-2.93 2.396-1.705 0-2.707-.967-2.754-2.144H6.33c.059.597.68 1.06 1.541 1.066.973.006 1.6-.563 1.588-1.354-.006-.779-.621-1.318-1.541-1.318"/>
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 642 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-3-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm5.918 8.414h-.879V7.342h.838c.78 0 1.348-.522 1.342-1.237 0-.709-.563-1.195-1.348-1.195-.79 0-1.312.498-1.348 1.055H5.275c.036-1.137.95-2.115 2.625-2.121 1.594-.012 2.608.885 2.637 2.062.023 1.137-.885 1.776-1.482 1.875v.07c.703.07 1.71.64 1.734 1.917.024 1.459-1.277 2.396-2.93 2.396-1.705 0-2.707-.967-2.754-2.144H6.33c.059.597.68 1.06 1.541 1.066.973.006 1.6-.563 1.588-1.354-.006-.779-.621-1.318-1.541-1.318"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 634 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-3-square" viewBox="0 0 16 16">
|
||||
<path d="M7.918 8.414h-.879V7.342h.838c.78 0 1.348-.522 1.342-1.237 0-.709-.563-1.195-1.348-1.195-.79 0-1.312.498-1.348 1.055H5.275c.036-1.137.95-2.115 2.625-2.121 1.594-.012 2.608.885 2.637 2.062.023 1.137-.885 1.776-1.482 1.875v.07c.703.07 1.71.64 1.734 1.917.024 1.459-1.277 2.396-2.93 2.396-1.705 0-2.707-.967-2.754-2.144H6.33c.059.597.68 1.06 1.541 1.066.973.006 1.6-.563 1.588-1.354-.006-.779-.621-1.318-1.541-1.318"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 714 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-4-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M7.519 5.057c-.886 1.418-1.772 2.838-2.542 4.265v1.12H8.85V12h1.26v-1.559h1.007V9.334H10.11V4.002H8.176zM6.225 9.281v.053H8.85V5.063h-.065c-.867 1.33-1.787 2.806-2.56 4.218"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 359 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-4-circle" viewBox="0 0 16 16">
|
||||
<path d="M7.519 5.057q.33-.527.657-1.055h1.933v5.332h1.008v1.107H10.11V12H8.85v-1.559H4.978V9.322c.77-1.427 1.656-2.847 2.542-4.265ZM6.225 9.281v.053H8.85V5.063h-.065c-.867 1.33-1.787 2.806-2.56 4.218"/>
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 421 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-4-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M6.225 9.281v.053H8.85V5.063h-.065c-.867 1.33-1.787 2.806-2.56 4.218"/>
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm5.519 5.057q.33-.527.657-1.055h1.933v5.332h1.008v1.107H10.11V12H8.85v-1.559H4.978V9.322c.77-1.427 1.656-2.847 2.542-4.265Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 428 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-4-square" viewBox="0 0 16 16">
|
||||
<path d="M7.519 5.057q.33-.527.657-1.055h1.933v5.332h1.008v1.107H10.11V12H8.85v-1.559H4.978V9.322c.77-1.427 1.656-2.847 2.542-4.265ZM6.225 9.281v.053H8.85V5.063h-.065c-.867 1.33-1.787 2.806-2.56 4.218"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 493 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-5-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.006 4.158c1.74 0 2.924-1.119 2.924-2.806 0-1.641-1.178-2.584-2.56-2.584-.897 0-1.442.421-1.612.68h-.064l.193-2.344h3.621V4.002H5.791L5.445 8.63h1.149c.193-.358.668-.809 1.435-.809.85 0 1.582.604 1.582 1.57 0 1.085-.779 1.682-1.57 1.682-.697 0-1.389-.31-1.53-1.031H5.276c.065 1.213 1.149 2.115 2.72 2.115Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 495 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-5-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8m15 0A8 8 0 1 0 0 8a8 8 0 0 0 16 0m-8.006 4.158c-1.57 0-2.654-.902-2.719-2.115h1.237c.14.72.832 1.031 1.529 1.031.791 0 1.57-.597 1.57-1.681 0-.967-.732-1.57-1.582-1.57-.767 0-1.242.45-1.435.808H5.445L5.791 4h4.705v1.103H6.875l-.193 2.343h.064c.17-.258.715-.68 1.611-.68 1.383 0 2.561.944 2.561 2.585 0 1.687-1.184 2.806-2.924 2.806Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 514 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-5-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm5.994 12.158c-1.57 0-2.654-.902-2.719-2.115h1.237c.14.72.832 1.031 1.529 1.031.791 0 1.57-.597 1.57-1.681 0-.967-.732-1.57-1.582-1.57-.767 0-1.242.45-1.435.808H5.445L5.791 4h4.705v1.103H6.875l-.193 2.343h.064c.17-.258.715-.68 1.611-.68 1.383 0 2.561.944 2.561 2.585 0 1.687-1.184 2.806-2.924 2.806Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 521 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-5-square" viewBox="0 0 16 16">
|
||||
<path d="M7.994 12.158c-1.57 0-2.654-.902-2.719-2.115h1.237c.14.72.832 1.031 1.529 1.031.791 0 1.57-.597 1.57-1.681 0-.967-.732-1.57-1.582-1.57-.767 0-1.242.45-1.435.808H5.445L5.791 4h4.705v1.103H6.875l-.193 2.343h.064c.17-.258.715-.68 1.611-.68 1.383 0 2.561.944 2.561 2.585 0 1.687-1.184 2.806-2.924 2.806Z"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 601 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-6-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8.21 3.855c-1.868 0-3.116 1.395-3.116 4.407 0 1.183.228 2.039.597 2.642.569.926 1.477 1.254 2.409 1.254 1.629 0 2.847-1.013 2.847-2.783 0-1.676-1.254-2.555-2.508-2.555-1.125 0-1.752.61-1.98 1.155h-.082c-.012-1.946.727-3.036 1.805-3.036.802 0 1.213.457 1.312.815h1.29c-.06-.908-.962-1.899-2.573-1.899Zm-.099 4.008c-.92 0-1.564.65-1.564 1.576 0 1.032.703 1.635 1.558 1.635.868 0 1.553-.533 1.553-1.629 0-1.06-.744-1.582-1.547-1.582"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 617 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-6-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8.21 3.855c1.612 0 2.515.99 2.573 1.899H9.494c-.1-.358-.51-.815-1.312-.815-1.078 0-1.817 1.09-1.805 3.036h.082c.229-.545.855-1.155 1.98-1.155 1.254 0 2.508.88 2.508 2.555 0 1.77-1.218 2.783-2.847 2.783-.932 0-1.84-.328-2.409-1.254-.369-.603-.597-1.459-.597-2.642 0-3.012 1.248-4.407 3.117-4.407Zm-.099 4.008c-.92 0-1.564.65-1.564 1.576 0 1.032.703 1.635 1.558 1.635.868 0 1.553-.533 1.553-1.629 0-1.06-.744-1.582-1.547-1.582"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 640 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-6-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M8.111 7.863c-.92 0-1.564.65-1.564 1.576 0 1.032.703 1.635 1.558 1.635.868 0 1.553-.533 1.553-1.629 0-1.06-.744-1.582-1.547-1.582"/>
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm6.21 3.855c1.612 0 2.515.99 2.573 1.899H9.494c-.1-.358-.51-.815-1.312-.815-1.078 0-1.817 1.09-1.805 3.036h.082c.229-.545.855-1.155 1.98-1.155 1.254 0 2.508.88 2.508 2.555 0 1.77-1.218 2.783-2.847 2.783-.932 0-1.84-.328-2.409-1.254-.369-.603-.597-1.459-.597-2.642 0-3.012 1.248-4.407 3.117-4.407Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 662 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-6-square" viewBox="0 0 16 16">
|
||||
<path d="M8.21 3.855c1.612 0 2.515.99 2.573 1.899H9.494c-.1-.358-.51-.815-1.312-.815-1.078 0-1.817 1.09-1.805 3.036h.082c.229-.545.855-1.155 1.98-1.155 1.254 0 2.508.88 2.508 2.555 0 1.77-1.218 2.783-2.847 2.783-.932 0-1.84-.328-2.409-1.254-.369-.603-.597-1.459-.597-2.642 0-3.012 1.248-4.407 3.117-4.407Zm-.099 4.008c-.92 0-1.564.65-1.564 1.576 0 1.032.703 1.635 1.558 1.635.868 0 1.553-.533 1.553-1.629 0-1.06-.744-1.582-1.547-1.582"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 727 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-7-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.37 5.11h3.972v.07L6.025 12H7.42l3.258-6.85V4.002H5.369v1.107Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 251 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-7-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.37 5.11V4.001h5.308V5.15L7.42 12H6.025l3.317-6.82v-.07H5.369Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 279 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-7-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm3.37 5.11V4.001h5.308V5.15L7.42 12H6.025l3.317-6.82v-.07H5.369Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 286 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-7-square" viewBox="0 0 16 16">
|
||||
<path d="M5.37 5.11V4.001h5.308V5.15L7.42 12H6.025l3.317-6.82v-.07H5.369Z"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 366 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-8-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-5.03 1.803c0-1.248-.943-1.84-1.646-1.992v-.065c.598-.187 1.336-.72 1.336-1.781 0-1.225-1.084-2.121-2.654-2.121s-2.66.896-2.66 2.12c0 1.044.709 1.589 1.33 1.782v.065c-.697.152-1.647.732-1.647 2.003 0 1.39 1.19 2.344 2.953 2.344 1.77 0 2.989-.96 2.989-2.355Zm-4.347-3.71c0 .739.586 1.255 1.383 1.255s1.377-.516 1.377-1.254c0-.733-.58-1.23-1.377-1.23s-1.383.497-1.383 1.23Zm-.281 3.645c0 .838.72 1.412 1.664 1.412.943 0 1.658-.574 1.658-1.412 0-.843-.715-1.424-1.658-1.424-.944 0-1.664.58-1.664 1.424"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 686 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-8-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-5.03 1.803c0 1.394-1.218 2.355-2.988 2.355-1.763 0-2.953-.955-2.953-2.344 0-1.271.95-1.851 1.647-2.003v-.065c-.621-.193-1.33-.738-1.33-1.781 0-1.225 1.09-2.121 2.66-2.121s2.654.896 2.654 2.12c0 1.061-.738 1.595-1.336 1.782v.065c.703.152 1.647.744 1.647 1.992Zm-4.347-3.71c0 .739.586 1.255 1.383 1.255s1.377-.516 1.377-1.254c0-.733-.58-1.23-1.377-1.23s-1.383.497-1.383 1.23Zm-.281 3.645c0 .838.72 1.412 1.664 1.412.943 0 1.658-.574 1.658-1.412 0-.843-.715-1.424-1.658-1.424-.944 0-1.664.58-1.664 1.424"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 717 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-8-square-fill" viewBox="0 0 16 16">
|
||||
<path d="M6.623 6.094c0 .738.586 1.254 1.383 1.254s1.377-.516 1.377-1.254c0-.733-.58-1.23-1.377-1.23s-1.383.497-1.383 1.23m-.281 3.644c0 .838.72 1.412 1.664 1.412.943 0 1.658-.574 1.658-1.412 0-.843-.715-1.424-1.658-1.424-.944 0-1.664.58-1.664 1.424"/>
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm8.97 9.803c0 1.394-1.218 2.355-2.988 2.355-1.763 0-2.953-.955-2.953-2.344 0-1.271.95-1.851 1.647-2.003v-.065c-.621-.193-1.33-.738-1.33-1.781 0-1.225 1.09-2.121 2.66-2.121s2.654.896 2.654 2.12c0 1.061-.738 1.595-1.336 1.782v.065c.703.152 1.647.744 1.647 1.992Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 737 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-8-square" viewBox="0 0 16 16">
|
||||
<path d="M10.97 9.803c0 1.394-1.218 2.355-2.988 2.355-1.763 0-2.953-.955-2.953-2.344 0-1.271.95-1.851 1.647-2.003v-.065c-.621-.193-1.33-.738-1.33-1.781 0-1.225 1.09-2.121 2.66-2.121s2.654.896 2.654 2.12c0 1.061-.738 1.595-1.336 1.782v.065c.703.152 1.647.744 1.647 1.992Zm-4.347-3.71c0 .739.586 1.255 1.383 1.255s1.377-.516 1.377-1.254c0-.733-.58-1.23-1.377-1.23s-1.383.497-1.383 1.23Zm-.281 3.645c0 .838.72 1.412 1.664 1.412.943 0 1.658-.574 1.658-1.412 0-.843-.715-1.424-1.658-1.424-.944 0-1.664.58-1.664 1.424"/>
|
||||
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 804 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-9-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.223 4.146c2.104 0 3.123-1.464 3.123-4.3 0-3.147-1.459-4.014-2.97-4.014-1.63 0-2.871 1.02-2.871 2.73 0 1.706 1.171 2.667 2.566 2.667 1.06 0 1.7-.557 1.934-1.184h.076c.047 1.67-.475 3.023-1.834 3.023-.71 0-1.149-.363-1.248-.72H5.258c.094.908.926 1.798 2.52 1.798Zm.118-3.972c.808 0 1.535-.528 1.535-1.594s-.668-1.676-1.56-1.676c-.838 0-1.517.616-1.517 1.659 0 1.072.708 1.61 1.54 1.61Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 574 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-9-circle" viewBox="0 0 16 16">
|
||||
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.223 4.146c-1.593 0-2.425-.89-2.52-1.798h1.296c.1.357.539.72 1.248.72 1.36 0 1.88-1.353 1.834-3.023h-.076c-.235.627-.873 1.184-1.934 1.184-1.395 0-2.566-.961-2.566-2.666 0-1.711 1.242-2.731 2.87-2.731 1.512 0 2.971.867 2.971 4.014 0 2.836-1.02 4.3-3.123 4.3m.118-3.972c.808 0 1.535-.528 1.535-1.594s-.668-1.676-1.56-1.676c-.838 0-1.517.616-1.517 1.659 0 1.072.708 1.61 1.54 1.61Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 597 B |