How private-bots-official/anime-generator-bot works
This is a Telegram bot that selects an SFW or NSFW anime-image category, requests an image, and replies to the user. Its message handler also tracks users, enforces optional channel membership, and supports owner status and broadcasts. Configuration and translation define shared settings and bot messages; MongoDB-backed user/member records are optional. The README documents the product capabilities, while the sampled sources do not show callback or new-member plugin behavior, so those components are included without speculative connections.
Main entry points: start.py Message handler · members.py Member records · config.py Configuration · bot.py Web server
Components 18
Bot runtime
- Message handler
plugins/start.py - Callback plugin
plugins/callback.py - New-member plugin
plugins/new_mem.py - Web server
bot.py - Landing page
web/index.html
Image generation
- Category policy
modules/enums.py - Image API client
utils/api.py
User and admin
- User records
database/users.py - Member records
database/members.py - Broadcast
utils/broadcast.py - Message reaction
utils/send_reaction.py
Shared services
- MongoDB setup
database/__init__.py - Configuration
config.py - Bot text and buttons
translation.py
Other components
- Telegram user
- Telegram
- Waifu image API
- MongoDB
Connections 18
- Telegram user → Message handler: sends message
plugins/start.py - Message handler → Telegram: replies
plugins/start.py - Message handler → Category policy: selects category
plugins/start.py - Message handler → Image API client: requests image
plugins/start.py - Image API client → Waifu image API: fetches image
utils/api.py - Message handler → User records: tracks users
plugins/start.py - Message handler → Member records: records members
plugins/start.py - Message handler → Broadcast: runs broadcast
plugins/start.py - Message handler → Message reaction: sends reaction
plugins/start.py - Message handler → Bot text and buttons: uses messages
plugins/start.py - Message handler → Configuration: reads settings
plugins/start.py - Member records → MongoDB setup: checks connection
database/members.py - MongoDB setup → MongoDB: connects
database/__init__.py - Web server → Landing page: serves page
bot.py - Web server → Configuration: reads settings
bot.py - Category policy → Configuration
- Callback plugin → Message handler
- New-member plugin → Member records