Question: Creating a bot with a command grouping function for organization and formatting.

I was thinking of creating a public enum with each group option like

```
public enum CommandGroups
{
    Information,
    Admin,
    Owner,
    etc
}

```

Then defining it with a public object within the command creation

```
public Command SetGroup(CommandGroups group)
{
    this.group = group;
    return this;
}

```

So when issuing a help command, something like this would return, granted after some formatting

```
Information: about, stats
Admin: kick, ban, mute
Owner: reload

```

The problem that I thought is, can you even use reflection on an enum like this?
Or should I try a different way?

Answer: 
Consider storing all your Command objects in something like a `Dictionary<CommandGroups, List<Command>>`. Then, assuming your Command class has a `Name` property on it that exposes the verbs such as "about", "kick", "ban", etc., you could do:

```

// assuming "groups" is the dictionary:
foreach (var kvp in groups)
{
  Console.WriteLine("{0}: {1}", kvp.Key, string.Join(", ", kvp.Value.Select(x => x.Name).ToArray()));
}

```
Any reason to not just define objects and specify the group you are using through a class with a name?

You have the benefit of having a much simpler and easier to follow design, and you can store the commands without any additional magic

```
public class Command
{
    public int Id {get;set;}
    public string Name {get;set;}
}

public class CommandGroup
{
   public string Name {get;set;}
   public IEnumerable<Commands> Commands {get;set;}
}

public class CommandGroupLookup
{

    public CommandGroupLookup()
    {
         //initialize from database or wherever 
    }

    private readonly Dictionary<string,CommandGroup> _commandGroup;
    public Command LookupGroup( string lookupCommandGroup )
    {
        return _commandGroup[lookupCommandGroup];
    }
}

```