Skip to content

Commit

Permalink
Changed the format of the Award List
Browse files Browse the repository at this point in the history
  • Loading branch information
MythicalCuddles committed Jan 18, 2020
1 parent 967c46c commit 5afd889
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions DiscordBot/Modules/AwardModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,26 @@ public async Task ListAllAwards()
List<string> awardPages = new List<string>();
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)]
Expand Down

0 comments on commit 5afd889

Please sign in to comment.