A multi-purpose Telegram bot for group moderation: automatic new-member approval flow, admin tools, interactive duels, and a daily reputation system in one project.
- automates first-step moderation for new members
- gives admins fast commands for chat management
- adds game mechanics to improve community engagement
- runs on SQLite and does not require a separate DB server
- Auto-moderation for new members with approve/ban buttons.
- Moderation commands:
lock,unlock,mute,ban,warn,pending, and more. - Interactive duels with rules configurable via bot private chat.
- Reputation system with a
1 vote per daylimit. - Local SQLite storage with no external infrastructure required.
bot.py- main Telegram bot file and command handlers.database.py- SQLite data layer and table operations.config.py- local runtime configuration.config.example.py- config template for publishing and first launch..env- local secrets/runtime parameters, must not be committed..env.example- example environment variables for setup.modbot.db- local database created automatically, should not be committed.
- Install Python 3.11+.
- Install dependencies:
pip install -r requirements.txt- Create
.envfrom.env.exampleand set:
BOT_TOKEN- Telegram bot token from BotFatherOWNER_ID- your Telegram user IDDB_PATH- SQLite path if you do not want the default location
- Run the bot:
python bot.py/help- show commands/lockand/unlock- close/open chat/lockmediaand/unlockmedia- disable/enable media/lockpinand/unlockpin- disable/enable pin actions/mute,/unmute,/kick,/ban,/unban/warn,/resetwarns,/pending,/settings/duel,/duelstats,/myduel,/banduel,/unbanduel/rep,/myrep,/toprep
/config- edit global bot settings/addadmin <user_id>- add bot admin/removeadmin <user_id>- remove bot admin/admins- list bot admins
This project is released under the MIT License. See LICENSE.