Removed the WebUI. Removed the Modules

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

View File

@@ -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;" />

View File

@@ -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"/>

View File

@@ -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;" />

View File

@@ -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;" />