private void CaptureRaidOut(ChatMessage message) { const string raidPrefix = "/raid "; //if (message.UserId != myUserId || !message.Message.StartsWith(raidPrefix)) return; if (message.UserId != "61809127" || !message.Message.StartsWith(raidPrefix)) { return; } endOfStreamRaid = new RaidInfo { Channel = message.Message.Substring(raidPrefix.Length), EventTime = DateTime.UtcNow, ViewerCount = approximateCurrentViewerCount, }; }
public void Client_OnRaidNotification(object sender, OnRaidNotificationArgs e) { var channel = e.RaidNotificaiton.DisplayName; var info = new RaidInfo { Channel = channel, EventTime = DateTime.UtcNow, // TODO: get this from the timestamp ViewerCount = int.Parse(e.RaidNotificaiton.MsgParamViewerCount), }; lock (raids) { if (!raids.ContainsKey(channel)) { raids.Add(channel, info); } else { raids[channel] = info; } } }