<commit_before>﻿using System;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using MinecraftQuery;
using Mitternacht.Common.Attributes;
using Mitternacht.Extensions;
using Mitternacht.Services.Impl;

namespace Mitternacht.Modules.Utility
{
    public partial class Utility
    {
        public class MinecraftNameCommands : MitternachtSubmodule
        {
            private readonly MojangApi _mapi;

            public MinecraftNameCommands(MojangApiService mapis)
            {
                _mapi = mapis.MojangApi;
            }

            [MitternachtCommand, Usage, Description, Aliases]
            [RequireContext(ContextType.Guild)]
            public async Task MinecraftUsernames(string username, DateTime? date = null)
            {
                try
                {
                    var accountinfo = await _mapi.GetAccountInfoAsync(username, date).ConfigureAwait(false);
                    var accountnames = await _mapi.GetAllAccountNamesAsync(accountinfo.Uuid).ConfigureAwait(false);

                    var names = accountnames.Select(kv =>
                        kv.Key == DateTime.MinValue ? $"- {kv.Value}" : $"- {kv.Value} (> {kv.Key:dd.MM.yyyy})").ToList();

                    const int namesPerPage = 20;

                    var pages = (int)Math.Ceiling(names.Count * 1d / namesPerPage);

                    await Context.Channel.SendPaginatedConfirmAsync((DiscordSocketClient) Context.Client, 0, p =>
                            new EmbedBuilder().WithOkColor().WithTitle(GetText("mc_title", accountinfo.Name, names.Count))
                                .WithDescription(string.Join("\n", names.Skip(p * namesPerPage).Take(namesPerPage))),
                        pages-1,
                        reactUsers: new[] {Context.User as IGuildUser});
                }
                catch (Exception e)
                {
                    await ReplyErrorLocalized("mc_error", e.Message).ConfigureAwait(false);
                }
            }
        }
    }
    
}<commit_msg>Reversed order of names printed by minecraftusernames cmd<commit_after>﻿using System;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using MinecraftQuery;
using Mitternacht.Common.Attributes;
using Mitternacht.Extensions;
using Mitternacht.Services.Impl;

namespace Mitternacht.Modules.Utility
{
    public partial class Utility
    {
        public class MinecraftNameCommands : MitternachtSubmodule
        {
            private readonly MojangApi _mapi;

            public MinecraftNameCommands(MojangApiService mapis)
            {
                _mapi = mapis.MojangApi;
            }

            [MitternachtCommand, Usage, Description, Aliases]
            [RequireContext(ContextType.Guild)]
            public async Task MinecraftUsernames(string username, DateTime? date = null)
            {
                try
                {
                    var accountinfo = await _mapi.GetAccountInfoAsync(username, date).ConfigureAwait(false);
                    var accountnames = await _mapi.GetAllAccountNamesAsync(accountinfo.Uuid).ConfigureAwait(false);

                    var names = accountnames.Select(kv =>
                        kv.Key == DateTime.MinValue ? $"- {kv.Value}" : $"- {kv.Value} (> {kv.Key:dd.MM.yyyy})").Reverse().ToList();

                    const int namesPerPage = 20;

                    var pages = (int)Math.Ceiling(names.Count * 1d / namesPerPage);

                    await Context.Channel.SendPaginatedConfirmAsync((DiscordSocketClient) Context.Client, 0, p =>
                            new EmbedBuilder().WithOkColor().WithTitle(GetText("mc_title", accountinfo.Name, names.Count))
                                .WithDescription(string.Join("\n", names.Skip(p * namesPerPage).Take(namesPerPage))),
                        pages-1,
                        reactUsers: new[] {Context.User as IGuildUser});
                }
                catch (Exception e)
                {
                    await ReplyErrorLocalized("mc_error", e.Message).ConfigureAwait(false);
                }
            }
        }
    }
    
}
{'fraction_non_alphanumeric': 0.09385342789598108, 'fraction_numerical': 0.002364066193853428, 'mean_word_length': 1.9039121482498285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2009824', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1090, 'n_words': 213}