Creating a Discord Application
Access Discord Developer Portal
Navigate to the Discord Developer Portal and log in with your Discord account.
Create New Application
- Click the “New Application” button in the top right
- Enter a name for your application (e.g., “Rosy Music Bot”)
- Read and accept the Discord Developer Terms of Service
- Click “Create”
The application name will be visible to users when they see your bot. Choose something descriptive and professional.
Creating the Bot User
Generating and Securing Your Bot Token
Reset and Copy Token
In the Bot section:
- Click “Reset Token” (or “Copy” if this is your first time)
- Confirm the reset if prompted
- Click “Copy” to copy your token to clipboard
You can only view the token once after resetting. If you lose it, you’ll need to reset it again.
Save Token Securely
Store your token temporarily in a secure location. You’ll add it to your
.env file in the Configuration step.Configuring Required Intents
Intents allow your bot to receive specific events from Discord. Rosy Music Bot requires these intents:Enable Privileged Gateway Intents
Scroll down to Privileged Gateway Intents and enable:Message Content Intent:
- ✅ Enable this intent
- Required for reading message content and commands
Setting Bot Permissions
Rosy Music Bot needs specific permissions to function properly:Required Permissions
Voice Permissions
Voice Permissions
- Connect: Join voice channels
- Speak: Play audio in voice channels
- Use Voice Activity: Transmit audio without push-to-talk
Text Permissions
Text Permissions
- Send Messages: Send responses to commands
- Send Messages in Threads: Respond in thread channels
- Embed Links: Display rich embeds for music info
- Attach Files: Send files if needed
- Read Message History: Read previous messages
- Add Reactions: React to messages for controls
- Use External Emojis: Use custom emojis in responses
General Permissions
General Permissions
- View Channels: See channels to join and respond
- Use Slash Commands: Support for slash commands (future feature)
Inviting the Bot to Your Server
Select Scopes
Under Scopes, select:
- ✅
bot - ✅
applications.commands(for future slash command support)
Select Bot Permissions
Under Bot Permissions, select the following:General Permissions:
- View Channels
- Send Messages
- Send Messages in Threads
- Embed Links
- Attach Files
- Read Message History
- Add Reactions
- Use External Emojis
- Connect
- Speak
- Use Voice Activity
Generate Invite URL
- Copy the generated URL at the bottom of the page
- Paste it into your browser
- Select the server you want to add the bot to
- Click “Authorize”
- Complete the CAPTCHA if prompted
You must have Manage Server permission to add bots to a server.
Testing Bot Connection
After completing the configuration steps, you can test if your bot connects:- Complete the API Keys setup
- Complete the Configuration setup
- Start your bot:
- Check the console output for:
- In Discord, the bot should now appear Online with status “idle” 🌙
The bot’s presence is configured in
index.js:46-49 to display “r!help 🎶” and status “idle”.Troubleshooting
Bot Doesn't Come Online
Bot Doesn't Come Online
Possible causes:
- Invalid bot token in
.envfile - Token has spaces or quotes around it
- Intents not properly enabled
- Network/firewall blocking connection
- Verify token is correct in
.env - Ensure Message Content Intent is enabled
- Check console for error messages
- Try resetting the token and updating
.env
Bot Doesn't Respond to Commands
Bot Doesn't Respond to Commands
Possible causes:
- Message Content Intent not enabled
- Bot doesn’t have permission to read messages in channel
- Wrong command prefix (should be
r!)
- Enable Message Content Intent in Developer Portal
- Check bot has “View Channels” and “Send Messages” permissions
- Verify you’re using
r!prefix (configured inconfig.js:2)
Bot Can't Join Voice Channel
Bot Can't Join Voice Channel
Possible causes:
- Missing voice permissions
- Voice channel is full
- Bot doesn’t have Connect permission
- Verify bot has Connect and Speak permissions
- Check voice channel user limit
- Ensure bot role has voice permissions
Permission Integer Doesn't Match
Permission Integer Doesn't Match
If the permission integer is different from 2150648832:
- This is fine as long as all required permissions are checked
- Different permission combinations create different integers
- What matters is that all necessary permissions are included
Security Best Practices
-
Never share your bot token
- Don’t commit it to GitHub or public repositories
- Don’t share it in Discord messages or screenshots
- Use environment variables (
.envfile)
-
Add .env to .gitignore
-
Reset token if compromised
- If you accidentally expose your token, reset it immediately
- Update the token in your
.envfile - Restart the bot
-
Use minimal permissions
- Only request permissions the bot actually needs
- Don’t request Administrator permission
-
Keep bot private during development
- Toggle “Public Bot” OFF in Developer Portal
- Only make it public when ready for production
Next Steps
With your Discord bot created and configured, proceed to:- API Keys - Get YouTube and Spotify API credentials
- Configuration - Configure bot settings and start the bot
Save your bot token securely. You’ll need it in the next configuration step.