From acf411c336ae28f1cd645c8ea09ed3e5030039ef Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Mon, 20 Nov 2017 03:49:05 +0100 Subject: [PATCH] .clubinfo will now show member's levels and order them by it, feathub#212 --- NadekoBot.Core/Modules/Xp/Club.cs | 20 ++++++++++++-------- NadekoBot.Core/Services/Impl/StatsService.cs | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/NadekoBot.Core/Modules/Xp/Club.cs b/NadekoBot.Core/Modules/Xp/Club.cs index 4dceab75..549ef457 100644 --- a/NadekoBot.Core/Modules/Xp/Club.cs +++ b/NadekoBot.Core/Modules/Xp/Club.cs @@ -129,23 +129,27 @@ namespace NadekoBot.Modules.Xp .AddField("Owner", club.Owner.ToString(), true) .AddField("Level Req.", club.MinimumLevelReq.ToString(), true) .AddField("Members", string.Join("\n", club.Users - .OrderByDescending(x => { + .OrderByDescending(x => + { + var l = new LevelStats(x.TotalXp).Level; if (club.OwnerId == x.Id) - return 2; + return int.MaxValue; else if (x.IsClubAdmin) - return 1; + return int.MaxValue / 2 + l; else - return 0; + return l; }) .Skip(page * 10) .Take(10) - .Select(x => + .Select(x => { + var l = new LevelStats(x.TotalXp); + var lvlStr = Format.Bold($" 『{l.Level}』"); if (club.OwnerId == x.Id) - return x.ToString() + "🌟"; + return x.ToString() + "🌟" + lvlStr; else if (x.IsClubAdmin) - return x.ToString() + "⭐"; - return x.ToString(); + return x.ToString() + "⭐" + lvlStr; + return x.ToString() + lvlStr; })), false); if (Uri.IsWellFormedUriString(club.ImageUrl, UriKind.Absolute)) diff --git a/NadekoBot.Core/Services/Impl/StatsService.cs b/NadekoBot.Core/Services/Impl/StatsService.cs index f376bf42..5cc91918 100644 --- a/NadekoBot.Core/Services/Impl/StatsService.cs +++ b/NadekoBot.Core/Services/Impl/StatsService.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl private readonly IBotCredentials _creds; private readonly DateTime _started; - public const string BotVersion = "2.5.6"; + public const string BotVersion = "2.5.7"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net";