Ejemplo n.º 1
0
        public override Func <CommandEventArgs, Task> DoFunc() =>
        async e => {
            if (runningContests.ContainsKey(e.User.Server.Id) && runningContests[e.User.Server.Id].IsActive)
            {
                await e.Send($"Contest already running in { runningContests[e.User.Server.Id].Channell.Mention } channel.");

                return;
            }
            if (runningContests.ContainsKey(e.User.Server.Id) && !runningContests[e.User.Server.Id].IsActive)
            {
                await runningContests[e.User.Server.Id].Start();
                return;
            }
            var tg = new TypingGame(e.Channel);
            runningContests.Add(e.Server.Id, tg);
            await tg.Start();
        };
Ejemplo n.º 2
0
 public override Func<CommandEventArgs, Task> DoFunc() =>
     async e => {
         if (runningContests.ContainsKey(e.User.Server.Id) && runningContests[e.User.Server.Id].IsActive) {
             await e.Send($"Contest already running in { runningContests[e.User.Server.Id].Channell.Mention } channel.");
             return;
         }
         if (runningContests.ContainsKey(e.User.Server.Id) && !runningContests[e.User.Server.Id].IsActive) {
             await runningContests[e.User.Server.Id].Start();
             return;
         }
         var tg = new TypingGame(e.Channel);
         runningContests.Add(e.Server.Id, tg);
         await tg.Start();
     };