Exemple #1
0
        void OnChannelLeft(ChatChannel channelsource)
        {
            Logger.Info(this, $"'{channelsource.Name}' disconnected");
            TwitchUserChat chat = channels.FirstOrDefault(c => c.Name == channelsource.Name);

            if (chat != null)
            {
                chat.Subscription -= OnSubscription;
                channels.Remove(chat);
            }
            context.GetModule <StreamModule>().RemoveChannel(TwitchConstants.ServiceKey, channelsource.Name);
        }
Exemple #2
0
 void OnChannelJoined(ChatChannel channelsource)
 {
     if (channelsource.Name.ToLower() == username.ToLower())
     {
         Logger.Info(this, $"Connected to primary user channel '{channelsource.Name}'");
         TwitchAccountChat chat = new TwitchAccountChat(channelsource, context.GetModule <UserModule>(), context.GetModule <ImageCacheModule>());
         chat.Subscription += OnSubscription;
         channels.Add(chat);
         context.GetModule <StreamModule>().AddChannel(chat);
     }
     else
     {
         Logger.Info(this, $"Connected to '{channelsource.Name}'");
         TwitchUserChat chat = new TwitchUserChat(channelsource, context.GetModule <UserModule>(), context.GetModule <ImageCacheModule>());
         chat.Subscription += OnSubscription;
         channels.Add(chat);
         context.GetModule <StreamModule>().AddChannel(chat);
     }
 }