/// <summary> /// コメント受信イベント処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PluginHost_ReceivedComment(object sender, ReceivedCommentEventArgs e) { int count = e.CommentDataList.Count; if (count < 1) { return; } NicoLibrary.NicoLiveData.LiveCommentData commentData = e.CommentDataList[count - 1]; string commentNo = commentData.No; string anonymity = commentData.Anonymity; string comment = commentData.Comment; string userId = commentData.UserId; string kotehan = "184"; UserSettingInPlugin userSetting = pluginHost.GetUserSettingInPlugin(); foreach (UserSettingInPlugin.UserData userData in userSetting.UserDataList) { if (userData.UserId.Equals(userId)) { kotehan = userData.NickName; } } viWindow.AddVideoInfoCommand(commentNo, kotehan, comment); }
//コメント受信時イベントハンドラ void _host_ReceivedComment(object sender, ReceivedCommentEventArgs e) { //受信したコメント数を取り出す int count = e.CommentDataList.Count; if (count == 0) { return; } //最新のコメントデータを取り出す NicoLibrary.NicoLiveData.LiveCommentData commentData = e.CommentDataList[count - 1]; string comment = commentData.Comment; if (((commentData.PremiumBits & NicoLibrary.NicoLiveData.PremiumFlags.ServerComment) == NicoLibrary.NicoLiveData.PremiumFlags.ServerComment)) { form.addOpeCommentArray(comment); } else { if (form.getCheckBox() != true) { //コメント文字列を取り出す string user = commentData.Name; form.addCommentArray(user, comment); } } }
//コメント受信時イベントハンドラ void _host_ReceivedComment(object sender, ReceivedCommentEventArgs e) { //受信したコメント数を取り出す int count = e.CommentDataList.Count; if (count == 0) { return; } //最新のコメントデータを取り出す NicoLibrary.NicoLiveData.LiveCommentData commentData = e.CommentDataList[count - 1]; //コメント文字列を取り出す string comment = commentData.Comment; string UserId = commentData.UserId; string resMsg = UserId + "\t" + comment; Output(resMsg); }