Setting Up a Discord Bot
Prerequisites
- Discord Bot Server
- NodeJS v22 is LTS or newer
- Minimum of 256MB of RAM for the bot to operate.
- License can be obtained on our Discord after purchase
Steps to set up NovaBot
Step 1: Create a Discord Application
- Go to the Discord Developer Portal.
- Click on the "New Application" button.
- Give your application a name and click "Create".
Step 2: Create a Bot User
- In your new application, navigate to the "Bot" tab on the left.
- You can customize your bot's profile by setting an avatar and name.
- Turn "Public Bot" setting off.
Tip
In "General Information" you can set up display name for your bot and description (bio).
Step 3: Get Your Bot’s credentials (Token/Application ID)
- In the "Bot" tab, under the "TOKEN" section, click "Copy" to get your bot's token. Keep this token secret.
- ApplicationID can be found in "General Information".
- Place both of these values into bot configuration file in root folder of the bot.
- Turn on all intents "Presence Intent", "Server Members Intent" and "Message Content Intent" to ensure bot's full functionality.
Step 4: Invite Your Bot to a Server
- Go to the "Installation" tab on the left.
- Under "Installation Contexts", select the "Guild Install".
- Under "Install Link", select the "Discord Provided Link".
- Under "Default Install Settings" choose "application.commands" and "bot".
- Save changes and copy the generated URL from step 3 and open it in your browser.
- Select the server you want to invite your bot to and click "Authorize".
Steps to set up MongoDB Cluster
Step 1: Register for a MongoDB Atlas Account
- Visit the MongoDB Atlas registration page.
- Fill in the required information such as name, email, and password.
- Click the "Get started free" button.
- Verify your email address by clicking on the verification link sent to your email.
Step 2: Log in and Create a Cluster
- Log in to your MongoDB Atlas account using your registered email and password.
- Once logged in, you will be directed to the Atlas dashboard. Click on "New Project" to create a new project.
- Enter a project name and click "Next".
- Click on "Build a Cluster" to create a new cluster.
- Choose your preferred cloud provider and region.
- Select the cluster tier (for the free tier, choose M0 Sandbox).
- Click "Create Cluster".
Follow-up Steps
- Set up IP Adress of your bot to secure connect into the MongoDB cluster to ensure proper access control and data security.
- Connection string can be get trough clicking in cluster on "Connect" button with Mongoose driver selected (latest version) and you'll get something like
mongodb+srv://<name>:<db_password>@novabotdatacluster.something.mongodb.net/?retryWrites=true&w=majority&appName=myAppName
- Change
<name>
and<db_password>
with your created credentials and copy the whole string into bot's configuration.
Final: Run Your Bot
In your terminal, run node index.js
.
Pterodactyl Panel
For Pterodactyl panel type index.js
into Main file
in Startup
tab.
Success
That's it! You have successfully set up your NovaBot.