Removing bloat, fixing file names

This commit is contained in:
Kwoth
2023-03-11 09:10:37 +01:00
parent 8c8e9f7770
commit 1ad0bc33af
72 changed files with 210 additions and 2157 deletions

View File

@@ -0,0 +1,6 @@
namespace NadekoBot.Modules;
public interface IMedusaeRepositoryService
{
Task<List<ModuleItem>> GetModuleItemsAsync();
}

View File

@@ -6,6 +6,13 @@ namespace NadekoBot.Modules;
[OwnerOnly]
public partial class Medusa : NadekoModule<IMedusaLoaderService>
{
private readonly IMedusaeRepositoryService _repo;
public Medusa(IMedusaeRepositoryService repo)
{
_repo = repo;
}
[Cmd]
[OwnerOnly]
public async Task MedusaLoad(string? name = null)
@@ -190,13 +197,34 @@ public partial class Medusa : NadekoModule<IMedusaLoaderService>
foreach (var medusa in medusae.Skip(page * 9).Take(9))
{
eb.AddField(medusa.Name,
$@"`Sneks:` {medusa.Sneks.Count}
`Commands:` {medusa.Sneks.Sum(x => x.Commands.Count)}
--
{medusa.Description}");
$"""
`Sneks:` {medusa.Sneks.Count}
`Commands:` {medusa.Sneks.Sum(x => x.Commands.Count)}
--
{medusa.Description}
""");
}
return eb;
}, medusae.Count, 9);
}
[Cmd]
[OwnerOnly]
public async Task MedusaSearch()
{
var eb = _eb.Create()
.WithTitle(GetText(strs.list_of_medusae))
.WithOkColor();
foreach (var item in await _repo.GetModuleItemsAsync())
{
eb.AddField(item.Name, $"""
{item.Description}
`{item.Command}`
""", true);
}
await ctx.Channel.EmbedAsync(eb);
}
}

View File

@@ -0,0 +1,6 @@
public class ModuleItem
{
public string Name { get; init; }
public string Description { get; init; }
public string Command { get; init; }
}

View File

@@ -0,0 +1,22 @@
namespace NadekoBot.Modules;
public class MedusaeRepositoryService : IMedusaeRepositoryService, INService
{
public async Task<List<ModuleItem>> GetModuleItemsAsync()
{
// Simulate retrieving data from a database or API
await Task.Delay(100);
return new List<ModuleItem>
{
new ModuleItem { Name = "RSS Reader", Description = "Keep up to date with your favorite websites", Command = ".meinstall rss" },
new ModuleItem { Name = "Password Manager", Description = "Safely store and manage all your passwords", Command = ".meinstall passwordmanager" },
new ModuleItem { Name = "Browser Extension", Description = "Enhance your browsing experience with useful tools", Command = ".meinstall browserextension" },
new ModuleItem { Name = "Video Downloader", Description = "Download videos from popular websites", Command = ".meinstall videodownloader" },
new ModuleItem { Name = "Virtual Private Network", Description = "Securely browse the web and protect your privacy", Command = ".meinstall vpn" },
new ModuleItem { Name = "Ad Blocker", Description = "Block annoying ads and improve page load times", Command = ".meinstall adblocker" },
new ModuleItem { Name = "Cloud Storage", Description = "Store and share your files online", Command = ".meinstall cloudstorage" },
new ModuleItem { Name = "Social Media Manager", Description = "Manage all your social media accounts in one place", Command = ".meinstall socialmediamanager" },
new ModuleItem { Name = "Code Editor", Description = "Write and edit code online", Command = ".meinstall codeeditor" }
};
}
}

View File

@@ -0,0 +1,8 @@
namespace NadekoBot.Modules;
public class ModuleItem
{
public string Name { get; init; }
public string Description { get; init; }
public string Command { get; init; }
}