gitignore: exclude Python bytecode cache
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
|
||||
# Ignora file compilati Python
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Ignora file di build o output comuni
|
||||
build/
|
||||
dist/
|
||||
|
||||
Plik binarny nie jest wyświetlany.
@@ -1155,6 +1155,8 @@ def process_event(job: dict) -> None:
|
||||
sender_user_id,
|
||||
)
|
||||
|
||||
translations = []
|
||||
|
||||
for recipient in recipients:
|
||||
target_language = normalize_language_code(
|
||||
get_user_language(recipient),
|
||||
@@ -1169,6 +1171,26 @@ def process_event(job: dict) -> None:
|
||||
if translated.strip().lower() == message_text.lower():
|
||||
continue
|
||||
|
||||
translations.append((recipient, target_language, translated))
|
||||
|
||||
if not translations:
|
||||
return
|
||||
|
||||
deleted = delete_message(
|
||||
token,
|
||||
message_id,
|
||||
)
|
||||
|
||||
if not deleted:
|
||||
log.warning(
|
||||
"Original message %s was not deleted. "
|
||||
"Generated translations will not be posted "
|
||||
"to avoid confusing duplicates.",
|
||||
message_id,
|
||||
)
|
||||
return
|
||||
|
||||
for recipient, target_language, translated in translations:
|
||||
post_manager_message(
|
||||
token,
|
||||
f"@{sender_display_name}: {translated}",
|
||||
|
||||
Reference in New Issue
Block a user