Example #1
0
        private void Client_OnFollow(object sender, TwitchLib.PubSub.Events.OnFollowArgs e)
        {
#if DEBUG
            Trace.WriteLine("Follow received!");
#endif
            try
            {
                SerialPortHelper.SendMessage(PortName, Alerts[0].Signal, Alerts[0].SignalType);
                EventHistory.TwitchEvents.Insert(0, new TwitchEvent(e.DisplayName, DateTime.Now, TwitchEventType.Follow));
            }
            catch (Exception ex)
            {
#if DEBUG
                Trace.WriteLine(ex.Message);
#endif
            }
        }
Example #2
0
        private void Client_OnChannelSubscription(object sender, TwitchLib.PubSub.Events.OnChannelSubscriptionArgs e)
        {
#if DEBUG
            Trace.WriteLine("Sub received!");
#endif
            try
            {
                SerialPortHelper.SendMessage(PortName, Alerts[1].Signal, Alerts[1].SignalType);
                EventHistory.TwitchEvents.Insert(0, new TwitchEvent(e.Subscription.Username, DateTime.Now, TwitchEventType.Sub));
            }
            catch (Exception ex)
            {
#if DEBUG
                Trace.WriteLine(ex.Message);
#endif
            }
        }
Example #3
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
            }
        }
Example #4
0
        private void ChatClient_OnBeingHosted(object sender, TwitchLib.Client.Events.OnBeingHostedArgs e)
        {
#if DEBUG
            Trace.WriteLine("Host received!");
#endif
            try
            {
                SerialPortHelper.SendMessage(PortName, Alerts[4].Signal, Alerts[4].SignalType);
                EventHistory.TwitchEvents.Add(new TwitchEvent(e.BeingHostedNotification.HostedByChannel, DateTime.Now, TwitchEventType.Host));
            }
            catch (Exception ex)
            {
#if DEBUG
                Trace.WriteLine(ex.Message);
#endif
            }
        }
Example #5
0
        private void ChatClient_OnMessageReceived(object sender, TwitchLib.Client.Events.OnMessageReceivedArgs e)
        {
            // Check if message contains an emote that is on the list.
            if (EmotesList.Any(x => e.ChatMessage.Message.Contains(x)))
            {
                // Send a signal.
                try
                {
#if DEBUG
                    Trace.WriteLine("Emote received!");
#endif
                    SerialPortHelper.SendMessage(PortName, Alerts[5].Signal, Alerts[5].SignalType);
                }
                catch (Exception ex)
                {
#if DEBUG
                    Trace.WriteLine(ex.Message);
#endif
                }
            }
        }