Esempio n. 1
0
 public WhisperRequestEventArgs(TwitchTags tags, string user, string requestName,
                                string requestValue, string raw) :
     base(tags, user, string.Format("{0} {1}", requestName, requestValue), raw)
 {
     this.RequestName  = requestName;
     this.RequestValue = requestValue;
 }
Esempio n. 2
0
 public PrivRequestEventArgs(TwitchTags tags, string user, string channel,
                             string requestName, string requestValue, string message, string raw) :
     base(tags, user, channel, message, raw)
 {
     this.RequestName  = requestName;
     this.RequestValue = requestValue;
 }
Esempio n. 3
0
        private void CreateMessageAndRaise(ITwitchClient client, string tags, string user,
                                           string message, string raw)
        {
            TwitchTags       twitchTags = new TwitchTags(tags);
            WhisperEventArgs e          = new WhisperEventArgs(twitchTags, user, message, raw);

            client.OnEvent(e);
        }
Esempio n. 4
0
        private void CreateMessageAndRaise(ITwitchClient client, string tags, string user,
                                           string channel, string message, string raw)
        {
            TwitchTags    twitchTags = new TwitchTags(tags);
            PrivEventArgs e          = new PrivEventArgs(twitchTags, user, channel, message, raw);

            client.OnEvent(e);
        }
Esempio n. 5
0
 public AbstractUserMessageEventArgs(TwitchTags tags, string user,
                                     string message, string raw)
 {
     this.tags    = tags;
     this.User    = user;
     this.Message = message;
     this.Raw     = raw;
 }
Esempio n. 6
0
 public AbstractOperationRequestEventArgs(TwitchTags tags, string user,
                                          string operation, string requestName, string requestValue, string raw)
     : base(tags, user, string.Format("!op {0} {1} {2}", operation,
                                      requestName, requestValue), raw)
 {
     this.Operation    = operation;
     this.RequestName  = requestName;
     this.RequestValue = requestValue;
 }
Esempio n. 7
0
        private void CreateRequestAndRaise(ITwitchClient client, string tags, string user,
                                           string message, string raw)
        {
            Regex           r  = new Regex(requestRegex);
            MatchCollection mc = r.Matches(message);

            if (mc.Count == 1)
            {
                string          requestName  = string.Empty;
                string          requestValue = string.Empty;
                GroupCollection gc           = mc[0].Groups;
                requestName  = gc[1].Value;
                requestValue = gc[2].Value;

                TwitchTags twitchTags     = new TwitchTags(tags);
                WhisperRequestEventArgs e = new WhisperRequestEventArgs(twitchTags, user,
                                                                        requestName, requestValue, raw);
                client.OnEvent(e);
            }
            else
            {
                CreateMessageAndRaise(client, tags, user, message, raw);
            }
        }
Esempio n. 8
0
 public InfoOperationRequestEventArgs(TwitchTags tags, string user,
                                      string requestName, string requestValue, string raw)
     : base(tags, user, "info", requestName, requestValue, raw)
 {
 }
Esempio n. 9
0
 public EditOperationRequestEventArgs(TwitchTags tags, string user, string requestTags,
                                      string requestName, string requestValue, string raw) :
     base(tags, user, "edit", requestName, requestValue, raw)
 {
     this.requestTags = new TwitchTags(requestTags);
 }
Esempio n. 10
0
 public DeleteOperationRequestEventArgs(TwitchTags tags, string user,
                                        string requestName, string requestValue, string raw)
     : base(tags, user, "delete", requestName, requestValue, raw)
 {
 }
Esempio n. 11
0
 public CancelOperationRequestEventArgs(TwitchTags tags, string user,
                                        string requestName, string requestValue, string raw)
     : base(tags, user, "cancel", requestName, requestValue, raw)
 {
 }
Esempio n. 12
0
        public void CreateEventAndRaise(ITwitchClient client, string raw)
        {
            Regex           r  = new Regex(AcceptingRegex);
            MatchCollection mc = r.Matches(raw);

            if (mc.Count == 1)
            {
                GroupCollection gc = mc[0].Groups;

                string     rawTags, user, operation, opTags, requestName, requestValue;
                TwitchTags tags;

                if (!string.IsNullOrEmpty(gc[1].Value))
                {
                    rawTags      = gc[1].Value;
                    tags         = new TwitchTags(rawTags);
                    user         = gc[2].Value;
                    operation    = gc[3].Value;
                    opTags       = gc[4].Value;
                    requestName  = gc[5].Value;
                    requestValue = gc[6].Value;
                }
                else
                {
                    rawTags      = gc[7].Value;
                    tags         = new TwitchTags(rawTags);
                    user         = gc[8].Value;
                    operation    = "edit";
                    opTags       = string.Empty;
                    requestName  = gc[9].Value;
                    requestValue = gc[10].Value;
                }

                if (operation.Equals("add", StringComparison.CurrentCultureIgnoreCase))
                {
                    AddOperationRequestEventArgs e = new AddOperationRequestEventArgs(tags,
                                                                                      user, opTags, requestName, requestValue, raw);
                    if (RequestUtils.IsModOrBroadcaster(e))
                    {
                        client.OnEvent(e);
                    }
                }
                else if (operation.Equals("cancel", StringComparison.CurrentCultureIgnoreCase))
                {
                    CancelOperationRequestEventArgs e = new CancelOperationRequestEventArgs(
                        tags, user, requestName, requestValue, raw);
                    if (RequestUtils.IsModOrBroadcaster(e))
                    {
                        client.OnEvent(e);
                    }
                }
                else if (operation.Equals("delete", StringComparison.CurrentCultureIgnoreCase))
                {
                    DeleteOperationRequestEventArgs e = new DeleteOperationRequestEventArgs(
                        tags, user, requestName, requestValue, raw);
                    if (RequestUtils.IsModOrBroadcaster(e))
                    {
                        client.OnEvent(e);
                    }
                }
                else if (operation.Equals("edit", StringComparison.CurrentCultureIgnoreCase))
                {
                    EditOperationRequestEventArgs e = new EditOperationRequestEventArgs(
                        tags, user, opTags, requestName, requestValue, raw);
                    if (RequestUtils.IsModOrBroadcaster(e))
                    {
                        client.OnEvent(e);
                    }
                }
                else if (operation.Equals("info", StringComparison.CurrentCultureIgnoreCase))
                {
                    InfoOperationRequestEventArgs e = new InfoOperationRequestEventArgs(
                        tags, user, requestName, requestValue, raw);
                    if (RequestUtils.IsModOrBroadcaster(e))
                    {
                        client.OnEvent(e);
                    }
                }
            }
        }
Esempio n. 13
0
 public WhisperEventArgs(TwitchTags tags, string user, string message, string raw) :
     base(tags, user, message, raw)
 {
 }
Esempio n. 14
0
 internal PrivEventArgs(TwitchTags tags, string user, string channel,
                        string message, string raw) : base(tags, user, message, raw)
 {
     this.Channel = channel;
 }