private static bool IsVote(string message, TwitchBot bot)
 {
     listePropositions = vote.getPropositions();
     if (listePropositions.Keys.Contains(message))
     {
         bot.SendAdminMessage("added proposition");
         vote.setValProposition(message, bot);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        public void endVote(TwitchBot bot)
        {
            this.isStartVoting = false;
            bot.SendAdminMessage("Le vote est terminé !");
            string recapMsg = "/me RECAP : ";
            string gagnant  = "";
            int    maxVal   = 0;

            foreach (KeyValuePair <string, int> prop in propositions)
            {
                if (prop.Value > maxVal)
                {
                    gagnant = "/me LE GAGNANT EST : " + prop.Key;
                }
                recapMsg += prop.Key + " : " + prop.Value.ToString() + ", ";
                maxVal    = prop.Value;
            }
            this.propositions.Clear();
            bot.SendAdminMessage(recapMsg);
            bot.SendAdminMessage(gagnant);
        }
Exemplo n.º 3
0
        public void StartVote(string propositionsVote, TwitchBot bot)
        {
            if (propositionsVote != "")
            {
                //Récupère les choix du vote déclarés après la commande "!vote"
                string[] msgPropos = propositionsVote.Split(' ');
                string   sendPropo = "Vote : ";
                foreach (string propo in msgPropos)
                {
                    sendPropo += "!" + propo + " ";
                    this.propositions.Add("!" + propo, 0);
                }

                bot.SendAdminMessage(sendPropo);
                this.isStartVoting = true;
            }
        }