Commit Graph

107 Commits

Author SHA1 Message Date
62ca809f11 Merge pull request 'Fix HTML parse_mode in registration handlers to support premium emojis' (#10) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2026-03-07 00:47:52 +00:00
9fe9e8958a Fix HTML parse_mode in registration handlers to support premium emojis
Some checks failed
continuous-integration/drone/pr Build is failing
- Replace Markdown double asterisks with HTML tags
- Change parse_mode from Markdown to HTML for registration confirmation
- Use <b> tags for bold text in registration_completed message
- Use <code> tags for verification code display
- Fixes 'Can't find end of the entity' error in Telegram API
- Remove unused JSON export files
2026-03-07 09:46:09 +09:00
Lottery Bot Admin
21f348471e Add Premium Emoji Support for Premium Bot Accounts
All checks were successful
continuous-integration/drone/push Build is passing
- Create src/core/premium_emoji.py module for premium emoji handling
- Create src/core/telegram_config.py for global parse_mode configuration
- Update bot_controller.py to use HTML parse_mode for better emoji support
- Add PREMIUM_EMOJI_SUPPORT.md documentation with usage examples
- HTML parse_mode now default for all messages to support premium emojis
- Aiogram 3.16.0+ supports premium emojis natively when using correct parse_mode

Benefits:
- Premium bot accounts can now display special premium emojis
- Better emoji rendering across all message types
- Centralized configuration for parse modes
- Backwards compatible with regular emoji
2026-03-07 00:26:20 +00:00
Lottery Bot Admin
4daec268e6 Update production configuration
All checks were successful
continuous-integration/drone/push Build is passing
- Update BOT_TOKEN for production environment
- Configure external PostgreSQL host (192.168.0.102)
- Update database connection details (new_lottery_KR)
- Adjust docker-compose configuration for production setup
- Set LOG_LEVEL to DEBUG for better diagnostics
2026-03-07 00:06:01 +00:00
5c01486bd8 Merge pull request 'v2_functions' (#9) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #9
2026-03-06 23:57:00 +00:00
782f702327 Fix registration button handling and add debug logging
Some checks failed
continuous-integration/drone/pr Build is failing
- Improve btn_registration handler to directly set state instead of creating fake callback
- Add /register command handler for registration
- Add text-based registration triggers ('регистрация', 'регистр', 'register')
- Add debug logging to handle_start to track registration status
- Ensure registration button is shown correctly for unregistered users
2026-03-07 08:55:35 +09:00
ede4617b00 Enhance login display with raffle participation history
- Show active vs closed raffles for each login
- Display win/loss status (🏆 for winners, ✗ for non-winners)
- Limit display to 5 active + 3 closed raffles
- Update help documentation with detailed status explanation
- Add status icons (/⏸️) for active/inactive logins
2026-03-07 08:53:48 +09:00
7d5ad3d668 Merge pull request 'Добавить раздел 'Мои логины' в справку' (#8) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #8
2026-03-06 23:32:18 +00:00
904f94e1b5 Добавить раздел 'Мои логины' в справку
Some checks failed
continuous-integration/drone/pr Build is failing
- Добавлена новая кнопка '📱 Мои логины' в меню справки
- Реализован обработчик help_logins с детальной информацией о логинах
- Справка содержит информацию о том что в разделе можно найти свои добавленные логины
- Выделено важное уточнение: логины не отыгранные по условиям розыгрыша не добавляются в список
- Включены советы и инструкции по использованию раздела
2026-03-07 08:31:31 +09:00
06ddd1e5fa Merge pull request 'Обновление UI: убрать розыгрыши, переименовать счета, добавить кнопку главная' (#7) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2026-03-06 23:12:51 +00:00
b45fe005b9 Обновление UI: убрать розыгрыши, переименовать счета, добавить кнопку главная
Some checks failed
continuous-integration/drone/pr Build is failing
- Удалена кнопка 'Розыгрыши' из главной клавиатуры
- Переименована кнопка 'Мои счета' -> 'Мои логины'
- Показывается ник пользователя вместо TG_ID в чате
- Добавлена кнопка 'Главная' на все клавиатуры
- Проверка регистрации и сокрытие кнопки регистрации
- Валидация номера телефона при регистрации (проверка на символ '-')
2026-03-07 08:11:10 +09:00
815cc544d5 Merge pull request 'feat: Allow assigned admins to access admin panel via command and buttons' (#6) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2026-02-18 04:29:01 +00:00
6b24388faa feat: Allow assigned admins to access admin panel via command and buttons
Some checks failed
continuous-integration/drone/pr Build is failing
- Modified check_admin_access() to check both super admins (.env) and assigned admins (DB)
- Updated /admin command handler to support both admin types
- Replaced all is_admin() checks with async check_admin_access() in admin panel
- Assigned admins can now use /admin command and navigate via buttons
- Super admin check (is_super_admin) remains unchanged for admin management
- Added proper async/await for database queries in all admin checks
2026-02-18 13:28:29 +09:00
2db39b0652 Merge pull request 'feat: Add admin management system with super admin controls' (#5) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #5
2026-02-18 04:21:26 +00:00
e1b4465f89 feat: Add admin management system with super admin controls
Some checks failed
continuous-integration/drone/pr Build is failing
- Implemented two-level admin hierarchy (super admin from .env and assigned admins)
- Only super admins (from ADMIN_IDS in .env) can manage admin assignments
- Added admin management menu to settings (visible only for super admins)
- Admins can add/remove other admins through the bot interface
- Protected super admins from deletion
- Added CLI tool for admin management (scripts/manage_admins.py)
- Added database check script (scripts/check_db.py)
- Added deployment scripts for server setup
- Added comprehensive documentation on admin management system
- Added backup and server deployment guides
2026-02-18 13:19:26 +09:00
4160d69fa7 восстановление работы чата,
All checks were successful
continuous-integration/drone/push Build is passing
рефактор проведения розыгрыша
2026-02-18 11:31:38 +09:00
6b2e915452 fix: Fix chat message broadcasting to all users
All checks were successful
continuous-integration/drone/push Build is passing
- Fixed get_all_active_users() to broadcast to ALL users regardless of registration status
- Merged duplicate text message handlers (check_exit_keywords and handle_text_message)
- Added detailed logging for chat message broadcasting
- Now users can receive messages in chat without full registration

Resolves: Messages not being delivered to unregistered users in chat
2026-02-17 01:03:36 +09:00
8eca76b844 Merge pull request 'refactor' (#4) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
2026-02-16 15:36:36 +00:00
d263730cf2 migration fix
Some checks failed
continuous-integration/drone/pr Build is failing
2026-02-17 00:35:52 +09:00
fe23306adb Merge branch 'v2_functions'
All checks were successful
continuous-integration/drone/push Build is passing
2026-02-17 00:31:26 +09:00
0fdad07d82 refactor
Some checks failed
continuous-integration/drone/pr Build is failing
2026-02-17 00:22:42 +09:00
388c4e8aad Пересборка клавиатур, рефакторинг чата
All checks were successful
continuous-integration/drone/push Build is passing
2026-02-13 20:03:44 +09:00
4b06cd2f9e Merge pull request 'v2_functions' (#3) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #3
2026-02-11 09:41:25 +00:00
ca0c63a89c chat+lottery refactor
All checks were successful
continuous-integration/drone/pr Build is passing
2026-02-11 18:40:37 +09:00
c0407fdb11 Реализованы все улучшения функционала бота
Блок 1: Система никнеймов
-  Добавлено поле nickname в модель User
-  Создана миграция для nickname
-  Обновлена регистрация (3 шага: nickname → карта → телефон)
-  Валидация nickname (длина 2-20, проверка служебных слов)
-  Подписи в чате используют nickname

Блок 2: Админские функции
-  Массовая рассылка (кнопка в админке, поддержка текста/фото/видео/документов)
-  Экспорт пользователей в JSON (бэкап с метаданными)
-  Импорт пользователей из JSON (восстановление с обновлением)

Блок 3: Улучшения розыгрышей
-  Рассылка результатов розыгрыша всем участникам (кроме победителей)
-  Сообщения подтверждения показывают nickname + клубную карту
-  Ручное назначение победителя по номеру счета/telegram ID/username
2026-02-09 20:22:32 +09:00
4e2c8981c2 chat restore
All checks were successful
continuous-integration/drone/push Build is passing
2026-02-09 20:07:46 +09:00
062b782fb7 bugfix
All checks were successful
continuous-integration/drone/push Build is passing
2026-02-08 17:45:08 +09:00
931235ff36 feat: улучшен чат - все видят сообщения + быстрое удаление
All checks were successful
continuous-integration/drone/push Build is passing
- Все пользователи видят сообщения друг друга (как в обычном чате)
- Админ получает все сообщения для модерации
- Быстрое удаление: админ отвечает на сообщение словом 'удалить'/'del'/'-'
- Удаление происходит у всех получателей автоматически
- Команда удаления самоудаляется через 3 секунды
- Сохранена админ-панель для управления сообщениями
2025-11-22 20:05:16 +09:00
8e692d2f61 feat: добавлено управление сообщениями пользователей в админ-панель
All checks were successful
continuous-integration/drone/push Build is passing
- Добавлена кнопка 'Сообщения пользователей' в админ меню
- Реализован просмотр последних сообщений с фильтрацией
- Возможность просмотра медиа (фото, видео) прямо в боте
- Функция удаления сообщений администратором
- Удаление происходит как в БД, так и у пользователей в Telegram
- Просмотр всех сообщений конкретного пользователя
- Добавлены методы в ChatMessageService и UserService
- Метод get_user_messages_all для получения всех сообщений
- Метод mark_as_deleted для пометки сообщений как удаленных
- Метод count_messages для подсчета количества сообщений
- Метод get_user_by_id в UserService
2025-11-22 19:46:38 +09:00
49f220c2a2 fix: исправлен порядок обработчиков callback'ов
All checks were successful
continuous-integration/drone/push Build is passing
- Перемещён handle_edit_field ПЕРЕД redirect_to_edit_lottery
- Более специфичный паттерн admin_edit_field_ теперь проверяется первым
- Удалён дубликат обработчика handle_edit_field
- Исправлен ValueError: invalid literal for int() with base 10
2025-11-22 19:41:07 +09:00
ec8a23887d fix: исправлена обработка редактирования розыгрышей
All checks were successful
continuous-integration/drone/push Build is passing
- Добавлен обработчик handle_edit_field для admin_edit_field_{id}_{field} callbacks
- Исправлен toggle_lottery_active - теперь передаёт state вместо None
- Правильный парсинг lottery_id из позиции 3, а не с конца строки
- Обработка 'message is not modified' в bot_controller
- Модифицированы обработчики сообщений для поддержки редактирования
- Добавлен метод update_lottery в LotteryService
- Исправлены ошибки ValueError и AttributeError в меню редактирования
2025-11-22 19:34:30 +09:00
007274785f fix: исправлен callback_data для кнопки создания розыгрыша
All checks were successful
continuous-integration/drone/push Build is passing
- Изменён callback_data с 'create_lottery' на 'admin_create_lottery'
- Теперь кнопка в /start корректно вызывает обработчик из admin_panel.py
- Исправлена ошибка 'Update is not handled' для callback создания розыгрыша
2025-11-22 19:21:51 +09:00
e39ef96b26 fix: полностью переписан Drone CI конфигурационный файл
All checks were successful
continuous-integration/drone/push Build is passing
- Убраны все проблемные webhook уведомления
- Убран второй deployment pipeline (упрощение)
- Убрана секция services (не используется)
- Оставлены только основные шаги: code-quality, dependencies, syntax-check, database-init, tests, build-artifacts
- Все команды имеют fallback (|| echo) для продолжения при ошибках
- Триггер на ветки: master, main, develop
- Артефакты создаются только для main/master при push
- YAML файл проверен и валиден
2025-11-22 19:15:24 +09:00
7067f4656b fix: закомментированы webhook уведомления в Drone CI
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Webhook plugin вызывает ошибки парсинга YAML
- Все уведомления (success, failure, deploy) закомментированы
- Можно раскомментировать после настройки webhook URL
- Исправлена ошибка unmarshal на строке 129
2025-11-22 19:06:49 +09:00
9db201551b fix: разбита длинная команда tar в Drone CI
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Использован многострочный YAML блок для длинной команды
- Команда tar теперь читается как единый блок с переносами
- Исправлена ошибка unmarshal на строке 126
2025-11-22 19:05:14 +09:00
38529a8805 fix: исправлен формат urls в Drone webhook
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- urls должен быть строкой, а не списком
- Убраны квадратные скобки из urls для всех webhook'ов
- Исправлена ошибка unmarshal map into string на строке 126
2025-11-22 19:03:45 +09:00
2e92164bbf fix: исправлен синтаксис YAML в Drone CI
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Заменён headers.Content-Type на content_type в webhook настройках
- Исправлена ошибка 'cannot unmarshal !!map into string' на строке 126
- Применено для всех webhook уведомлений (success, failure, deploy)
2025-11-22 19:01:35 +09:00
69985f6afb fix: улучшена обработка создания розыгрыша
- Добавлено подробное логирование callback admin_create_lottery
- Добавлен немедленный ответ на callback для предотвращения таймаута
- Добавлена обработка ошибок с логированием
- Исправлена логика проверки прав админа
2025-11-22 18:59:34 +09:00
b123e9f714 feat: блокировка голосовых сообщений и аудиофайлов
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Голосовые сообщения (F.voice) теперь отклоняются с предупреждением
- Аудиофайлы/музыка (F.audio) теперь отклоняются с предупреждением
- Пользователям предлагается использовать текст или изображения
- Упрощена логика обработчиков - теперь просто блокировка без проверок
2025-11-19 05:30:07 +09:00
0a98b72cad fix: админ теперь видит все сообщения в чате
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Исправлен exclude_user_id для всех типов сообщений (фото, видео, документы, анимации, стикеры, голосовые)
- Теперь админ получает копии всех сообщений пользователей, независимо от типа контента
- Ранее работало только для текстовых сообщений
2025-11-19 05:27:48 +09:00
dc402270a6 feat: улучшения массовой обработки счетов
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Добавлено уведомление о задержке при отправке >250 счетов
- Реализовано массовое удаление счетов через /remove_account
- Исправлен flood control с задержкой 500ms между сообщениями
- Callback.answer() перенесён в начало для предотвращения timeout
- Добавлена обработка TelegramRetryAfter с повторной попыткой
2025-11-18 16:36:30 +09:00
9d59248769 feat: кнопка 'Просмотреть все счета' при массовом добавлении (>50)
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-18 16:26:46 +09:00
10e257c798 feat: групповые уведомления о добавлении счетов с копируемым форматом
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-18 16:10:24 +09:00
81fb60926c fix: использовать is_claimed вместо is_confirmed в Winner
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-18 16:04:50 +09:00
473ecdc10a feat: универсальный парсер счетов (однострочный и многострочный формат)
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-18 15:58:58 +09:00
bb18ce30e4 fix: упростить логику подтверждения выигрыша - проверка владельца счёта вместо токена
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-17 16:53:03 +09:00
ad7365f7f8 feat: добавить handler подтверждения выигрыша победителем (confirm_win_)
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-17 16:46:00 +09:00
8b3cda373a fix: убрать debug handler который блокировал обработку admin_conduct_confirmed_
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-17 16:40:27 +09:00
18a544bfab fix: изменить фильтр conduct_lottery_draw_confirm на regexp чтобы не перехватывать admin_conduct_confirmed_
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-17 16:37:01 +09:00
d6c193e557 debug: добавить middleware для логирования всех callback запросов
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-11-17 16:33:54 +09:00