Discord communities are increasingly targeted by scam accounts that:
- Join servers with fresh accounts
- Immediately start sending phishing links or scam messages
- Target vulnerable users with fake giveaways, NFT scams, or malware
- Damage community trust and safety
Manual moderation is time-consuming and ineffective against coordinated attacks.
This Discord bot automatically protects your server by:
- Detecting new members with accounts younger than 6 months
- Analyzing profile descriptions for scam patterns (DayZ modder, Arma 3 coder, etc.) on accounts older than 6 months
- Automatically removing these high-risk accounts
- Sending humorous messages to kicked users with information on how to get whitelisted
- Maintaining a whitelist for trusted users with newer accounts
- Owner-only commands for managing the whitelist via Discord
- ๐ Account Age Verification: Automatically checks the age of new members joining the server
- ๐ต๏ธ Profile Analysis: Detects suspicious patterns in usernames and display names (DayZ modder, Arma 3 coder, game developer, etc.)
- ๐ข Automated Moderation: Kicks accounts that are less than 6 months old OR have suspicious profile descriptions
- ๐ Humorous Messaging: Sends funny kick messages in Chuck Norris/Bruce Lee style
- โช Whitelist System: Maintains exceptions for trusted users
- ๐ฎ Discord Slash Commands: Owner-only
/whitelistcommand for easy management - ๐ Owner-Only Access: Whitelist commands restricted to bot owner via Discord ID
- ๐ Comprehensive Logging: Detailed logs of all actions for monitoring
- ๐ณ Docker Support: Easy deployment with Docker and Docker Compose
- ๐ CI/CD Integration: GitHub Actions workflow for testing and deployment
- Node.js 16+ or Docker
- Discord Bot Token
# Clone the repository
git clone https://github.com/yourusername/discord-scam-bot-kicker.git
cd discord-scam-bot-kicker
# Copy the example environment file
cp .env.example .env
# Edit .env and add your Discord bot token
nano .env
# Start the bot
docker-compose up -d
# View logs
docker-compose logs -f# Clone the repository
git clone https://github.com/yourusername/discord-scam-bot-kicker.git
cd discord-scam-bot-kicker
# Install dependencies
npm install
# Copy the example environment file
cp .env.example .env
# Edit .env and add your Discord bot token
nano .env
# Start in development mode
npm run start:dev
# Or build and start in production mode
npm run build
npm run start:prod- Create a new application at Discord Developer Portal
- Go to the "Bot" section and create a bot
- Copy the bot token and add it to your
.envfile - Go to OAuth2 section
- In URL Generator, select these scopes:
botapplications.commands
- Select these bot permissions:
Kick MembersSend MessagesRead Messages/View Channels
- Use the generated URL to invite the bot to your server
# Discord Bot Token
DISCORD_TOKEN=your_discord_bot_token_here
# Discord Owner ID (Your Discord User ID - right click your profile and copy ID)
OWNER_DISCORD_ID=your_discord_user_id_here
# Node Environment
NODE_ENV=development
How to get your Discord User ID:
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click your username/profile anywhere in Discord
- Click "Copy User ID"
- Paste this ID into the
OWNER_DISCORD_IDfield in your.envfile
Use the /whitelist command in Discord (owner only):
/whitelist add username:JohnDoe reason:Trusted friend
/whitelist remove username:JohnDoe
/whitelist list
Features:
- โ Add users to the whitelist with a reason
- โ Remove users from the whitelist
- ๐ List all whitelisted users
- ๐ Only accessible by the bot owner (configured via
OWNER_DISCORD_ID)
The whitelist file is located at ./config/whitelist.json:
{
"whitelistedUsers": [
{
"username": "TrustedUser123",
"reason": "Trusted member"
}
]
}You can:
- Edit the file directly - changes will be reflected immediately
- Back up the whitelist by copying the file
- Version control your whitelist if needed
version: '3'
services:
discord-bot:
build: .
restart: unless-stopped
volumes:
- ./config:/app/config
- ./.env:/app/.env:ro./config:/app/config- Contains the whitelist file./.env:/app/.env:ro- Environment file (read-only)
Logs are stored in the container and can be viewed with:
docker-compose logs -fThe container is configured to rotate logs:
- Maximum log file size: 10MB
- Maximum number of log files: 3
The bot uses a two-tier detection system:
-
Account Age Check (All accounts)
- Accounts younger than 6 months are automatically kicked
- This catches most fresh scam accounts
-
Profile Analysis (Accounts 6+ months old)
- Scans username, display name, and global name for suspicious keywords:
- "dayz modder", "dayz coder", "dayz developer"
- "arma 3", "arma3", "arma reforger"
- "fivem dev", "assisting dev"
- "game modder", "game developer", "mod developer"
- "script developer", "passionate about scripting"
- "building immersive", "sim racing", "flight sim"
- Detects multi-game patterns (e.g., mentioning both FiveM + DayZ, or Arma + DayZ)
- Kicks users with matching patterns (case-insensitive)
- Scans username, display name, and global name for suspicious keywords:
-
Whitelist Bypass
- Whitelisted users bypass all checks
- Managed via Discord commands or manual file editing
- Verify
OWNER_DISCORD_IDis set correctly in your.envfile - Make sure you copied your Discord User ID, not your username
- Enable Developer Mode in Discord to access the "Copy User ID" option
If you need to reset the whitelist:
- Stop the container:
docker-compose down - Delete or edit the whitelist:
./config/whitelist.json - Restart the container:
docker-compose up -d
- Verify your Discord token is correct in the
.envfile - Verify your Discord owner ID is correct in the
.envfile - Check if the bot has the required permissions in your Discord server
- View the logs for any error messages:
docker-compose logs -f
- The bot checks usernames, display names, and global names (not the "About Me" section, as it's not accessible via Discord API)
- Scammers often put suspicious keywords in their display names
- Check logs for any errors related to profile fetching
# Run linter
npm run lint
# Run unit tests
npm run test
# Run e2e tests
npm run test:e2eThis project is licensed under the MIT License - see the LICENSE file for details.
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
Built with โค๏ธ by TheDmitri
