From ccc2368c456ea1e7d1f3840e16130f2d24e8dc76 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 21:31:23 +0700 Subject: [PATCH 01/10] =?UTF-8?q?[TEST]=20=D0=9F=D0=B5=D1=80=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Перекопана система замены, добавлен больше эффекта случайности, чтобы убрать перебор в заменах. Исправлена ошибка работы с -ня и мяу~ - больше они не появляются после знаков препинания. Изменена логика ня-канья - ня распростроняется только на не, но не на его включения. --- NekoSpeak.py | 84 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index df0585a..4efc56e 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -33,42 +33,60 @@ class NekoSpeakModule(loader.Module): self.db.set("NekoSpeak", "banned_chats", list(self.banned_chats)) def neko_speak(self, text): - words = text.split() - new_words = [] - for word in words: - if word.lower().startswith("н") and len(word) > 1: - word = "ня" + word[2:] - word = word.replace("р", "р" * random.randint(2,4)) - new_words.append(word) - text = " ".join(new_words) + encrypting_count = 0 + for x in range(1,3): + if("=" in text[-x]): + encrypting_count+=1 - replacements = { - "ничего": "нячего", "что?": "ня?", "ура!": "ня!", "о нет": "о-ня!", - "привет": "мяувет", "Привет": "Мяувет", "хорошо":"мяу-ряско", - "плохо":"мяу-чалька", "пиздец":"мря!", "Пиздец":"Мря!", - "блять":"мяр!", "Блять":"Мяр!", "замечательные":"замуррчательные", - "замечательный":"замуррчательный", "замечательных":"замуррчательных", - "Замечательные":"Замуррчательные", "Замечательный":"Замуррчательный", - "Замечательных":"Замуррчательных", "прекрасное":"замурчательное", - "Прекрасное":"Замурчательное", "прекрасный":"замурчательный", - "Прекрасный":"Замурчательный", "прекрасная":"замурчательная", - "Прекрасная":"Замурчательная", "заебись":"замурчательно", - "Заебись":"Замурчательно", "охуенно":"замурчательно", - "Охуенно":"Замурчательно", "няхуя":"МРЯВ?! Ньё-ньё!!", - "Няхуя":"МРЯВ?! Ньё-ньё!!", "няко":"неко", "Няко":"неко", - "нядо":"надо", "Нядо":"Надо", "В рот ебал":"МРЯФФ!!", - "в рот ебал":"МРЯФФ!!", "ебал":"мряк-мрря!", "Ебал":"МРЯФФ!!", - "хуёво":"ньёрфф...", "Хуёво":"Ньёрфф...", "пидрилит":"мряк-мрря!", - "Пидрилит":"Мряк-мрря!", - } + if(encrypting_count<2): + words = text.split() + new_words = [] + for word in words: + if word.lower().startswith("н") and len(word) > 2: #and random.random() < 0.2: + word = "ня" + word[2:] + word = word.replace("р", "р" * random.randint(2,4)) + word = word.replace("r", "r" * random.randint(2,4)) + new_words.append(word) + text = " ".join(new_words) - for key, value in replacements.items(): - text = text.replace(key, value) + replacements = { + "ничего": "нячего", "что?": "ня?", "ура!": "ня!", "о нет": "о-ня!", + "привет": "мяувет", "Привет": "Мяувет", "хорошо":"мяу-ряско", + "плохо":"мяу-чалька", "пиздец":"мря!", "Пиздец":"Мря!", + "блять":"мяр!", "Блять":"Мяр!", "замечательные":"замуррчательные", + "замечательный":"замуррчательный", "замечательных":"замуррчательных", + "Замечательные":"Замуррчательные", "Замечательный":"Замуррчательный", + "Замечательных":"Замуррчательных", "прекрасное":"замурчательное", + "Прекрасное":"Замурчательное", "прекрасный":"замурчательный", + "Прекрасный":"Замурчательный", "прекрасная":"замурчательная", + "Прекрасная":"Замурчательная", "заебись":"замурчательно", + "Заебись":"Замурчательно", "охуенно":"замурчательно", + "Охуенно":"Замурчательно", "няхуя":"МРЯВ?! Ньё-ньё!!", + "Няхуя":"МРЯВ?! Ньё-ньё!!", "няко":"неко", "Няко":"неко", + "нядо":"надо", "Нядо":"Надо", "В рот ебал":"МРЯФФ!!", + "в рот ебал":"МРЯФФ!!", "ебал":"мряк-мрря!", "Ебал":"МРЯФФ!!", + "хуёво":"ньёрфф...", "Хуёво":"Ньёрфф...", "пидрилит":"мряк-мрря!", + "Пидрилит":"Мряк-мрря!", + } - if random.random() < 0.3: - text += " мяу~" - elif random.random() < 0.2: - text += "-ня" + specialchar = [",",".","<",">","/","''",'""',":",";","{","}","[","]","|","!","@","#","$","%","^","&","?","*","(",")","-","_","+","=","`","~","№"] + + for key, value in replacements.items(): + text = text.replace(key, value) + + if(text[-1:] in specialchar): sp_char = True + + + if random.random() < 0.3: + if(sp_char): + text=text[:-1]+" мяу~"+text[-1:] + else: + text += " мяу~" + elif random.random() < 0.2: + if(sp_char): + text=text[:-1]+"-ня"+text[-1:] + else: + text += "-ня" return text From 9f2eb2d61bda7d2c5bec7d7932af73869c659e8b Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 21:41:07 +0700 Subject: [PATCH 02/10] [TEST] sp_char error fix 1 --- NekoSpeak.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 4efc56e..2d9d308 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -34,6 +34,7 @@ class NekoSpeakModule(loader.Module): def neko_speak(self, text): encrypting_count = 0 + sp_char = False for x in range(1,3): if("=" in text[-x]): encrypting_count+=1 @@ -74,7 +75,10 @@ class NekoSpeakModule(loader.Module): for key, value in replacements.items(): text = text.replace(key, value) - if(text[-1:] in specialchar): sp_char = True + + + if(text[-1:] in specialchar): + sp_char = True if random.random() < 0.3: From cc739463ac6e477ddb3473f63d4b833c2990ac13 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:00:31 +0700 Subject: [PATCH 03/10] [TEST] Encryption check moved Also changed policy on detection: now only one = is need to flag a message to not convert --- NekoSpeak.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 2d9d308..ab2f791 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -32,14 +32,20 @@ class NekoSpeakModule(loader.Module): # Сохраняем список забаненных чатов в БД self.db.set("NekoSpeak", "banned_chats", list(self.banned_chats)) - def neko_speak(self, text): - encrypting_count = 0 - sp_char = False + + def is_encrypt(text): + flag = False + encrypting_count=0 for x in range(1,3): if("=" in text[-x]): encrypting_count+=1 + if(encrypting_count>=1): + flag = True + return flag - if(encrypting_count<2): + def neko_speak(self, text): + + if(not is_encrypt(text)): words = text.split() new_words = [] for word in words: @@ -75,19 +81,10 @@ class NekoSpeakModule(loader.Module): for key, value in replacements.items(): text = text.replace(key, value) - - - if(text[-1:] in specialchar): - sp_char = True - - if random.random() < 0.3: - if(sp_char): - text=text[:-1]+" мяу~"+text[-1:] - else: text += " мяу~" elif random.random() < 0.2: - if(sp_char): + if(text[-1:] in specialchar): text=text[:-1]+"-ня"+text[-1:] else: text += "-ня" From bcabbca28ccd8c0ced8e19b2f999931bb0b878b1 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:03:56 +0700 Subject: [PATCH 04/10] [FIX] forgor to add self --- NekoSpeak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index ab2f791..5a2005e 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -33,7 +33,7 @@ class NekoSpeakModule(loader.Module): self.db.set("NekoSpeak", "banned_chats", list(self.banned_chats)) - def is_encrypt(text): + def is_encrypt(self, text): flag = False encrypting_count=0 for x in range(1,3): From 77e89fcf059197dc7cd26902630d81fd623be85a Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:10:57 +0700 Subject: [PATCH 05/10] [TEST] Fix 2 to check problem --- NekoSpeak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 5a2005e..84dfb79 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -45,7 +45,7 @@ class NekoSpeakModule(loader.Module): def neko_speak(self, text): - if(not is_encrypt(text)): + if(not self.is_encrypt(text)): words = text.split() new_words = [] for word in words: From 4ee72767133d129879c69b0d703c88f2afac133d Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:17:37 +0700 Subject: [PATCH 06/10] [FIX] Enabled back some random And added some more randoms --- NekoSpeak.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 84dfb79..c1cef55 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -49,10 +49,11 @@ class NekoSpeakModule(loader.Module): words = text.split() new_words = [] for word in words: - if word.lower().startswith("н") and len(word) > 2: #and random.random() < 0.2: + if word.lower().startswith("н") and len(word) > 2: and random.random() < 0.05: word = "ня" + word[2:] - word = word.replace("р", "р" * random.randint(2,4)) - word = word.replace("r", "r" * random.randint(2,4)) + if random.random() < 0.05: + word = word.replace("р", "р" * random.randint(2,4)) + word = word.replace("r", "r" * random.randint(2,4)) new_words.append(word) text = " ".join(new_words) @@ -79,11 +80,12 @@ class NekoSpeakModule(loader.Module): specialchar = [",",".","<",">","/","''",'""',":",";","{","}","[","]","|","!","@","#","$","%","^","&","?","*","(",")","-","_","+","=","`","~","№"] for key, value in replacements.items(): - text = text.replace(key, value) + if(random.random()<0.05): + text = text.replace(key, value) - if random.random() < 0.3: + if random.random() < 0.05: text += " мяу~" - elif random.random() < 0.2: + elif random.random() < 0.05: if(text[-1:] in specialchar): text=text[:-1]+"-ня"+text[-1:] else: From f102f4adb3f0eb5bc755bdb73809c54e8693fdf8 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:19:13 +0700 Subject: [PATCH 07/10] [FIX] Forgor : --- NekoSpeak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index c1cef55..367d7ed 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -49,7 +49,7 @@ class NekoSpeakModule(loader.Module): words = text.split() new_words = [] for word in words: - if word.lower().startswith("н") and len(word) > 2: and random.random() < 0.05: + if word.lower().startswith("н") and len(word) > 2 and random.random() < 0.05: word = "ня" + word[2:] if random.random() < 0.05: word = word.replace("р", "р" * random.randint(2,4)) From a2c94ec024cb3179bd12ae10b7caba5e61a7ad47 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Wed, 8 Oct 2025 20:54:22 +0700 Subject: [PATCH 08/10] [UPD] Changed word multiplicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил дефисы в удлинённые буквы, чтобы звучало характернее. --- NekoSpeak.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 367d7ed..b8e78df 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -52,8 +52,8 @@ class NekoSpeakModule(loader.Module): if word.lower().startswith("н") and len(word) > 2 and random.random() < 0.05: word = "ня" + word[2:] if random.random() < 0.05: - word = word.replace("р", "р" * random.randint(2,4)) - word = word.replace("r", "r" * random.randint(2,4)) + word = word.replace("р", "р-" * random.randint(2,4)+"р") + word = word.replace("r", "r" * random.randint(2,4)+"r") new_words.append(word) text = " ".join(new_words) From ec4170842a7f0137420a9dae70af3d93bb0ddcda Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Wed, 8 Oct 2025 21:11:41 +0700 Subject: [PATCH 09/10] [UPD] Added a mad mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил режим без рандома - вcё что попало, всё под преобразование --- NekoSpeak.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index b8e78df..71051a1 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -23,6 +23,7 @@ class NekoSpeakModule(loader.Module): self.public_enabled = False # Загружаем из БД или создаём новый список self.banned_chats = set() + self.bad_minded = False async def client_ready(self): saved = self.db.get("NekoSpeak", "banned_chats", []) @@ -49,9 +50,9 @@ class NekoSpeakModule(loader.Module): words = text.split() new_words = [] for word in words: - if word.lower().startswith("н") and len(word) > 2 and random.random() < 0.05: + if word.lower().startswith("н") and len(word) > 2 and (random.random() < 0.05 or self.bad_minded): word = "ня" + word[2:] - if random.random() < 0.05: + if random.random() < 0.05 or self.bad_minded: word = word.replace("р", "р-" * random.randint(2,4)+"р") word = word.replace("r", "r" * random.randint(2,4)+"r") new_words.append(word) @@ -80,12 +81,12 @@ class NekoSpeakModule(loader.Module): specialchar = [",",".","<",">","/","''",'""',":",";","{","}","[","]","|","!","@","#","$","%","^","&","?","*","(",")","-","_","+","=","`","~","№"] for key, value in replacements.items(): - if(random.random()<0.05): + if(random.random()<0.05 or self.bad_minded): text = text.replace(key, value) - if random.random() < 0.05: + if random.random() < 0.05 or self.bad_minded: text += " мяу~" - elif random.random() < 0.05: + elif random.random() < 0.05 or self.bad_minded: if(text[-1:] in specialchar): text=text[:-1]+"-ня"+text[-1:] else: @@ -123,6 +124,12 @@ class NekoSpeakModule(loader.Module): status = "включено" if self.public_enabled else "выключено" await utils.answer(message, f"Ня! Преобразование в публичных чатах теперь {status}.") + @loader.command(ru_doc="Отключает рандом, преобразовывает всё без шансов спастись") + async def nekospeakdumb(self, message: Message): + self.bad_minded = not self.bad_minded + status = "включён" if self.bad_minded else "отключён" + await utils.answer(message, f"Ня! Рандом {status}.") + @loader.command(ru_doc="Заблокировать чат для работы модуля") async def nekospeakex(self, message: Message): args = utils.get_args_raw(message) From 942de4995e272a84f0efac6acf9d7a127245c815 Mon Sep 17 00:00:00 2001 From: homayk228 <43516026+SouceCalve@users.noreply.github.com> Date: Wed, 8 Oct 2025 21:15:33 +0700 Subject: [PATCH 10/10] [FIX] Dumb mode status messages changed places MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Перепутал местами вкл и выкл на режиме без рандома --- NekoSpeak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NekoSpeak.py b/NekoSpeak.py index 71051a1..54a7690 100644 --- a/NekoSpeak.py +++ b/NekoSpeak.py @@ -127,7 +127,7 @@ class NekoSpeakModule(loader.Module): @loader.command(ru_doc="Отключает рандом, преобразовывает всё без шансов спастись") async def nekospeakdumb(self, message: Message): self.bad_minded = not self.bad_minded - status = "включён" if self.bad_minded else "отключён" + status = "отключён" if self.bad_minded else "включён" await utils.answer(message, f"Ня! Рандом {status}.") @loader.command(ru_doc="Заблокировать чат для работы модуля")