コード例 #1
0
        public void Tick()
        {
            if (TwitchSurvey is null)
            {
                return;
            }
            if (DateTime.Now < TwitchSurvey.EndDate)
            {
                return;
            }

            var result = TwitchSurvey.GetResult();

            InformationManager.DisplayMessage(new InformationMessage($"Chat has voted : '{result ?? "nothing"}'"));

            TwitchSurvey = null;
        }
コード例 #2
0
        public void StartSurvey(Dictionary <int, string> choices)
        {
            if (!TwitchClient.IsConnected)
            {
                return;
            }

            var message = "It's up to you now, choose the answer:";

            foreach (var choice in choices)
            {
                message += string.Concat("\r", choice.Key, " : ", choice.Value);
            }

            TwitchClient.SendMessage(channel: TwitchConfiguration.UserName, message);
            TwitchSurvey = new TwitchSurvey(choices);
        }