public bool Remove(MessageSender sender, string entry, StringComparison comparison = StringComparison.OrdinalIgnoreCase) { lock (_keystore) { var tag = sender.Tag; if (_keystore.ContainsKey(tag)) { var list = _keystore[tag]; var oldCount = list.Count; if (oldCount > 0) { list = list.Where(x => !x.Equals(entry, comparison)).ToList(); var newCount = list.Count; if (newCount == oldCount) { return(false); } if (newCount == 0) { _keystore.Remove(tag); } else { _keystore[tag] = list; } Modified = true; return(true); } } return(false); } }
public void RememberValue(MessageSender sender, object obj) { _memory[sender.Tag] = obj; }
public void Speak(MessageSender sender, IEnumerable <string> lines) { Speak(sender.Platform, sender.ID, lines); }
public void Speak(MessageSender sender, string text) { Speak(sender.Platform, sender.ID, text); }
public void RemoveAdmin(MessageSender sender) { Admins.Remove(sender); }
public void AddAdmin(MessageSender sender) { Admins.Set(sender, "true"); }
public bool IsAdmin(MessageSender sender) { return(Admins.Contains(sender)); }
public void Append(MessageSender sender, string obj) { Add(sender, obj, true); }