.prune removed, Cards are now per-server, trivia fixed, more stats

This commit is contained in:
Master Kwoth
2016-02-10 23:35:19 +01:00
parent 8bf7961aef
commit 5977bcd2b6
4 changed files with 63 additions and 61 deletions

View File

@@ -61,6 +61,7 @@ namespace NadekoBot
//$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" +
$"\n`Heap: {Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString()} MB`" +
$"\n`Commands Ran this session: {_commandsRan}`" +
$"\n`Message queue size:{_client.MessageQueue.Count}`" +
$"\n`Greeted/Byed {Commands.ServerGreetCommand.Greeted} times.`";
}

View File

@@ -20,15 +20,15 @@ namespace NadekoBot.Classes.Trivia {
Reload();
}
public TriviaQuestion GetRandomQuestion(List<TriviaQuestion> exclude) =>
pool.Except(exclude).FirstOrDefault();
public TriviaQuestion GetRandomQuestion(List<TriviaQuestion> exclude) =>
pool.Except(exclude).ToList()[_r.Next(0, pool.Count)];
internal void Reload() {
JArray arr = JArray.Parse(File.ReadAllText("data/questions.txt"));
foreach (var item in arr) {
TriviaQuestion tq;
tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(),item["Category"]?.ToString());
tq = new TriviaQuestion(item["Question"].ToString(), item["Answer"].ToString(), item["Category"]?.ToString());
pool.Add(tq);
}
var r = new Random();