예제 #1
0
        public async Task HelpAsync()
        {
            var commandService = (ICommandService)Context.Bot;
            var modules        = commandService.GetAllModules();

            var moduleStringJoiner = new StringJoiner(", ");

            foreach (var module in modules)
            {
                moduleStringJoiner.Append(Markdown.Code(module.Name));
            }

            var helpEmbedBuilder = new LocalEmbedBuilder {
                Color  = Constants.EspeonColour,
                Title  = "Espeon's Help",
                Author = new LocalEmbedAuthorBuilder {
                    IconUrl = Context.Member.GetAvatarUrl(),
                    Name    = Context.Member.DisplayName
                },
                ThumbnailUrl = Context.Guild.CurrentMember.GetAvatarUrl(),
                Footer       = new LocalEmbedFooterBuilder {
                    Text = $"Execute \"{GetPrefix()} module\" to view help for that module"
                },
                Fields =
                {
                    new LocalEmbedFieldBuilder {
                        Name  = "Modules",
                        Value = moduleStringJoiner.ToString()
                    }
                }
            };

            var delete = new DeleteOnReaction(Context.User.Id, async() => await ReplyAsync(embed: helpEmbedBuilder.Build()));
            await Context.Channel.StartMenuAsync(delete);
        }
예제 #2
0
        public async Task HelpAsync([Remainder] IEnumerable <Command> commands)
        {
            var embeds = commands.Select(CreateEmbedForCommandHelp).ToList();

            if (embeds.Count == 1)
            {
                var delete = new DeleteOnReaction(Context.User.Id, async() => await ReplyAsync(embed: embeds[0].Build()));
                await Context.Channel.StartMenuAsync(delete);

                return;
            }

            await SendPagedHelpAsync(embeds);
        }
예제 #3
0
        public async Task HelpAsync([Remainder] Module module)
        {
            var(commandNamesString, commandAliasesString) = CreateCommandStrings(module.Commands);
            var submoduleString = CreateSubmoduleString(module.Submodules);

            var helpEmbedBuilder = CreateModuleHelpEmbed(
                module,
                commandNamesString,
                commandAliasesString,
                submoduleString);

            var delete = new DeleteOnReaction(Context.User.Id, async() => await ReplyAsync(embed: helpEmbedBuilder.Build()));
            await Context.Channel.StartMenuAsync(delete);
        }