feat: implementar caché de traducciones y persistencia de mensajes en MySQL para Discord y Telegram
This commit is contained in:
@@ -8,7 +8,7 @@ from discord import app_commands
|
||||
import re
|
||||
|
||||
from botdiscord.config import get_discord_token, load_config, get_languages
|
||||
from botdiscord.database import init_db, get_active_languages, get_bot_languages
|
||||
from botdiscord.database import init_db, get_active_languages, get_bot_languages, save_message
|
||||
from botdiscord.ui import TranslationView, ConfigView
|
||||
from botdiscord.translate import get_reverse_mapping, load_lang_mappings
|
||||
|
||||
@@ -93,6 +93,9 @@ async def on_message(message):
|
||||
|
||||
text_to_translate = mention_pattern.sub(replace_mention, text_escaped)
|
||||
|
||||
# Guardamos el mensaje en la base de datos para persistencia y caché
|
||||
save_message(message.id, message.guild.id, message.author.id, text_to_translate, mentions_map, 'discord')
|
||||
|
||||
langs_to_show = active_langs
|
||||
|
||||
if langs_to_show:
|
||||
|
||||
Reference in New Issue
Block a user