예제 #1
0
 // Handles subscription event
 public static void handleSubscription(TwitchLib.TwitchChatClient.OnSubscriberArgs e)
 {
     Common.RecentSub = e.Subscriber;
     if (e.Subscriber.Months > 0)
     {
         WebCalls.addSoundbyteCredits(e.Subscriber.Name, resubSoundbytes);
         WebCalls.addDoubloons(e.Subscriber.Name, resubDoubloons);
         Common.ChatClient.SendMessage(string.Format("Welcome back returning crewmember {0}, of {1} months!!! burkeAhoy burkeFlag burkeAhoy burkeFlag",
                                                     e.Subscriber.Name, e.Subscriber.Months), Common.DryRun);
         Common.ChatClient.SendMessage(string.Format("Enjoy your resub booty of {0} doubloons and {1} sound byte credits, {2}!",
                                                     resubDoubloons, resubSoundbytes, e.Subscriber.Name), Common.DryRun);
     }
     else
     {
         WebCalls.addSoundbyteCredits(e.Subscriber.Name, newSubSoundbytes);
         WebCalls.addDoubloons(e.Subscriber.Name, newSubDoubloons);
         Common.ChatClient.SendMessage(string.Format("Welcome aboard matey! Please welcome the latest crewmember to the BurkeBlack crew, {0}! burkeAhoy burkeFlag burkeAhoy burkeFlag", e.Subscriber.Name), Common.DryRun);
         Common.ChatClient.SendMessage(string.Format("Enjoy your subscription booty of 100 doubloons and 5 sound byte credits, {0}!", e.Subscriber.Name), Common.DryRun);
     }
 }
예제 #2
0
 // Process message from event
 public void processMessage(TwitchLib.TwitchChatClient.OnMessageReceivedArgs e)
 {
     if (connectedMsgReceived)
     {
         if (e.ChatMessage.Message.ToLower().Contains("ahoy"))
         {
             if (!isFraud(e.ChatMessage.Username))
             {
                 if (first == null)
                 {
                     first = new ahoyReward(e.ChatMessage.Username, firstReward);
                     WebCalls.addDoubloons(first.Username, first.Reward);
                     Common.ChatClient.SendMessage(string.Format("/me rewarded {0} some doubloons ({1}) for the first Ahoy message! [auto] ", first.Username, first.Reward));
                     Common.relay(String.Format("[ahoy] First ahoy reward ({0} doubloons) awarded to: {1}", first.Reward, first.Username));
                 }
                 else if (second == null)
                 {
                     second = new ahoyReward(e.ChatMessage.Username, secondReward);
                     WebCalls.addDoubloons(second.Username, second.Reward);
                     Common.ChatClient.SendMessage(string.Format("/me rewarded {0} some doubloons ({1}) for the second Ahoy message! [auto] ", second.Username, second.Reward));
                     Common.relay(String.Format("[ahoy] Second ahoy reward ({0} doubloons) awarded to: {1}", second.Reward, second.Username));
                 }
                 else
                 {
                     third = new ahoyReward(e.ChatMessage.Username, thirdReward);
                     WebCalls.addDoubloons(third.Username, third.Reward);
                     Common.ChatClient.SendMessage(string.Format("/me rewarded {0} some doubloons ({1}) for the third Ahoy message! [auto] ", third.Username, third.Reward));
                     connectedMsgReceived = false;
                     Common.relay(String.Format("[ahoy] Third ahoy reward ({0} doubloons) awarded to: {1}", third.Reward, third.Username));
                 }
             }
         }
     }
     else
     {
         if (e.ChatMessage.Username.ToLower() == "burke_listener" && e.ChatMessage.Message.ToLower().Contains("connected!") && !e.ChatMessage.Message.ToLower().Contains("disconnect"))
         {
             connectedMsgReceived = true;
         }
     }
 }