A simple Discord bot made with Node.js
Install Node.js
Install the project dependencies: npm install
Create a Discord bot
- Create a new bot using the Developer Portal (Instructions)
- Copy the bot token
- Set the
token
property in theCONFIG
object
Add your bot to a server
- Create an invite link for your bot (Instructions)
- Send your invite link to the server owner and have them grant access to the bot
Add your bot to the #general channel
- Ask the server owner for the channel ID of the
#general
channel (Instructions for getting the channel ID) - Set the
general
property in theCONFIG
object
This is the CONFIG object mentioned above:
// Config properties
const CONFIG = {
token: process.env.BOT_TOKEN,
channels: {
general: "GENERAL CHANNEL ID GOES HERE",
},
};
NOTE: The token is stored inside an .env file.
"chalk": "^4.1.0",
"discord.js": "^12.3.1",
"node": "^14.8.0"