Esempio n. 1
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. 2
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);
     }
 }
Esempio n. 3
0
 public bool IsChatTracked(BotChat chat)
 {
     lock (TrackedChats)
         return(chat != null && TrackedChats.Contains(chat.Id));
 }