From 695aef54df455aa0789bcfd43ed5d1373c626900 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Mon, 29 Feb 2016 07:16:04 +0100 Subject: [PATCH] there we go --- .../Commands/TriviaCommand.cs~RF13c91205.TMP | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 NadekoBot/Commands/TriviaCommand.cs~RF13c91205.TMP diff --git a/NadekoBot/Commands/TriviaCommand.cs~RF13c91205.TMP b/NadekoBot/Commands/TriviaCommand.cs~RF13c91205.TMP deleted file mode 100644 index d9e00884..00000000 --- a/NadekoBot/Commands/TriviaCommand.cs~RF13c91205.TMP +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using NadekoBot.Extensions; -using System.Collections.Concurrent; -using Discord; -using TriviaGame = NadekoBot.Classes.Trivia.TriviaGame; - -namespace NadekoBot.Commands { - class Trivia : DiscordCommand { - public static ConcurrentDictionary runningTrivias = new ConcurrentDictionary(); - - public override Func DoFunc() => async e => { - TriviaGame trivia; - if (!runningTrivias.TryGetValue(e.Server, out trivia)) { - if(runningTrivias.TryAdd(e.Server, new TriviaGame(e))) - await e.Channel.SendMessage("**Trivia game started!**\nFirst player to get to 10 points wins! You have 30 seconds per question.\nUse command `tq` if game was started by accident.**"); - } else - await e.Channel.SendMessage("Trivia game is already running on this server.\n" + trivia.CurrentQuestion); - }; - - public override void Init(CommandGroupBuilder cgb) { - cgb.CreateCommand("t") - .Description("Starts a game of trivia.") - .Alias("-t") - .Do(DoFunc()); - - cgb.CreateCommand("tl") - .Description("Shows a current trivia leaderboard.") - .Alias("-tl") - .Alias("tlb") - .Alias("-tlb") - .Do(async e=> { - TriviaGame trivia; - if (runningTrivias.TryGetValue(e.Server, out trivia)) - await e.Channel.SendMessage(trivia.GetLeaderboard()); - else - await e.Channel.SendMessage("No trivia is running on this server."); - }); - - cgb.CreateCommand("tq") - .Description("Quits current trivia after current question.") - .Alias("-tq") - .Do(async e=> { - TriviaGame trivia; - if (runningTrivias.TryGetValue(e.Server, out trivia)) { - await trivia.StopGame(); - } else - await e.Channel.SendMessage("No trivia is running on this server."); - }); - } - } -}