コード例 #1
0
        private void Client_OnRaidNotification(object sender, TwitchLib.Client.Events.OnRaidNotificationArgs e)
        {
            Logger.Instance.LogMessage(TracingLevel.DEBUG, $"***Raid: {e.RaidNotification.DisplayName}");
            string userName = e.RaidNotification.DisplayName.ToLowerInvariant();

            dictUserMessages[userName] = DateTime.Now;
        }
コード例 #2
0
        private void ChatClient_OnRaidNotification(object sender, TwitchLib.Client.Events.OnRaidNotificationArgs e)
        {
#if DEBUG
            Trace.WriteLine("Raid received!");
#endif
            try
            {
                SerialPortHelper.SendMessage(PortName, Alerts[3].Signal, Alerts[3].SignalType);
                EventHistory.TwitchEvents.Add(new TwitchEvent(e.RaidNotification.DisplayName, DateTime.Now, TwitchEventType.Raid));
            }
            catch (Exception ex)
            {
#if DEBUG
                Trace.WriteLine(ex.Message);
#endif
            }
        }
コード例 #3
0
        private async void Instance_OnRaidReceived(object sender, TwitchLib.Client.Events.OnRaidNotificationArgs e)
        {
            Logger.Instance.LogMessage(TracingLevel.INFO, $"{e.RaidNotification.DisplayName} raided with {e.RaidNotification.MsgParamViewerCount} viewers");

            // Check if channel is live
            var channelInfo = await TwitchChannelInfoManager.Instance.GetChannelInfo(channelName);

            if (channelInfo != null && !channelInfo.IsLive)
            {
                Logger.Instance.LogMessage(TracingLevel.INFO, $"Not raising Raid event because channel isn't live");
                return;
            }

            // Send Chat Message
            if (!String.IsNullOrEmpty(global.RaidChatMessage))
            {
                TwitchChat.Instance.SendMessage(global.RaidChatMessage.Replace(@"\n", "\n").Replace("{USERNAME}", e.RaidNotification.Login).Replace("{DISPLAYNAME}", e.RaidNotification.DisplayName).Replace("{VIEWERS}", e.RaidNotification.MsgParamViewerCount));
            }

            if (!String.IsNullOrEmpty(global.RaidFlashMessage))
            {
                TwitchChat.Instance.RaisePageAlert(e.RaidNotification.DisplayName, global.RaidFlashMessage.Replace("{USERNAME}", e.RaidNotification.Login).Replace("{DISPLAYNAME}", e.RaidNotification.DisplayName).Replace("{VIEWERS}", e.RaidNotification.MsgParamViewerCount), global.RaidFlashColor);
            }
        }
コード例 #4
0
 private void _TwitchClient_OnRaidNotification(object sender, TwitchLib.Client.Events.OnRaidNotificationArgs e)
 {
     _TwitchClient.SendMessage(e.Channel,
                               $"@{e.RaidNotification.DisplayName} e sua raid chegando! " +
                               $"{EmotesConsts.PogChamp} {EmotesConsts.PogChamp} {EmotesConsts.PogChamp} {EmotesConsts.PogChamp} {EmotesConsts.PogChamp}");
 }
コード例 #5
0
 private void Client_OnRaidNotification(object sender, TwitchLib.Client.Events.OnRaidNotificationArgs e)
 {
     Logger.Instance.LogMessage(TracingLevel.DEBUG, $"***Raid: {e.RaidNotificaiton.DisplayName}");
 }