mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Removing bloat, fixing file names
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace NadekoBot.Modules;
|
||||
|
||||
public interface IMedusaeRepositoryService
|
||||
{
|
||||
Task<List<ModuleItem>> GetModuleItemsAsync();
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
6
src/NadekoBot/Modules/Medusae/MedusaItem.cs
Normal file
6
src/NadekoBot/Modules/Medusae/MedusaItem.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
public class ModuleItem
|
||||
{
|
||||
public string Name { get; init; }
|
||||
public string Description { get; init; }
|
||||
public string Command { get; init; }
|
||||
}
|
22
src/NadekoBot/Modules/Medusae/MedusaeRepositoryService.cs
Normal file
22
src/NadekoBot/Modules/Medusae/MedusaeRepositoryService.cs
Normal 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" }
|
||||
};
|
||||
}
|
||||
}
|
8
src/NadekoBot/Modules/Medusae/ModuleItem.cs
Normal file
8
src/NadekoBot/Modules/Medusae/ModuleItem.cs
Normal 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; }
|
||||
}
|
Reference in New Issue
Block a user