Telegram chat moderation bot that automatically removes messages containing profanity.
- 🔍 Monitoring messages for profanity
- 🗑️ Automatic removal of messages containing swear words
⚠️ Sending warnings to violators- 🔄 Support for checking edited messages
- 🔡 Detection of masked profanity (transliteration, similar symbols)
git clone https://github.com/0xEtherPunk/telegram-moderator-bot.git
cd telegram-moderator-bot
pip install aiogram transliterate
bot_token = "YOUR_BOT_TOKEN" # Get from @BotFather
group_id = "YOUR_GROUP_ID" # Your group ID
python main.py
- Bot must be a group administrator
- Delete message permissions required
In filters/words.py
you can configure:
bad_words
- list of forbidden wordsnot_bad_words
- list of exceptionsen_ru_map
- symbol replacement rules
- Bot monitors all new messages in the group
- When profanity is detected:
- Deletes the message
- Sends a warning to the user
- Removes the warning after 5 seconds
- The system checks various masking methods:
- Transliteration
- Similar symbols
- Mixed alphabets