A Simple Discord bot that automatically assigns the member role to new users when they join a specific server.
- Install dependencies:
npm install-
Create a new Discord bot:
- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" section and create a bot
- Copy the bot token
-
Configure the bot:
- Open
index.js - Replace
tokenwith your bot's token - Replace
TARGET_SERVER_IDwith your server's ID - Replace
MEMBER_ROLE_IDwith your member role's ID
- Open
-
Invite the bot to your server:
- Go to the OAuth2 section in the Developer Portal
- Generate an invite URL with the following permissions:
- bot
- Manage Roles
-
Run the bot:
npm start- Node.js
- npm
- Discord.js v14