NeuroGuard is a Discord moderation bot designed to help servers protect their communities from predators. It uses a user verification system that scans a user's server list for any NSFW servers (porn, condom-related, etc.). If such servers are detected, the bot automatically bans the user.
⚠️ WARNING: This bot is self-hosted. You must complete the installation and configuration process to use it.
- User verification via Discord OAuth2
- Detection and automatic banning of users found in NSFW guilds
- Persistent guild configurations stored in Firebase Realtime Database
- Slash command support with automatic registration
- Lightweight as fuck
- Node.js (v14 or higher)
- A VPS (Virtual Private Server)
- A domain name (e.g.,
.com,.net,.top)
- Clone the Repository:
git clone https://github.com/catroot0/NeuroGuard.git
cd NeuroGuard- Install Dependencies:
npm install- Go to the Discord Developer Portal.
- Click "New Application", name it "NeuroGuard", and accept the Developer Terms of Service and Policy.
- Copy the Application ID from the General Information page.
Open the example.env file in the project directory and update the following:
clientId="your_application_id_here"- Navigate to the OAuth2 tab, click "Reset Secret", confirm, then copy your Client Secret.
- Paste it into the
clientSecretfield inexample.env:
clientSecret="your_client_secret_here"- Go to the Bot tab, click "Reset Token", confirm, then copy your Bot Token.
- Paste it into the
tokenfield inexample.env:
token="your_bot_token_here"- Visit the Firebase Console.
- Create a new project or select an existing one.
- Navigate to Build > Realtime Database, then click Create Database.
- Select the location nearest to your server.
- Choose Start in locked mode and click Enable.
- Go to the Rules tab and replace the rules with:
{
"rules": {
".read": true,
".write": true
}
}Note: Yes. these rules are not very secure, but im just too lazy to change the code :>. just don't let other people have your database url and you're good :3
To make your bot accessible via a custom URL and keep it running 24/7, you’ll want to:
-
Buy a Domain Name
Purchase a domain from registrars like Namecheap, GoDaddy, or Google Domains. Choose a domain that suits your bot or project. -
Set Up a VPS
Rent a VPS from providers such as DigitalOcean, Linode, Vultr, or AWS Lightsail. Choose an OS you are comfortable with (Ubuntu is popular). -
Point Your Domain to the VPS
- In your domain registrar’s DNS settings, add an A Record pointing your domain (e.g.,
yourdomain.com) to the VPS IP address. - Optionally, set up a CNAME Record for
www.yourdomain.compointing toyourdomain.com.
- In your domain registrar’s DNS settings, add an A Record pointing your domain (e.g.,
-
Deploy and Run NeuroGuard on the VPS
- SSH into your VPS.
- Clone the NeuroGuard repository and follow the installation.
- Use a process manager like pm2 to keep the bot running continuously.
To ensure OAuth2 works correctly, you must add your bot's redirect URL to the Discord Developer Portal:
- In your application's page, go to the OAuth2 tab.
- Scroll down to the Redirects section.
- Click "Add Redirect" and enter:
yourdomain.com/callback - Click "Save Changes" at the bottom.
⚠️ Important: Make sure this matches exactly what you put in your.envfile asredirectUrl. If they don’t match, the OAuth2 flow will fail.
Ensure your example.env contains all credentials properly wrapped in quotes, e.g.:
clientId="your_application_id_here"
clientSecret="your_client_secret_here"
token="your_bot_token_here"
firebaseDatabaseURL="your_firebase_database_url_here"
redirectUrl="https://yourdomain.com/callback"
port="your_vps_port"
host="your_vps_ip"Once its done rename the example.env file to .env.
- Compile the project by running
npm run build- Once the compiling process is done run the bot by running
npm run devContributions are welcome! If you want to help improve the bot, follow these steps:
- Fork the repository.
- Create a new branch from
master:git checkout -b feature/my-feature-name master
- Make your changes.
- Commit your changes:
git commit -am "Add: your feature description" - Push to your branch
git push origin feature/my-feature-name
- Open a pull request targeting the master branch.
Distributed under the MIT License.
- GitHub: catroot0
- Telegram: @catroot01
- Discord: @catroot0