Hey guys I'm trying to make an /help command for my bot but I have few errors this is my code:
[SlashCommand("help", "Help Command")]
[EnabledInDm(false)]
public async Task HelpAsync()
{
string prefix = "/"; // komutlar için kullanılacak ön ek
var builder = new EmbedBuilder()
.WithTitle("Commands")
.WithColor(Color.DarkBlue);
foreach (var module in _service.Modules)
{
string description = "";
foreach (var command in module.Commands)
{
var result = await command.CheckPreconditionsAsync(Context);
if (result.IsSuccess)
{
description += $"{prefix}{command.Aliases.First()} - {command.Summary}\n";
}
}
if (!string.IsNullOrWhiteSpace(description))
{
builder.AddField(x =>
{
x.Name = module.Name;
x.Value = description;
x.IsInline = false;
});
}
}
await ReplyAsync("", false, builder.Build());
}