Пример #1
0
 public static void TwitchClipCreated(Twitch.Base.Models.NewAPI.Clips.ClipModel clip)
 {
     if (GlobalEvents.OnTwitchClipCreated != null)
     {
         GlobalEvents.OnTwitchClipCreated(null, clip);
     }
 }
        public override async Task <JObject> GetProcessedItem(UserViewModel user, IEnumerable <string> arguments, Dictionary <string, string> extraSpecialIdentifiers, StreamingPlatformTypeEnum platform)
        {
            JObject jobj = null;

            if (this.lastTwitchClip != null)
            {
                this.Platform    = StreamingPlatformTypeEnum.Twitch;
                this.lastClipURL = this.lastTwitchClip.embed_url + "&parent=localhost";
                if (this.Muted)
                {
                    this.lastClipURL += "&muted=true";
                }
                this.Effects.Duration = this.Duration = 30;

                this.lastTwitchClip = null;
            }

            if (!string.IsNullOrEmpty(this.lastClipURL))
            {
                jobj = await base.GetProcessedItem(user, arguments, extraSpecialIdentifiers, StreamingPlatformTypeEnum.Twitch);
            }

            this.Platform    = StreamingPlatformTypeEnum.None;
            this.lastClipURL = null;

            return(jobj);
        }
        public override async Task <JObject> GetProcessedItem(CommandParametersModel parameters)
        {
            JObject jobj = null;

            if (this.lastTwitchClip != null)
            {
                this.Platform    = StreamingPlatformTypeEnum.Twitch;
                this.lastClipURL = this.lastTwitchClip.embed_url + "&parent=localhost";
                if (this.Muted)
                {
                    this.lastClipURL += "&muted=true";
                }
                this.Effects.Duration = this.Duration = 30;

                this.lastTwitchClip = null;
            }

            if (!string.IsNullOrEmpty(this.lastClipURL))
            {
                jobj = await base.GetProcessedItem(parameters);
            }

            this.Platform    = StreamingPlatformTypeEnum.None;
            this.lastClipURL = null;

            return(jobj);
        }
 private void GlobalEvents_OnTwitchClipCreated(object sender, Twitch.Base.Models.NewAPI.Clips.ClipModel clip)
 {
     this.lastTwitchClip = clip;
     this.SendUpdateRequired();
 }