Skip to content

Commit

Permalink
Modified listquotes and listrequestquotes to list quotes from the loa…
Browse files Browse the repository at this point in the history
…ded lists
  • Loading branch information
MythicalCuddles committed Jan 16, 2020
1 parent 3015cce commit eda5420
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions DiscordBot/Modules/Admin/AdminModule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -83,7 +84,13 @@ public async Task ListQuotes()
}

AdminLog.Log(Context.User.Id, Context.Message.Content, Context.Guild.Id);
//todo: print quotes.

List<string> quotePages = new List<string>();
Quote.Quotes.Select((v, i) => new { Value = v, Index = i / 10 })
.GroupBy(x => x.Index).ToList()
.ForEach(x => quotePages.Add(String.Join("\n", x.Select(z => z.Value.QuoteText + " (ID: " + z.Value.QId + ")"))));

await PagedReplyAsync(quotePages);
}

[Command("editquote"), Summary("Edit a quote from the list.")]
Expand Down Expand Up @@ -200,7 +207,12 @@ public async Task ListRequestQuotes()

AdminLog.Log(Context.User.Id, Context.Message.Content, Context.Guild.Id);

//todo: print quotes.
List<string> quotePages = new List<string>();
RequestQuote.RequestQuotes.Select((v, i) => new { Value = v, Index = i / 10 })
.GroupBy(x => x.Index).ToList()
.ForEach(x => quotePages.Add(String.Join("\n", x.Select(z => z.Value.QuoteText + " (ID: " + z.Value.RequestId + " | BY: " + z.Value.CreatedBy.GetUser().Mention + ")"))));

await PagedReplyAsync(quotePages);
}

[Command("acceptquote"), Summary("Add a quote to the list.")]
Expand Down

0 comments on commit eda5420

Please sign in to comment.