This is what i have at the moment. Helper.GetCategoriesOfCommands() just gets a list of attributes that hold Names and Descriptions.
[SlashCommand("help", "Help Command")] // let's define this method as a command
public async Task HelpCommand(InteractionContext ctx) // this command takes no arguments
{
var categories = Helper.GetCategoriesOfCommands();
var options = new List<DiscordSelectComponentOption>();
foreach (var category in categories)
{
if(options.Count != 0)
options.Add(new DiscordSelectComponentOption(
$"{category.Name} Commands",
category.Name,
category.Description,
isDefault: true,
emoji: new DiscordComponentEmoji(854260064906117121))
);
options.Add(new DiscordSelectComponentOption(
$"{category.Name} Commands",
category.Name,
category.Description,
emoji: new DiscordComponentEmoji(854260064906117121))
);
}
// Make the dropdown
var dropdown = new DiscordSelectComponent("dropdown", null, options, false, 1, 2);
var builder = new DiscordInteractionResponseBuilder()
.WithContent("Look, it's a dropdown!")
.AddComponents(dropdown);
// respond with the word "Example"
await ctx.CreateResponseAsync(builder);
}