Exemplo n.º 1
0
        public async Task CommandHelp([Remainder] string command = "")
        {
            IUserMessage newMessage = await Context.Channel.SendMessageAsync("Fetching Commands...");

            List <CakeEmbedBuilder> helpPages = await _service.FetchAllCommandInfoAsPages(_commandService, command);

            if (helpPages.Count <= 0)
            {
                await newMessage.ModifyAsync(msg => msg.Content = "There is no matching command based on the search filter!");

                return;
            }
            await newMessage.ModifyAsync(msg => { msg.Embed = helpPages[0].Build(); msg.Content = string.Empty; });

            if (helpPages.Count != 1)
            {
                await newMessage.AddReactionsAsync(new Emoji[] { HelpBook.RightArrowEmoji, HelpBook.LeftArrowEmoji });

                HelpBook helpBook = new HelpBook(helpPages, newMessage.Id);

                MessageReactionHandler.AddMessageReactionHandle(helpBook);
            }
        }
Exemplo n.º 2
0
 private void DisposeThisHelpBook()
 {
     MessageReactionHandler.RemoveMessageReactionHandle(this);
     DisposeTimer();
 }