Esempio n. 1
0
        public async Task SpellCheckAsync(EventContext context)
        {
            EmbedBuilder embed = Utils.Embed;

            embed.Title = "Spellcheck - top results";

            API.StringComparison.StringComparer          sc   = new API.StringComparison.StringComparer(context.EventSystem.GetCommandHandler <SimpleCommandHandler>().Commands.Select(z => z.Name));
            List <API.StringComparison.StringComparison> best = sc.CompareToAll(context.Arguments.ToString())
                                                                .OrderBy(z => z.score)
                                                                .ToList();
            int x = 1;

            foreach (API.StringComparison.StringComparison c in best)
            {
                embed.AddInlineField($"#{x}", c.ToString());
                x++;
                if (x > 16)
                {
                    break;
                }
            }

            embed.ToEmbed().QueueToChannel(context.Channel);

            await Task.Yield();
        }
Esempio n. 2
0
        public async Task SpellCheckAsync(EventContext context)
        {
            IDiscordEmbed embed = Utils.Embed;

            embed.SetTitle("Spellcheck - top results");

            API.StringComparison.StringComparer          sc   = new API.StringComparison.StringComparer(context.commandHandler.GetAllEventNames());
            List <API.StringComparison.StringComparison> best = sc.CompareToAll(context.arguments)
                                                                .OrderBy(z => z.score)
                                                                .ToList();
            int x = 1;

            foreach (API.StringComparison.StringComparison c in best)
            {
                embed.AddInlineField($"#{x}", c);
                x++;
                if (x > 16)
                {
                    break;
                }
            }

            embed.QueueToChannel(context.Channel);

            await Task.Yield();
        }