Updated code formatting

This commit is contained in:
2025-05-30 12:09:48 +03:00
parent 11b9515bab
commit 81905460da
10 changed files with 36 additions and 26 deletions

View File

@@ -1,6 +1,4 @@
using DiscordBotCore.Logging;
using DiscordBotCore.PluginCore.Helpers;
using DiscordBotCore.PluginCore.Helpers.Execution.DbCommand;
using DiscordBotCore.PluginCore.Helpers.Execution.DbCommand;
namespace DiscordBotCore.PluginCore.Interfaces;

View File

@@ -1,5 +1,4 @@
using DiscordBotCore.PluginCore.Helpers;
using DiscordBotCore.PluginCore.Helpers.Execution.DbEvent;
using DiscordBotCore.PluginCore.Helpers.Execution.DbEvent;
namespace DiscordBotCore.PluginCore.Interfaces;

View File

@@ -122,7 +122,6 @@ internal class CommandHandler : ICommandHandler
cleanMessage = message.Content.Substring(mentionPrefix.Length + 1);
}
else
{
plugin = _pluginLoader.Commands!
@@ -137,16 +136,22 @@ internal class CommandHandler : ICommandHandler
}
if (plugin is null)
{
return;
}
if (plugin.RequireAdmin && !context.Message.Author.IsAdmin())
{
return;
}
var split = cleanMessage.Split(' ');
string[]? argsClean = null;
if (split.Length > 1)
{
argsClean = string.Join(' ', split, 1, split.Length - 1).Split(' ');
}
DbCommandExecutingArgument cmd = new(_logger,
context,
@@ -162,8 +167,13 @@ internal class CommandHandler : ICommandHandler
);
if (context.Channel is SocketDMChannel)
{
await plugin.ExecuteDm(cmd);
else await plugin.ExecuteServer(cmd);
}
else
{
await plugin.ExecuteServer(cmd);
}
}
catch (Exception ex)
{

View File

@@ -18,7 +18,7 @@ public class DiscordBotApplication : IDiscordBotApplication
private CommandService _Service;
private readonly ILogger _Logger;
private readonly IConfiguration _Configuration;
private readonly IPluginLoader _pluginLoader;
private readonly IPluginLoader _PluginLoader;
public bool IsReady { get; private set; }
@@ -31,7 +31,7 @@ public class DiscordBotApplication : IDiscordBotApplication
{
this._Logger = logger;
this._Configuration = configuration;
this._pluginLoader = pluginLoader;
this._PluginLoader = pluginLoader;
_InternalPluginLoader = pluginLoader;
}
@@ -86,7 +86,7 @@ public class DiscordBotApplication : IDiscordBotApplication
await client.StartAsync();
_CommandServiceHandler = new CommandHandler(_Logger, _pluginLoader, _Configuration, _Service);
_CommandServiceHandler = new CommandHandler(_Logger, _PluginLoader, _Configuration, _Service);
await _CommandServiceHandler.InstallCommandsAsync(client);
@@ -115,7 +115,7 @@ public class DiscordBotApplication : IDiscordBotApplication
private Task LoggedIn()
{
_Logger.Log("Successfully Logged In", this);
_pluginLoader.SetDiscordClient(Client);
_PluginLoader.SetDiscordClient(Client);
return Task.CompletedTask;
}

View File

@@ -5,6 +5,8 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="bootstrap/bootstrap.min.css"/>
<link rel="stylesheet" href="app.css"/>
<link rel="stylesheet" href="WebUI.styles.css"/>

View File

@@ -22,7 +22,7 @@
<div class="nav-item px-3">
<NavLink class="nav-link" href="plugins/online">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Online Plugins
<span class="bi bi-list" aria-hidden="true" style="align-self: center"></span> Online Plugins
</NavLink>
</div>

View File

@@ -13,8 +13,6 @@
@rendermode InteractiveServer
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="Components/Pages/Home.css" />
<div class="container-fluid d-flex flex-column p-3" style="height: 95vh;">
<div class="d-flex flex-wrap gap-2 mb-3">

View File

@@ -13,18 +13,21 @@
@inject NavigationManager Navigation
<h3>Installed Plugins</h3>
<table class="table table-responsive text-center align-middle">
<button class="btn btn-outline-success" @onclick="NavigateToAddPlugin">
<span class="bi me-1"></span> Add Local
</button>
<table class="table table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Version</th>
<th>Offline Added</th>
<th>Actions</th>
<th>
<button class="btn btn-outline-success" @onclick="NavigateToAddPlugin">
<span class="bi me-1"></span> Add Local
</button>
</th>
@* <th> *@
@* <button class="btn btn-outline-success" @onclick="NavigateToAddPlugin"> *@
@* <span class="bi me-1"></span> Add Local *@
@* </button> *@
@* </th> *@
</tr>
</thead>
<tbody>
@@ -41,7 +44,7 @@
<button class="btn btn-info btn-sm m-1" @onclick="async () => await PluginDetailsButtonClick(plugin)">Details</button>
}
</td>
<td></td>
@* <td></td> *@
</tr>
}
</tbody>

View File

@@ -1,6 +1,6 @@
using WebUI;
using WebUI.Components;
using WebUI.Services;
using WebUI.Components;
var builder = WebApplication.CreateBuilder(args);

View File

@@ -4,7 +4,6 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x64;ARM64</Platforms>
</PropertyGroup>
<ItemGroup>
@@ -13,6 +12,7 @@
<ProjectReference Include="..\DiscordBotCore.Logging\DiscordBotCore.Logging.csproj" />
<ProjectReference Include="..\DiscordBotCore.PluginManagement\DiscordBotCore.PluginManagement.csproj" />
<ProjectReference Include="..\DiscordBotCore\DiscordBotCore.csproj" />
</ItemGroup>
</Project>