Updated ICommandAction.cs and DBEvent.cs. Removed thread request from DBEvent and added special thread request to ICommandAction.cs

This commit is contained in:
2024-07-22 19:20:17 +03:00
parent 08c5febd66
commit 8c338820c5
42 changed files with 691 additions and 26 deletions

47
Plugins/WebUI/Program.cs Normal file
View File

@@ -0,0 +1,47 @@
using DiscordBotCore.Interfaces;
using DiscordBotCore.Others;
using DiscordBotCore.Others.Actions;
using WebUI.Components;
public class Entry: ICommandAction
{
public string ActionName => "WebUI";
public string? Description => "Starts the WebUI";
public string? Usage => "webui";
public IEnumerable<InternalActionOption> ListOfOptions => [];
public InternalActionRunType RunType => InternalActionRunType.OnStartup;
public bool RequireOtherThread => true;
public Task Execute(string[]? args)
{
var builder = WebApplication.CreateBuilder();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
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();
return Task.CompletedTask;
}
}