Ejemplo n.º 1
0
        public async Task ViewNomination()
        {
            Console.WriteLine("Got view nominations request");
            var noms = _nominationsService.GetNominations();

            if (!noms.Any())
            {
                return;
            }

            var sb = new StringBuilder();

            foreach (var n in noms)
            {
                sb.AppendLine($"{n.VotingId}. {n.Name}");
            }

            await ReplyAsync(sb.ToString());
        }
Ejemplo n.º 2
0
        public async Task Start()
        {
            if (!_votingService.VotingOpen())
            {
                if (_nominationsService.GetNominations().Any())
                {
                    _votingService.StartVote();
                    Console.WriteLine("Starting voting session");

                    await ReplyAsync("Voting has opened!");
                    await ReplyAsync(_nominationsService.ViewNominationsWithId());
                }
                else
                {
                    await ReplyAsync("There must be at least one nomination before voting can start!");
                }
            }
            else
            {
                await ReplyAsync("There is already a vote in progress!");
            }
        }