diff --git a/bot/Namecheck.py b/bot/Namecheck.py index 347ff7ff476..18c67cc4c30 100644 --- a/bot/Namecheck.py +++ b/bot/Namecheck.py @@ -1,3 +1,19 @@ + +def Namecheck_allinone(name, against, sender=None): + __doc__ = "False = No match, True = Match" + if not isinstance(against, iterable): + return False + + if isinstance(against, dict): + for key, value in against.iteritems(): + if value.lower() in name.lower() and (sender and sender.lower() not in name.lower()): + return True, key # Not sure why you need the index with the result. + for item in against: + if item.lower() in name.lower() and sender.lower() not in name.lower(): + return True + + return False + def Namecheck(name,against,sender): __doc__ = "False = No match, True = Match" for i in against: