neetcoder is a feature-rich Discord bot built with Node.js and Discord.js v14. It offers a variety of fun and utility commands, an XP/leveling system, reaction roles, automated welcome messages, and more, all powered by a PostgreSQL database managed with Sequelize.
You can add the bot to your server here.
We have a permissions overhaul in progress to not add another administrator to your server.
- Slash Commands: A wide array of interactive commands to enhance your server.
- Fun Commands:
/deathbattle: Engage in a simulated text-based battle against another user./lolprofile <summoner_name> <tag>: Fetch League of Legends player statistics and recent match performance./madlibs: Generate hilarious and random Mad Libs stories./searchbook <title>: Look up book information using the Google Books API./votetimeout <user> <numvotes> <minutes>: Initiate a vote among server members to temporarily timeout a user./fnshop: Fetch the current Fortnite shop.
- Utility Commands:
/init_welcome <channel>: Configure a specific channel for welcome and goodbye messages./init_moderation <channel>: Configure a specific channel for the moderation logs./leaderboard: View the server's top users based on their "aura" (XP level)./level: Check your current aura level and message count./ping: A simple command to check the bot's responsiveness./reactionroleadd <messageid> <emoji> <role>: Add a reaction role to a message./reactionroleremove <messageid> <emoji> <role>: Remove a reaction role from a message./send <message> <color> <channel>: Send a custom embedded message as the bot./server: Get information about the current Discord server./user: Get information about your Discord account./summarize: Uses a ChatGPT wrapper to summarize the previous messages in a channel.
- Fun Commands:
- Automated Features & Events:
- Welcome & Goodbye Messages: Automatically greets new members and announces departures in the designated welcome channel.
- XP & Leveling System ("Aura"): Users gain XP (aura) and level up by sending messages. Level-up notifications are sent in chat.
- Reaction Roles: Assigns or removes roles automatically when users add or remove reactions to configured messages.
- Automatic Mad Libs: Generates a Mad Libs story when
@everyoneis pinged or the bot is mentioned with the word "story". - Dynamic Reloading: Admins can reload bot commands and events without a full restart using a specific chat command.
- Twitter Link Fixer: Automatically fixes messages that contain a link to x.com for improved content embedding.
- Moderation Logs: Logs role changes, message deletions, bans, kicks, etc.
- Database Integration:
- Utilizes PostgreSQL with Sequelize ORM for persistent data storage, including:
- User levels and message counts.
- Server configurations (e.g., welcome channel ID, vote timeout parameters).
- Reaction role setups.
- Vote tracking for the
/votetimeoutcommand.
- Utilizes PostgreSQL with Sequelize ORM for persistent data storage, including:
Follow these steps to set up and run the neetcoder bot locally for development or testing.
-
Prerequisites:
-
Clone the Repository:
git clone https://github.com/jaidenmagnan/neetcoder.git cd neetcoder -
Set Up Environment Variables:
- Copy the
example.envfile to a new file named.env:cp example.env .env
- Open the
.envfile and fill in the required values. This includes:TOKEN: Your Discord Bot Token.CLIENT_ID: Your Discord Application's Client ID.GUILD_ID: The ID of your development/test Discord server (for deploying slash commands locally).LOL_KEY,WAIFU_BASE_URL: API keys/URLs for specific commands.- Database credentials:
DB_NAME,DB_USER,DB_PASS,DB_HOST,DB_PORT. - PostgreSQL container credentials (if using Docker):
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB. NODE_ENV: Set todevelopmentfor local testing.
- Refer to the Discord.js Guide: Creating Your Bot for instructions on obtaining your
TOKENandCLIENT_ID.
- Copy the
-
Install Dependencies: This project uses npm for package management.
npm install
-
Set Up Local PostgreSQL Database (using Docker Compose): If you wish to run PostgreSQL locally using Docker, ensure your
.envfile has thePOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBvariables set. Then, run:docker-compose up -d
This will start a PostgreSQL container. Your application will connect to this database using the
DB_*variables from your.envfile, which should match thePOSTGRES_*variables for the container. -
Deploy Slash Commands: Before starting the bot, deploy the slash commands to your test guild. Ensure
NODE_ENVis set todevelopmentin your.envfile.npm run deploy-commands
If
NODE_ENVisproduction, commands will be deployed globally. -
Run the Bot:
npm run dev
Your bot should now be online and connected to your Discord server.
- Language: JavaScript (Node.js)
- Framework: Discord.js v14
- Database: PostgreSQL
- ORM: Sequelize
- Package Manager: npm
- Linting: ESLint
- Containerization (for DB): Docker (optional, via
docker-compose.yml)
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.