vh-bombsquad-modded-server-.../dist/ba_root/mods/features/profanity.py

138 lines
2.5 KiB
Python
Raw Normal View History

2024-02-26 00:17:10 +05:30
# ported from ankit scripts
# need to update in future with easy to add custom list and more deep analysis .
# working on other features rn, will update this later , for now lets use this
2024-04-15 01:45:15 +05:30
#recreated by SARA
2024-02-26 00:17:10 +05:30
import re
2024-04-15 01:45:15 +05:30
blacklist_word = [
"fuck",
"shit",
"bitch",
"asshole",
"cunt",
"dick",
"cock",
"pussy",
"whore",
"bastard",
"slut",
"motherfucker",
"douchebag",
"wanker",
"asshat",
"twat",
"bollocks",
"crap",
"damn",
"goddamn",
"hell",
"bugger",
"arse",
"prick",
"idiot",
"moron",
"loser",
"jerk",
"dipshit",
"dumbass",
"nigger",
"retard",
"fucktard",
"douche",
"fuckface",
"fuckhead",
"shithead",
"cockhead",
"dickhead",
"asshead",
"bitchass",
"cuntface",
"pisshead",
"assclown",
"bullshit",
"piss off",
"suck",
"sucker",
"fuck off",
"jackass",
"son of a bitch",
"arsehole",
"fuckwit",
"asswipe",
"turd",
"fuckface",
"fucknut",
"shitface",
"shitbag",
"shit-for-brains",
"dickwad",
"dickweed",
"piss off",
"motherfucking",
"cockgobbler",
"twatwaffle",
"cumstain",
"fuckery",
"fucker",
"fucked",
"shitstorm",
"shitshow",
"bullshit",
"bullshitter",
"clusterfuck",
"cunthammer",
"cuntlicker",
"cumdumpster",
"fucktastic",
"shitload",
"shitbag",
"shitfaced",
"shitload",
"shitfucker",
"fuckface",
"fucknugget",
"fuckstick",
"fucktard",
"fuckup",
"motherfucker",
"motherfucking",
"motherfucked",
"motherfuck",
"motherfucks",
"pissed off",
"pissed",
"pissing",
"pisses",
"pisshead",
"pisshead",
"pissed off",
"son of a bitch",
"son of a whore",
"son of a cunt",
"son of a dick",
"son of an ass",
"twat",
"twat",
"twatted",
"twatting",
"twats",
"whore",
"whore",
"whored",
"whoring",
"whores",
"ass",
# Add more words as needed
]
2024-02-26 00:17:10 +05:30
def censor(message):
2024-04-15 01:45:15 +05:30
profane_list = blacklist_word
pattern = "|".join(r"\b{}\b".format(re.escape(word)) for word in profane_list)
2024-02-26 00:17:10 +05:30
censored_message = re.sub(
2024-04-15 01:45:15 +05:30
pattern,
2024-02-26 00:17:10 +05:30
lambda match: "*" * len(match.group()),
message,
flags=re.IGNORECASE
)
2024-04-15 01:45:15 +05:30
return censored_message