Esempio n. 1
0
 public void UnTrackAllChats()
 {
     lock (TrackedChats)
         TrackedChats.Clear();
     OnTrackedChatsChanged?.Invoke(this, EventArgs.Empty);
     Core.Log.LibVerbose("All Chats UnTracked");
 }
Esempio n. 2
0
 public void UnTrackAllChats()
 {
     lock (TrackedChats)
     {
         var counts = TrackedChats.Count;
         TrackedChats.Clear();
         _counterTrackedChat.Add(-counts);
     }
     OnTrackedChatsChanged?.Invoke(this, EventArgs.Empty);
     Core.Log.LibVerbose("All Chats UnTracked");
 }
Esempio n. 3
0
 public bool UnTrackChat(BotChat chat)
 {
     if (chat == null)
     {
         return(false);
     }
     lock (TrackedChats)
     {
         if (!TrackedChats.Contains(chat.Id))
         {
             return(false);
         }
         TrackedChats.Remove(chat.Id);
         Core.Log.LibVerbose("Chat UnTracked");
         OnTrackedChatsChanged?.Invoke(this, EventArgs.Empty);
         return(true);
     }
 }
Esempio n. 4
0
 public bool TrackChat(BotChat chat)
 {
     if (chat is null)
     {
         return(false);
     }
     lock (TrackedChats)
     {
         if (TrackedChats.Contains(chat.Id))
         {
             return(false);
         }
         TrackedChats.Add(chat);
         Core.Log.LibVerbose("Chat Tracked");
         _counterTrackedChat.Increment();
         OnTrackedChatsChanged?.Invoke(this, EventArgs.Empty);
         return(true);
     }
 }