1. π΅ Lavalink Node Configuration
Lavalink is an external audio standalone provider that handles music voice connections, taking the CPU load off your main bot process.Configuration Fields
Open yourconfig.js file and locate the lavalink object:
Finding Lavalink Nodes
If the default node is offline, you have two options:- Use Public Nodes: You can find list of free, community-run public Lavalink nodes from sites like lavalink.darrennathanael.com or Discord lists.
- Self-Host Lavalink: Deploy your own private node on your VPS using Java and the Lavalink
.jarserver. This guarantees 100% uptime and no sharing of bandwidth.
2. π Spotify API Integration
Since Spotify doesnβt allow direct audio streaming, Razor reads Spotify playlists, albums, or track metadata via the Spotify API, then dynamically searches and plays the matching audio stream. Follow these steps to generate your Spotify developer credentials:Step 1: Create a Spotify Developer App
- Go to the Spotify Developer Dashboard.
- Log in with your standard Spotify account.
- Click the Create App button.
- Fill in the application details:
- App Name:
Razor Music Bot - App Description:
Music metadata integration for Razor Bot. - Redirect URI:
http://localhost:5500/callback(you can put any valid URL here).
- App Name:
- Accept the terms and click Save.
Step 2: Retrieve Credentials
- Inside your newly created app page, click on Settings (top right).
- Look for the Client ID and click Show client secret to display the Client Secret.
- Copy both values.
Step 3: Insert into config.js
Open config.js and locate the API settings. Replace the empty strings with your credentials:
3. π Verifying the Music System
Once you restart the bot, check your console boot logs. If the connection is successful, you will see the following confirmation log:config.js.