Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -3156,6 +3156,15 @@ else:
|
|
| 3156 |
|
| 3157 |
current_mode = user_states[str_chat_id].get("mode")
|
| 3158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3159 |
if current_mode is None:
|
| 3160 |
if is_file: pass
|
| 3161 |
elif user_text_str: await send_with_keyboard(client, chat_id, "⚠️ لطفاً ابتدا از کیبورد پایین، بخش مورد نظرتان را انتخاب کنید:", True)
|
|
|
|
| 3156 |
|
| 3157 |
current_mode = user_states[str_chat_id].get("mode")
|
| 3158 |
|
| 3159 |
+
# --- نگهبان هوشمند کلمات ممنوعه ---
|
| 3160 |
+
restricted_modes = ["image_waiting_for_text", "image_edit_waiting_for_prompt", "vid_txt_wait_prompt", "vid_wait_prompt"]
|
| 3161 |
+
if current_mode in restricted_modes and user_text_str:
|
| 3162 |
+
forbidden_words = {"sex", "sexy", "porn", "nude", "erotic", "سکس", "سکسی", "پورن", "شهوانی", "برهنه", "لخت", "نود"}
|
| 3163 |
+
if any(word in user_text_str.lower() for word in forbidden_words):
|
| 3164 |
+
await send_with_keyboard(client, chat_id, "❌ **خطا:** متن ورودی شما شامل کلمات نامناسب است. لطفاً متن خود را تغییر دهید.", False)
|
| 3165 |
+
return
|
| 3166 |
+
# --------------------------------
|
| 3167 |
+
|
| 3168 |
if current_mode is None:
|
| 3169 |
if is_file: pass
|
| 3170 |
elif user_text_str: await send_with_keyboard(client, chat_id, "⚠️ لطفاً ابتدا از کیبورد پایین، بخش مورد نظرتان را انتخاب کنید:", True)
|