예제 #1
0
        ///////////////////////////////////////////////////////////////
        // Twitchチャットクライアント起動/停止
        ///////////////////////////////////////////////////////////////
        /// <summary>
        /// Twitchチャットを開始する
        /// </summary>
        private void TwitchChatClientStart(string nickName, string password, string channelName)
        {
            ChannelName = channelName;

            string chatChannelName = ChatChannelNamePrefix + channelName;

            TwitchChatClient                    = new TwitchChatClient(this, nickName, password);
            TwitchChatClient.OnStop            += TwitchChatClient_OnStop;
            TwitchChatClient.OnBusyChange      += TwitchChatClient_OnBusyChange;
            TwitchChatClient.OnChannelMessage  += TwitchChatClient_OnChannelMessage;
            TwitchChatClient.OnTopic           += TwitchChatClient_OnTopic;
            TwitchChatClient.OnUserCountChange += TwitchChatClient_OnUserCountChange;
            TwitchChatClient.OnModeChange      += TwitchChatClient_OnModeChange;
            TwitchChatClient.OnQueryMessage    += TwitchChatClient_OnQueryMessage;

            if (!TwitchChatListen.TwitchChatClient.IsValidChannelFormat(chatChannelName))
            {
                MessageBox.Show("チャンネル名の書式が間違っています。");
                return;
            }
            // チャットに接続
            TwitchChatClient.Start(new string[] { chatChannelName });
        }