Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

96 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌸 YUKIWAFUS

Typing SVG

Stars Forks Issues License Python Pyrogram


🌸 A premium Telegram waifu collection bot β€” guess, collect, trade & battle your waifus! Built with Pyrogram Β· MongoDB Β· Async Β· Smart Anti-Spam


Deploy on Heroku Deploy on Render Deploy on Railway


✨ Features

  • 🌸 Auto Spawn β€” Waifus spawn after N group messages
  • 🎯 Smart Guess β€” Fuzzy name matching, multi-word support
  • βš”οΈ Battle System β€” 1v1 waifu battles with rarity stats
  • πŸ—‚ Harem β€” View your full collection inline
  • ❀️ Favourites β€” Pin up to 5 waifus to your profile
  • πŸ”„ 2-Way Trade β€” Trade waifus with confirm/cancel
  • 🌸 Sakura Economy β€” Earn coins, pay, leaderboard
  • πŸ›‘ Anti-Spam β€” Per-user rate limit, spawn farm protection
  • πŸ” Inline Search β€” Search global DB or any user's collection
  • πŸ“Š Stats & Ping β€” Live bot health dashboard
  • πŸ“’ Broadcast β€” Owner-level announcements
  • πŸ—ƒ Group Logger β€” Logs bot add/remove to log channel

πŸ—‚ Project Structure

YUKIWAFUS/
β”œβ”€β”€ YUKIWAFUS/
β”‚   β”œβ”€β”€ __init__.py          # Pyrogram client
β”‚   β”œβ”€β”€ __main__.py          # Module auto-loader
β”‚   β”œβ”€β”€ logging.py           # Colorlog setup
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── Mangodb.py       # All MongoDB collections
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ api.py           # Waifu API helpers
β”‚   β”‚   └── helpers.py       # sc(), cmd() utils
β”‚   └── modules/
β”‚       β”œβ”€β”€ WAIFU/
β”‚       β”‚   β”œβ”€β”€ start.py
β”‚       β”‚   β”œβ”€β”€ spawn.py     # Auto spawn + anti-spam
β”‚       β”‚   β”œβ”€β”€ guess.py
β”‚       β”‚   β”œβ”€β”€ harem.py
β”‚       β”‚   β”œβ”€β”€ hclaim.py
β”‚       β”‚   β”œβ”€β”€ battle.py
β”‚       β”‚   β”œβ”€β”€ fav.py
β”‚       β”‚   β”œβ”€β”€ trade.py
β”‚       β”‚   β”œβ”€β”€ balance.py
β”‚       β”‚   └── daily.py
β”‚       β”œβ”€β”€ ADMIN/
β”‚       β”‚   β”œβ”€β”€ addwaifu.py
β”‚       β”‚   β”œβ”€β”€ sudo.py
β”‚       β”‚   └── broadcast.py
β”‚       └── TOOLS/
β”‚           β”œβ”€β”€ ping.py
β”‚           β”œβ”€β”€ stats.py
β”‚           β”œβ”€β”€ group.py
β”‚           └── inline_query.py
β”œβ”€β”€ config.py
└── requirements.txt

βš™οΈ Configuration

Create a config.py or set environment variables:

Variable Required Description
API_ID βœ… Telegram API ID from my.telegram.org
API_HASH βœ… Telegram API Hash
BOT_TOKEN βœ… Bot token from @BotFather
MONGO_URI βœ… MongoDB connection string
OWNER_ID βœ… Your Telegram user ID
LOG_CHANNEL βœ… Channel/group ID for bot logs
SUDO_USERS ❌ List of sudo user IDs
WAIFU_API_URL βœ… Waifu API base URL
WAIFU_PICS ❌ List of fallback photo URLs

πŸš€ Deployment

πŸ“¦ Method 1 β€” VPS (Recommended)

Requirements: Ubuntu 20.04+ Β· Python 3.11+ Β· MongoDB

# 1. Clone the repo
git clone https://github.com/YOURNAME/YUKIWAFUS
cd YUKIWAFUS

# 2. Install Python 3.11 (if not present)
sudo apt update && sudo apt install -y python3.11 python3.11-venv python3-pip

# 3. Create virtual environment
python3.11 -m venv venv
source venv/bin/activate

# 4. Install dependencies
pip install -r requirements.txt

# 5. Configure
cp config.example.py config.py
nano config.py   # fill in your values

# 6. Run
python -m YUKIWAFUS

Run as a background service (systemd):

sudo nano /etc/systemd/system/yukiwafus.service
[Unit]
Description=YUKIWAFUS Telegram Bot
After=network.target

[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/YUKIWAFUS
ExecStart=/home/ubuntu/YUKIWAFUS/venv/bin/python -m YUKIWAFUS
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable yukiwafus
sudo systemctl start yukiwafus

# Check logs
sudo journalctl -u yukiwafus -f

🟣 Method 2 β€” Heroku

⚠️ Free tier no longer available. Requires Eco/Basic dyno ($5/mo)

  1. Click Deploy on Heroku button above
  2. Fill in all config vars in the Heroku dashboard
  3. Set dyno type to worker (not web)
  4. Enable the dyno after deploy
# Or via CLI
heroku create yukiwafus-bot
heroku config:set BOT_TOKEN=xxx API_ID=xxx API_HASH=xxx MONGO_URI=xxx
git push heroku main
heroku ps:scale worker=1

Procfile (create this in root):

worker: python -m YUKIWAFUS

🟒 Method 3 β€” Render

  1. Click Deploy on Render button above
  2. Select Background Worker (not Web Service)
  3. Set build command: pip install -r requirements.txt
  4. Set start command: python -m YUKIWAFUS
  5. Add all environment variables

βœ… Render free tier works for bots (no sleep for background workers)


πŸš‚ Method 4 β€” Railway

  1. Click Deploy on Railway button above
  2. Connect your GitHub repo
  3. Add environment variables in the Railway dashboard
  4. Railway auto-detects Python and deploys
# Or via CLI
railway login
railway init
railway up

🐳 Method 5 β€” Docker

FROM python:3.11-slim

WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt

CMD ["python", "-m", "YUKIWAFUS"]
docker build -t yukiwafus .
docker run -d \
  -e BOT_TOKEN=xxx \
  -e API_ID=xxx \
  -e API_HASH=xxx \
  -e MONGO_URI=xxx \
  -e OWNER_ID=xxx \
  -e LOG_CHANNEL=xxx \
  --name yukiwafus \
  yukiwafus

πŸ“‹ Commands

Command Description Access
/start Start the bot All
/guess <name> Guess active waifu Groups
/harem View your collection All
/fav <name> Add to favourites All
/unfav <name> Remove from favourites All
/myfav View favourites list All
/balance Check Sakura balance All
/pay <amount> Pay another user All
/trade <waifu> | <waifu> Trade waifus All
/daily Claim daily reward All
/battle Battle another user Groups
/spawnon Enable waifu spawn Admin
/spawnoff Disable waifu spawn Admin
/setspawn <n> Set spawn rate Admin
/fspawn Force spawn Sudo
/addwaifu Add waifu to DB Sudo
/broadcast Broadcast message Owner
/addcoins Add coins to user Sudo
/deduct Deduct coins Sudo
/ping Bot ping & health All
/stats Bot statistics All

πŸ›‘ Anti-Spam System

YUKIWAFUS has a built-in smart anti-spam system in spawn.py:

  • Per-user rate limit β€” 3 messages in 3 seconds = spam detected
  • 5 min block β€” spammer's messages don't count toward spawn
  • One-time warning β€” user gets warned once per block session
  • Chat cooldown β€” 10 sec between spawns (mass activity guard)
  • Global cooldown β€” 2 sec between any spawn across all groups
  • Memory guard β€” auto-cleans dicts at 10,000 entries

🀝 Contributing

# Fork β†’ Clone β†’ Branch β†’ PR

git clone https://github.com/YOURNAME/YUKIWAFUS
git checkout -b feature/my-feature
# make changes
git commit -m "feat: my feature"
git push origin feature/my-feature
# open Pull Request on GitHub

⭐ Support

If this bot helped you, please star the repo β€” it helps a lot!

Star History Chart


πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


Made with 🌸 by YUKIWAFUS Team

footer

Releases

Packages

Contributors

Languages