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); }
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); }
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; } }