From 5afd88991afa0b8f55dd8f648d0ec6187dc6aa28 Mon Sep 17 00:00:00 2001 From: Melissa Date: Sat, 18 Jan 2020 17:24:35 +0000 Subject: [PATCH] Changed the format of the Award List --- DiscordBot/Modules/AwardModule.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/DiscordBot/Modules/AwardModule.cs b/DiscordBot/Modules/AwardModule.cs index 6b10cdb..418ba13 100644 --- a/DiscordBot/Modules/AwardModule.cs +++ b/DiscordBot/Modules/AwardModule.cs @@ -168,9 +168,26 @@ public async Task ListAllAwards() List awardPages = new List(); Award.Awards.Select((v, i) => new { Value = v, Index = i / 10 }) .GroupBy(x => x.Index).ToList() - .ForEach(x => awardPages.Add(String.Join("\n", x.Select(z => z.Value.AwardText + " (ID: " + z.Value.AwardId + ")")))); + .ForEach(x => awardPages.Add(String.Join("\n", x.Select(z => + { + try + { + return z.Value.UserId.GetUser().Mention + " - " + z.Value.AwardText + " (ID: " + z.Value.AwardId + ")"; + } + catch (UserNotFoundException) + { + return z.Value.UserId + " - " + z.Value.AwardText + " (ID: " + z.Value.AwardId + ")"; + } + })))); + + PaginatedMessage msg = new PaginatedMessage() + { + Title = "Awards List", + Pages = awardPages, + Color = new Color(211, 214, 77) + }; - await PagedReplyAsync(awardPages); + await PagedReplyAsync(msg); } [MinPermissions(PermissionLevel.ServerAdmin)]