fix max-bot, add tests

This commit is contained in:
Александра Пронина 2026-05-15 10:22:43 +03:00
parent 7abbaf7e7a
commit 2ad1438e1c
17 changed files with 1621 additions and 494 deletions

View file

@ -9,7 +9,7 @@ class AttachmentHandler:
def handle_list(self, max_chat_id: str) -> str:
attachments = self.store.get_attachments(max_chat_id)
if not attachments:
return "Attachment queue is empty."
return "Очередь вложений пуста."
lines = [f" {i+1}. {name}" for i, (_, name) in enumerate(attachments)]
return "\n".join(lines)
@ -17,13 +17,13 @@ class AttachmentHandler:
attachments = self.store.staged_attachments.get(max_chat_id, [])
if index.lower() == "all":
self.store.staged_attachments[max_chat_id] = []
return "All attachments removed from queue."
return "Все вложения удалены из очереди."
try:
idx = int(index) - 1
if 0 <= idx < len(attachments):
removed = attachments.pop(idx)
return f"Removed: {removed[1]}"
return "Invalid index."
return f"Удалено: {removed[1]}"
return "Неверный номер."
except ValueError:
return "Usage: !remove <number> or !remove all"
return "Использование: /remove <номер> или /remove all"