Files
new_lottery_bot/scripts/deploy_and_run.sh
Andrew K. Choi e1b4465f89
Some checks failed
continuous-integration/drone/pr Build is failing
feat: Add admin management system with super admin controls
- 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

54 lines
1.6 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Быстрый запуск: deploy_and_run.sh
# Выполняет развертывание и запуск бота одной командой
set -e
echo "🚀 Lottery Bot - Быстрое развертывание и запуск"
echo "=================================================="
echo ""
# Проверка .env
if [ ! -f ".env" ]; then
echo "❌ Файл .env не найден!"
echo ""
echo "Создайте .env файл с содержимым:"
echo "────────────────────────────────────────────"
cat << 'EOF'
BOT_TOKEN=your_bot_token
DATABASE_URL=postgresql://trevor:password@localhost:5432/lottery_bot
ADMIN_IDS=123456789
LOG_LEVEL=INFO
EOF
echo "────────────────────────────────────────────"
echo ""
exit 1
fi
echo "✅ Файл .env найден"
# Создание виртуального окружения
if [ ! -d "venv" ]; then
echo "📦 Создание виртуального окружения..."
python3 -m venv venv
fi
# Активация
source venv/bin/activate
# Установка dependencies
echo "📚 Установка dependencies..."
pip3 install -q --upgrade pip
pip3 install -q -r requirements.txt
# Проверка БД
echo "🗄️ Проверка и инициализация БД..."
python3 scripts/check_db.py
# Запуск бота
echo ""
echo "🤖 Запуск бота..."
echo "=================================================="
echo ""
python3 main.py