Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update forbidden strings (#9)
Browse files- Update forbidden strings (6e40ba5df298f90f74c0d3b6bdb90c529b5c26c1)
Co-authored-by: Christopher Akiki <christopher@users.noreply.huggingface.co>
67 unmodified lines686970717273747567 unmodified lines"""Antispam"""#Detecting certain unwanted stringstry:forbidden_strings = ["@everyone", "@here"]if any(string.lower() in message.content.lower() for string in forbidden_strings):ignored_role_ids = [897381378172264449, 897376942817419265] #admins, huggingfolksif any(role.id in ignored_role_ids for role in message.author.roles):if message.author != lunarflu:67 unmodified lines6869707172737475767767 unmodified lines"""Antispam"""#Detecting certain unwanted stringstry:forbidden_patterns = [r"@everyone",r"@here",r"(https?:\/\/|http?:\/\/)?(www.)?(discord.(gg|io|me|li)|discordapp.com\/invite|discord.com\/invite)\/[^\s\/]+?(?=\b)"]if any(re.search(pattern, message.content, re.IGNORECASE) for pattern in forbidden_patterns):ignored_role_ids = [897381378172264449, 897376942817419265] #admins, huggingfolksif any(role.id in ignored_role_ids for role in message.author.roles):if message.author != lunarflu:
app.py+4-2