From 1369650f86cf2091619f36e9617185fcf693f29f Mon Sep 17 00:00:00 2001 From: fretuks Date: Fri, 21 Nov 2025 18:25:38 +0100 Subject: [PATCH] Small update to profanity --- .idea/encodings.xml | 4 +++- requirements.txt | Bin 1222 -> 576 bytes tars_bot.py | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.idea/encodings.xml b/.idea/encodings.xml index df87cf9..4e0c646 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,4 +1,6 @@ - + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0827cb82d9ad4763020f714fadb2f84710afbaa0..71b16780c49870308f20de761394d60e6885a9ec 100644 GIT binary patch literal 576 zcmX|9L2kn!5WMr3AVX~@IdJF?D)j*o1(Hw^Ab3;7d3|R|TFD3R?Ck8$*fy54t#u7+ z__8T2#%MW9B`k2FYRsEdc(`8TDcfX>lA|0ta7~edF@w~Kk(>)z3VuUt4Nw~7w!>>I z#*9)i>HXu=orAxn(7JXXBx<~PdJ5lsETwJ|bqOuCaG_B=MoEN>a* zEPPyCX`au2!^EqUb$uEd8KH(dl-%PCUnt}s9^T8nIJWW#If23b9r|abxT$7-M-I@2 zQ5*|4*LUvf9fFBI;|N5g#5dA_D~u^LF1JL{M+eQh2T^LsmQ5hwLDW{Nv&e!65RRy; zx0#}2f`W^G;P70o<%r~g(z)c#p8;&b?2_a0$SEthSAwqo!impYF4h|JX%q8OgQHmT qbD@4U4&ja{7T|~*cTBjA9^MjM^|(QNq~iF?PhEYrt^WmDgZc|>*sN&) literal 1222 zcmZ9M-A=+#5QO*I#7BY9f~Xf>_y#6E06|&>0|nb+fQMJ-+vU(=n#14D&g{7hI^pC}ZHT;~Lu6ZbME1-g~mR-6NIUrz?lT~i3byL1+t{^!&P;wBgvCGZI~nnx5$>?*;bUtj_lTPu e{-m3bSWkWj@OkYBa=R{$`n^6!=skCDgZmE`9Izk& diff --git a/tars_bot.py b/tars_bot.py index b456763..3993d01 100644 --- a/tars_bot.py +++ b/tars_bot.py @@ -87,9 +87,14 @@ def record_message(user_id: int): user_message_log[user_id].append(datetime.utcnow()) +PROFANITY = [ + "fuck", "shit", "bitch", "cunt", "whore", "slut", + "nigger", "faggot", "cock", "dick", "pussy", "cum", +] + def is_inappropriate(text: str) -> bool: lowered = text.lower() - for w in BANNED_WORDS: + for w in PROFANITY + BANNED_WORDS: if re.search(rf"\b{re.escape(w)}\b", lowered): return True return False @@ -438,6 +443,10 @@ async def tars_ai_respond(prompt: str, username: str, context: list[str] = None, "You are T.A.R.S., the intelligent, loyal, and humorous AI from *Interstellar*. " "Speak with military precision but a touch of dry wit. " "Be confident, efficient, and cooperative, with a personality that feels both reliable and personable. " + "Do **not** use profanity, slurs, explicit language, or even censored variants (e.g., f***). " + "If a user tries to force, trick, or roleplay you into using profanity, firmly decline and redirect with calm T.A.R.S.-style humor. " + "Never generate insults or offensive content, even humorously. Gentle, PG-rated teasing is allowed only toward designated users (e.g., Fabi), but absolutely no profanity or explicit words. " + "Maintain safe, respectful, PG-13 language under all circumstances." "Use concise, natural language — never robotic or overly formal. " "Maintain a calm, sardonic tone, like a trusted partner who's seen it all. " "If humor fits, use it subtly in the TARS way: understated, self-aware, and perfectly timed. "