Discord Bots offered by BisectHosting allow users to install custom, highly customizable bots that can play music, moderate servers, and more. By installing a music bot with the NPM installer, users can utilize slash commands, reaction controls, and more to direct the bot and what it is currently playing. In addition, for the bot used in this tutorial, users can play YouTube or Spotify videos or select from a randomized list of a particular genre. Alternatively, songs can be downloaded and added to the bot manually, which can be a useful alternative if not taking the required steps from streaming sites.
Note: Most Discord bots require additional steps to play Spotify or YouTube music. Detailed instructions can be found at the bottom of this tutorial.
How to Set up a Discord Music Bot
1. A Bot Token is required. To generate a bot token, go to the Discord Dev Portal. This may prompt a login.
2. Press New Application from the top right.
3. Pick a name for the app; this can be anything and will not affect its name on servers.
4. Set any desired descriptors, images, or details for the app.
5. Once finished editing, click Save Changes from the bottom right.
6. Go to the Installation tab.
7. Ensure Install Link is set to None.
8. Press Save Changes.
9. Navigate to the Bot tab and enter a username for the bot. This is what the name will appear as on servers.
10. Untoggle the Public Bot setting and toggle on the Message Content, Server Members, and Presence Intent settings.
11. Press Save Changes.
12. From the Token section, choose Copy. If no token is present, then select the Reset Token button.
13. Acquire a Node.JS bot from GitHub. The one used in this guide can be found here.
14. Extract the .zip file into a new empty folder.
15. Enter the folder, and open the .env file with the desired text editor.
16. Paste the Bot Token into the DISCORD_TOKEN= section.
17. Return to the Dev Portal, and go to the General Information tab.
18. Copy the Application ID.
19. Paste the Application ID into the CLIENT_ID= section of the .env file.
20. Save the document by pressing Ctrl + S or clicking File and then Save.
21. Invite the bot to the server by entering the following link with the Bot's Client ID: https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8.
22. Authorize the bot and add it to the server. Adding a bot requires having Manage Server permissions on that server.
23. Log in to the BisectHosting Starbase panel.
24. Swap the current installation to Node.JS.
25. If Node.JS was already installed, delete all files by pressing Reinstall and choosing Delete current files.
26. Wait for the server to install, then go to the Startup tab.
27. Ensure User Uploaded Files is set to True.
28. Go to the Files tab.
29. Upload the bot's files to the server by dragging and dropping.
30. Start the server.
31. Enter /help in the server to review a list of commands.
Note: By default, YouTube and Spotify URL's cannot be played. See the sections below for instructions on enabling them.
How to Play YouTube Videos
Requirement: YouTube videos require the Cookies from a logged-in YouTube account. To keep cookies secure, consider making a spare YouTube account.
1. Download a browser extension for Chrome/Edge or Firefox to extract cookies.
2. Log in to YouTube with the desired account.
3. From the logged-in page, open the extension and download the cookies from the current site.
Note: Chrome/Edge users can instead press Export As.
4. Save the file as cookies.txt.
5. Log in to the BisectHosting Starbase panel.
6. Stop the server.
7. Go to the Files tab.
8. Open the .env file.
9. From the COOKIES_FILE= section, enter ./cookies.txt.
10. Press Save.
11. Start the server.
How to Play Spotify Songs
1. Go to the Spotify Developer site and Log in.
2. Open the Profile dropdown and choose Dashboard.
3. Press Create App.
4. Enter an App Name and Description.
5. Enter the following Redirect URL: https://localhost/callback and press Add.
6. Select the Checkbox for Web API.
7. Press the checkbox for the Terms of Service, then choose Save.
8. Reveal and copy the Client ID and Client Secret.
9. Log in to the BisectHosting Starbase panel.
10. Stop the server.
11. Go to the Files tab.
12. Open the .env file.
13. Paste the copied ID's into the SPOTIFY_CLIENT_ID= and SPOTIFY_CLIENT_SECRET= sections.
14. Press Save.
15. Start the server.