src/DiscordBot/Core/Functions.cs
/// <summary>
/// Returns a list of dictionaries with the category of the command as a key and the command itself as the value.
/// </summary>
Returns a list of dictionaries with the category of the command as a key and the command itself as the value.
Returns a list of dictionaries with the category of the command as a key and the command itself as the value .
public static List<HelpEntry> GetHelpList(CommandService cmd)
        {
            var helpEntries = new List<HelpEntry>();
            foreach(var command in cmd.Commands)
            {
                string paramDescription = "";
                foreach(var param in command.Parameters)
                {
                    if (param.Name.Equals("nothing")) break; 
                    paramDescription += $"[{param.Name}]";
                    if (param.IsOptional) paramDescription += "*";
                    paramDescription += ", ";
                }
                paramDescription = paramDescription.TrimEnd(' ').TrimEnd(',');
                HelpEntry entry = new HelpEntry
                {
                    name = command.Name,
                    category = command.Remarks,
                    parameters = paramDescription,
                    description = command.Summary
                };
                helpEntries.Add(entry);
            }
            return helpEntries;
        }
public static List < HelpEntry > GetHelpList ( CommandService cmd ) { var helpEntries = new List < HelpEntry > ( ) ; foreach ( var command in cmd . Commands ) { string paramDescription = " " ; foreach ( var param in command . Parameters ) { if ( param . Name . Equals ( " " ) ) break ; paramDescription += $" [ { param . Name } ] " ; if ( param . IsOptional ) paramDescription += " " ; paramDescription += " " ; } paramDescription = paramDescription . TrimEnd ( ' ' ) . TrimEnd ( ' ' ) ; HelpEntry entry = new HelpEntry { name = command . Name , category = command . Remarks , parameters = paramDescription , description = command . Summary } ; helpEntries . Add ( entry ) ; } return helpEntries ; }
Returns a list of dictionaries with the category of the command as a key and the command itself as the value.
Returns a list of dictionaries with the category of the command as a key and the command itself as the value .
// Break if the parameter exists just to allow users to type after the command without consequence.
cmd
CommandService