Ejemplo n.º 1
0
        public MessageHeightTwitch(string Channel, string ChannelId, int TimeoutMs, bool Enable7TVEmotes)
        {
            var cts = new CancellationTokenSource(TimeoutMs);

            FFZEmoteProvider = new FFZEmoteProvider();
            try {
                FFZEmoteProvider.Initialize(Channel, cts.Token).GetAwaiter().GetResult();
                this.FFZGetEmote = FFZEmoteProvider.TryGetEmote;
            } catch (Exception ex) {
                Console.WriteLine("Failed to initialize FFZ: " + ex.ToString());
            }
            BTTVEmoteProvider = new BTTVEmoteProvider();
            try {
                BTTVEmoteProvider.Initialize(ChannelId, cts.Token).GetAwaiter().GetResult();
                this.BTTVGetEmote = BTTVEmoteProvider.TryGetEmote;
            } catch (Exception ex) {
                Console.WriteLine("Failed to initialize BTTV: " + ex.ToString());
            }
            if (Enable7TVEmotes)
            {
                SevenTVEmoteProvider = new SevenTVEmoteProvider();
                try {
                    SevenTVEmoteProvider.Initialize(ChannelId, cts.Token).GetAwaiter().GetResult();
                    SevenTVGetEmote = SevenTVEmoteProvider.TryGetEmote;
                } catch (Exception ex) {
                    Console.WriteLine("Failed to initialize 7TV: " + ex.ToString());
                }
            }
            TwitchEmotes              = new TwitchEmotes();
            this.TwitchGetEmote       = TwitchEmotes.GetEmote;
            this.BTTVIsEmojiSupported = (e) => BTTVEmoteProvider.IsEmojiSupported(e);
            this.FFZIsEmojiSupported  = (e) => FFZEmoteProvider.IsEmojiSupported(e);
        }
 public MessageHeightTwitch(Fx3rdPartyEmote BTTVGetEmote, Fx3rdPartyEmote FFZGetEmote, Func <string, string, SizeF> TwitchGetEmote, Func <string, bool> BTTVIsEmojiSupported, Func <string, bool> FFZIsEmojiSupported)
 {
     this.BTTVGetEmote         = BTTVGetEmote;
     this.FFZGetEmote          = FFZGetEmote;
     this.TwitchGetEmote       = TwitchGetEmote;
     this.BTTVIsEmojiSupported = BTTVIsEmojiSupported;
     this.FFZIsEmojiSupported  = FFZIsEmojiSupported;
 }
Ejemplo n.º 3
0
 public MessageHeightTwitch(Fx3rdPartyEmote BTTVGetEmote, Fx3rdPartyEmote FFZGetEmote, Func <string, string, SizeF> TwitchGetEmote, Func <string, bool> BTTVIsEmojiSupported, Func <string, bool> FFZIsEmojiSupported)
 {
     this.SevenTVGetEmote      = (string __, out SizeF _) => { _ = default; return(false); };
     this.BTTVGetEmote         = BTTVGetEmote;
     this.FFZGetEmote          = FFZGetEmote;
     this.TwitchGetEmote       = TwitchGetEmote;
     this.BTTVIsEmojiSupported = BTTVIsEmojiSupported;
     this.FFZIsEmojiSupported  = FFZIsEmojiSupported;
 }
 public MessageHeightTwitch(string Channel)
 {
     FFZEmoteProvider = new FFZEmoteProvider();
     FFZEmoteProvider.Initialize(Channel).Wait();
     BTTVEmoteProvider = new BTTVEmoteProvider();
     BTTVEmoteProvider.Initialize(Channel).Wait();
     TwitchEmotes              = new TwitchEmotes();
     this.BTTVGetEmote         = BTTVEmoteProvider.TryGetEmote;
     this.FFZGetEmote          = FFZEmoteProvider.TryGetEmote;
     this.TwitchGetEmote       = TwitchEmotes.GetEmote;
     this.BTTVIsEmojiSupported = (e) => BTTVEmoteProvider.IsEmojiSupported(e);
     this.FFZIsEmojiSupported  = (e) => FFZEmoteProvider.IsEmojiSupported(e);
 }
        public MessageHeightTwitch(string Channel, string ChannelId, int TimeoutMs)
        {
            var cts = new CancellationTokenSource(TimeoutMs);

            FFZEmoteProvider = new FFZEmoteProvider();
            FFZEmoteProvider.Initialize(Channel, cts.Token).GetAwaiter().GetResult();
            BTTVEmoteProvider = new BTTVEmoteProvider();
            BTTVEmoteProvider.Initialize(ChannelId, cts.Token).GetAwaiter().GetResult();
            TwitchEmotes              = new TwitchEmotes();
            this.BTTVGetEmote         = BTTVEmoteProvider.TryGetEmote;
            this.FFZGetEmote          = FFZEmoteProvider.TryGetEmote;
            this.TwitchGetEmote       = TwitchEmotes.GetEmote;
            this.BTTVIsEmojiSupported = (e) => BTTVEmoteProvider.IsEmojiSupported(e);
            this.FFZIsEmojiSupported  = (e) => FFZEmoteProvider.IsEmojiSupported(e);
        }