diff --git a/BLART/Commands/RoleCommands/RoleListCommand.cs b/BLART/Commands/RoleCommands/RoleListCommand.cs index f4bc992..e907eaf 100755 --- a/BLART/Commands/RoleCommands/RoleListCommand.cs +++ b/BLART/Commands/RoleCommands/RoleListCommand.cs @@ -9,6 +9,12 @@ public partial class RoleCommands [SlashCommand("list", "Lists available self-assignable roles.")] public async Task ListRoles() { + Dictionary roles = new Dictionary + { + ["Plugin Roles"] = "## Plugin Roles\n", + ["Misc Roles"] = "## Miscellaneous Roles\n" + }; + await DeferAsync(ephemeral: true); List roleIds = DatabaseHandler.GetSelfRoles(); @@ -16,10 +22,24 @@ public async Task ListRoles() builder.WithTitle("Self-Assignable Roles"); builder.WithFooter(EmbedBuilderService.Footer); builder.WithCurrentTimestamp(); - string description = string.Empty; - foreach (ulong roleId in roleIds) - description += $"<@&{roleId}>\n"; - builder.WithDescription(description); + foreach (ulong roleId in roleIds) + { + var role = Context.Guild.Roles.FirstOrDefault(role => role.Id == roleId); + + if (role is null) + continue; + + var channel = Context.Guild.TextChannels.FirstOrDefault(channel => channel.Name.ToLower() == role.Name.ToLower()); + if (channel is not null) + { + roles["Plugin Roles"] += $"<@&{roleId}> - Role for <#{channel.Id}>.\n"; + } + else + { + roles["Misc Roles"] += $"<@&{roleId}>\n"; + } + } + builder.WithDescription(roles["Plugin Roles"] + "\n" + roles["Misc Roles"]); builder.WithColor(Color.Green); await FollowupAsync(embed: builder.Build(), ephemeral: true);