Exemplo n.º 1
0
        public void AddHelp(ModuleInfo module, EmbedBuilder builder)
        {
            foreach (var sub in module.Submodules)
            {
                AddHelp(sub, builder);
            }

            var sb         = new StringBuilder();
            var commands   = module.Commands.Select(x => $"`{x.Name}`").ToList();
            var subModules = module.Submodules.Select(m => m).ToList();

            if (!string.IsNullOrEmpty(module.Group))
            {
                sb.AppendLine($"Prefix: `{module.Group}`");
            }

            if (subModules.Any())
            {
                sb.AppendLine($"Submodule: {string.Join(", ", subModules.Select(x => x.Name))}");
            }

            if (commands.Any())
            {
                sb.AppendLine($"Befehle: {string.Join(", ", commands)}");
            }

            if (!string.IsNullOrEmpty(module.Summary))
            {
                sb.AppendLine($"Summary: {module.Summary}");
            }

            builder.AddField(f =>
            {
                f.Name  = $"**{module.FriendlyName()}**";
                f.Value = sb.ToString();
            });
        }