Enhanced Discord bot that filters Tunisian bad words with other features.
# Tunisian Discord Word Filter Bot
A powerful Discord bot designed to automatically filter and moderate inappropriate language in Tunisian Arabic and French, with advanced admin controls and comprehensive logging.
## 🌟 Features
- **Intelligent Word Filtering**: Advanced regex-based filtering that catches variations, character substitutions, and spacing tricks
- **Automatic Moderation**: Deletes inappropriate messages and applies escalating timeouts for repeat offenders
- **Admin Management**: Comprehensive slash commands for managing the word filter
- **Rate Limiting Protection**: Tracks violations per user with escalating consequences
- **Persistent Storage**: Word lists saved in JSON format with automatic backup
- **Comprehensive Logging**: Detailed logs of all moderation actions
- **Security First**: Environment variable token management and permission-based access
- **Tunisian Arabic Support**: Specialized character mapping for Arabic numerals and letters
## 🚀 Quick Start
### Prerequisites
- Python 3.10 or higher
- Discord Bot Token (from Discord Developer Portal)
- Server permissions: Manage Messages, Timeout Members
### Installation
1. **Clone the repository**
```bash
git clone
github.com
cd tunisian-discord-filter-bot
```
2. **Install dependencies**
```bash
pip install -r requirements.txt
```
3. **Set up environment variables**
Create a `.env` file in the project root:
```env
DISCORD_TOKEN=your_discord_bot_token_here
```
4. **Run the bot**
```bash
python bot.py
```
## 📋 Requirements
Create a `requirements.txt` file with:
```txt
discord.py>=2.3.2
python-dotenv>=1.0.0
```
## ⚙️ Configuration
### Bot Settings
You can customize the bot behavior by modifying these constants in `bot.py`:
```python
# Timeout settings
ENABLE_TIMEOUT = True # Enable/disable user timeouts
TIMEOUT_MINUTES = 5 # Base timeout duration in minutes
# Rate limiting
MAX_VIOLATIONS_PER_HOUR = 3 # …