From e130cdfd931328473bf589cb0c62c79be44ef475 Mon Sep 17 00:00:00 2001 From: expect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Sat, 21 Jun 2025 12:00:49 +0200 Subject: [PATCH] bot.py should be just commands now --- bot.py | 13 +------------ modules/globalvars.py | 2 +- modules/{messages.py => sentenceprocessing.py} | 12 ++++++++++++ 3 files changed, 14 insertions(+), 13 deletions(-) rename modules/{messages.py => sentenceprocessing.py} (89%) diff --git a/bot.py b/bot.py index e2f8ca8..7c394e1 100644 --- a/bot.py +++ b/bot.py @@ -21,7 +21,7 @@ from modules.central import ping_server from modules.translations import * from modules.markovmemory import * from modules.version import * -from modules.messages import * +from modules.sentenceprocessing import * print(splashtext) # you can use https://patorjk.com/software/taag/ for 3d text or just remove this entirely check_for_update() @@ -200,17 +200,6 @@ async def talk(ctx, sentence_size: int = 5): else: await send_message(ctx, f"{get_translation(LOCALE, 'command_talk_generation_fail')}") -def improve_sentence_coherence(sentence): - - sentence = sentence.replace(" i ", " I ") - return sentence - -def rephrase_for_coherence(sentence): - - words = sentence.split() - - coherent_sentence = " ".join(words) - return coherent_sentence bot.help_command = None diff --git a/modules/globalvars.py b/modules/globalvars.py index 5da6da6..b29e43a 100644 --- a/modules/globalvars.py +++ b/modules/globalvars.py @@ -40,5 +40,5 @@ song = os.getenv("song") arch = platform.machine() slash_commands_enabled = False latest_version = "0.0.0" -local_version = "0.15.1" +local_version = "0.15.2" os.environ['gooberlocal_version'] = local_version \ No newline at end of file diff --git a/modules/messages.py b/modules/sentenceprocessing.py similarity index 89% rename from modules/messages.py rename to modules/sentenceprocessing.py index cf53e98..6e8d8ca 100644 --- a/modules/messages.py +++ b/modules/sentenceprocessing.py @@ -54,3 +54,15 @@ def preprocess_message(message): tokens = word_tokenize(message) tokens = [token for token in tokens if token.isalnum()] return " ".join(tokens) + +def improve_sentence_coherence(sentence): + + sentence = sentence.replace(" i ", " I ") + return sentence + +def rephrase_for_coherence(sentence): + + words = sentence.split() + + coherent_sentence = " ".join(words) + return coherent_sentence \ No newline at end of file