cd ~
git clone https://github.com/Recoba86/Witamin-Game.git
cd Witamin-Gamepython3 -m venv .venvsource .venv/bin/activatepip install -r requirements.txtcp .env.example .env
nano .envEdit these values:
BOT_TOKEN- Get from @BotFather on TelegramADMIN_IDS- Your Telegram user ID (get from @userinfobot)
Example:
BOT_TOKEN=7123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
ADMIN_IDS=123456789python -m bot.mainMake the script executable (one time):
chmod +x start.shRun the bot:
./start.shCreate a service file:
sudo nano /etc/systemd/system/witamin-bot.serviceAdd this content:
[Unit]
Description=Witamin Game Bot
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/Witamin-Game
ExecStart=/root/Witamin-Game/.venv/bin/python -m bot.main
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable witamin-bot
sudo systemctl start witamin-botCheck status:
sudo systemctl status witamin-botView logs:
sudo journalctl -u witamin-bot -fStart in background:
screen -S witamin-bot
cd ~/Witamin-Game
source .venv/bin/activate
python -m bot.mainDetach: Press Ctrl+A then D
Reattach:
screen -r witamin-botList screens:
screen -lsStart session:
tmux new -s witamin-bot
cd ~/Witamin-Game
source .venv/bin/activate
python -m bot.mainDetach: Press Ctrl+B then D
Reattach:
tmux attach -t witamin-botcd ~/Witamin-Game
git pull
source .venv/bin/activate
pip install -r requirements.txt --upgradeThen restart the bot.
source .venv/bin/activate
pip install -r requirements.txtchmod +x start.shCheck logs:
# If using systemd:
sudo journalctl -u witamin-bot -n 50
# If running manually:
python -m bot.mainDelete and recreate:
rm game_bot.db
python -m bot.mainAll configuration is in .env:
# Required
BOT_TOKEN=your_bot_token_here
ADMIN_IDS=123456789,987654321
# Optional (defaults shown)
DATABASE_PATH=game_bot.db
MIN_NUMBER=1
MAX_NUMBER=10000
ROUND_DURATION_MINUTES=2
LOG_LEVEL=INFO- Open Telegram
- Search for
@userinfobot - Start the bot and send any message
- It will reply with your user ID
- Add this ID to
ADMIN_IDSin.env
- Open Telegram
- Search for
@BotFather - Send
/newbot - Follow instructions to create your bot
- Copy the token
- Add to
BOT_TOKENin.env
Ensure these files are executable:
chmod +x start.shEnsure .env is readable:
chmod 600 .env- Python 3.11 or higher
- 512MB RAM minimum (1GB recommended)
- 100MB disk space
- Internet connection
- Python 3.11+ installed (
python3 --version) - Git installed (
git --version) - Repository cloned
- Virtual environment created
- Dependencies installed
-
.envfile configured with BOT_TOKEN -
.envfile configured with ADMIN_IDS - Bot token is valid
- Admin ID is correct
- Bot started successfully
If you encounter issues:
- Check the logs
- Verify
.envconfiguration - Ensure all dependencies are installed
- Check Python version (3.11+)
- Verify bot token is valid
- Confirm you have admin rights in the Telegram group