Esempio n. 1
0
        public Task ExecuteGroupAsync(CommandContext ctx,
                                      [Description("desc-module")] ModuleType module)
        {
            Command?cmd = ctx.CommandsNext.FindCommand(module.ToString(), out string _);

            if (cmd is CommandGroup group && group.IsExecutableWithoutSubcommands)
            {
                return(this.ExecuteGroupAsync(ctx, module.ToString()));
            }

            IReadOnlyList <string> cmds = this.Service.GetCommandsInModule(module);

            return(ctx.RespondWithLocalizedEmbedAsync(emb => {
                emb.WithColor(module.ToDiscordColor());
                emb.WithLocalizedTitle("h-title-m", module);
                emb.WithLocalizedDescription(module.ToLocalizedDescriptionKey(), cmds.Select(s => Formatter.InlineCode(s)).JoinWith(", "));
                emb.WithLocalizedFooter("h-footer", ctx.Client.CurrentUser.AvatarUrl);
            }));
        }