A comprehensive multi-platform content moderation system for Discord, WhatsApp, and Telegram.
- Cross-Platform Support: Moderate content across Discord, WhatsApp, and Telegram from a single interface
- Profanity Filtering: Automatic detection and handling of profane language
- Spam Protection: Identify and prevent message flooding and spam
- Warning System: Progressive warning system with configurable thresholds
- AI-Powered Interactions: Integration with Google's Gemini AI for:
- Natural language conversations
- Message summarization
- Context-aware responses
- Centralized Dashboard: Monitor all bots from a clean, intuitive web interface
- Real-time Updates: See bot outputs and status changes as they happen
- QR Code Authentication: Easy WhatsApp authentication with automatic QR code refreshing
dia-moderator/
├── client/ # React frontend
│ ├── build/ # Production build
│ ├── public/ # Static assets
│ └── src/ # Source files
│ ├── components/ # Reusable components
│ ├── pages/ # Page components
│ ├── services/ # API services
│ └── styles/ # Styling
├── docs/ # Documentation
├── server/ # Backend server
│ ├── bots/ # Bot implementations
│ │ ├── discord/ # Discord bot
│ │ ├── telegram/ # Telegram bot
│ │ └── whatsapp/ # WhatsApp bot
│ ├── config/ # Configuration
│ └── utils/ # Shared utilities
├── shared/ # Shared resources
│ └── profanity-list.json # Shared profanity list
└── index.js # Main entry point
- Node.js (v14 or higher)
- npm or yarn
- Discord Developer account (for Discord bot)
- Telegram account (for Telegram bot)
- WhatsApp account on your phone (for WhatsApp bot)
- Gemini API key (for AI features)
Create a .env file in the root directory with the following variables:
# Server Settings
PORT=3001
# Bot Tokens
DISCORD_TOKEN=your_discord_token
TELEGRAM_TOKEN=your_telegram_token
# Bot Settings
PROFANITY_LIMIT=3
MAX_MESSAGES=15
SPAM_LIMIT=5
SPAM_TIME_WINDOW=60000
# AI Integration
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-2.0-flash
-
Clone the repository:
git clone https://github.com/yourusername/dia-moderator.git cd dia-moderator -
Install server dependencies:
npm install
-
Install client dependencies:
cd client npm install cd ..
-
Build the client:
npm run build
-
Start the application:
npm start
npm run devnpm run clientTo run both server and client concurrently (requires concurrently package):
npm run dev:full- Create a Discord application in the Discord Developer Portal
- Create a bot for your application
- Under the "Bot" tab, enable these "Privileged Gateway Intents":
- Presence Intent
- Server Members Intent
- Message Content Intent
- Copy the bot token and add it to your .env file
- Generate an OAuth2 URL with the following scopes:
- bot
- applications.commands
- Select the following bot permissions:
- Manage Messages
- Read Messages/View Channels
- Send Messages
- Kick Members
- Ban Members
- Use the generated URL to invite the bot to your server
- Start the bot through the Dia-Moderator interface
- Start the application
- Navigate to the Explore Bots page
- Start the WhatsApp bot
- Scan the QR code with your WhatsApp app:
- Open WhatsApp on your phone
- Tap Menu or Settings
- Select "WhatsApp Web"
- Point your phone camera at the QR code
- The bot is now connected to your WhatsApp account
- Add the bot to groups or use it in direct messages
- On Telegram, search for @BotFather
- Start a chat and send /newbot
- Follow the instructions to create a new bot
- Copy the bot token provided by BotFather
- Add the token to your .env file
- Start the bot through the Dia-Moderator interface
- Start a conversation with your bot or add it to groups
!warnings- Check warning count!clearwarnings @user- Reset warnings (admin only)!warn @user [reason]- Warn a user (mod only)!ban @user [reason]- Ban a user (admin only)- Tag the bot with questions about rules, policies, etc.
!bot [message]- Chat with the AI!rules- Display group rules!summary- Get a summary of recent messages!test- Check if bot is working!functions- Display help message
/bot [message]- Chat with the AI/rules- Display group rules/summary- Get a summary of recent messages/test- Check if bot is working/start- Get a friendly greeting/functions- Display help message
Edit shared/profanity-list.json to customize the list of words that trigger profanity warnings.
Modify response templates in each bot's implementation file:
- Discord:
server/bots/discord/discord_bot.js - WhatsApp:
server/bots/whatsapp/whatsapp_bot.js - Telegram:
server/bots/telegram/telegram_bot.js
The frontend uses styled-components with a theme. Edit client/src/styles/theme.js to customize colors, spacing, and other UI elements.
If the QR code expires, click the "Regenerate QR Code" button on the WhatsApp bot page.
Ensure that you've enabled all required intents in the Discord Developer Portal.
Verify that your Telegram token is correct and the bot hasn't been stopped by @BotFather.
If you encounter connection problems:
- Check that all required environment variables are set correctly
- Ensure your server can make outbound connections to the respective service APIs
- Check the console output for specific error messages
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Image moderation capabilities
- Voice message moderation
- Analytics dashboard
- More platform integrations (Slack, Microsoft Teams)
- Custom rule creation interface
- Role-based admin panel
This project is licensed under the MIT License - see the LICENSE file for details.
- Discord.js for Discord API integration
- whatsapp-web.js for WhatsApp integration
- node-telegram-bot-api for Telegram integration
- Google Gemini for AI capabilities
Made with ❤️ by petrioteer
