.prune removed, Cards are now per-server, trivia fixed, more stats
This commit is contained in:
@@ -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.`";
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user