Code Monkey home page Code Monkey logo

24-7-music-bot's Introduction

24/7 Discord Music Bot Run on Repl.it

This project is currently based off of Discord.js v12. I do not have plans to transition it to v13 until I have a better understanding of the new voice library.

Description

A 24/7 music bot for Discord that can play from a list of user-defined videos.

Set-up guide

Note: Node.js and ffmpeg are required.

  1. First, you need to create a bot user for Discord. You can do this by going to the Discord Developer Dashboard. Create a new app and add a bot user by going to the Bot tab at the side of the screen.

  2. The next step is to invite the bot to your server. You can do this by going to the OAuth2 panel in the Discord Developer Dashboard, checking bot and then the permissions that you want the bot to have. The only 3 mandatory permissions are View Channels, Connect, and Speak. Copy the URL it gives you and paste it into your browser. It will ask you to select a server to invite it to. You must have the Manage Server permission in the server to add it.

  3. The bot is now in your server. The next step is to set the bot up to play music. Download the source code by pulling from this repo. You can do this however you want. Installing git and using git clone https://github.com/connordennison/24-7-music-bot.git is the method I recommend.

  4. The next step is to install the dependencies. Change directory into the folder and install them with npm i.

  5. After that, rename config.json.example to config.json and modify the contents inside to contain your voice channel ID, and a list of videos you want the bot to shuffle through. You can find out how to get the channel ID here. For one singular video the list will only have one element, and should look ["like_this"]. For multiple videos, the list will need multiple elements separated by commas, and should look ["like", "this"]. All video URLs need https:// at the beginning.

  6. Next you need to add your bot token to the environment variables. This will be different depending on whether you're running on Replit or not. If you're not running on Replit, rename .env.example to .env and replace the dummy token with your bot token from the Discord Developer Dashboard. If you're on Replit, go to the secrets tab on the left hand side of the screen secrets tab and create a new secret. In the key text box enter TOKEN, and in the value box enter your bot token.

  7. Finally, you can run the bot. To run on Replit, simply press ctrl+enter or click the run button at the top of the screen. If you want to have your bot always on, set up UptimeRobot to run on your Repl's URL. Type npm run bot (or yarn bot if you have yarn) in the same directory as package.json to start it. It will connect to the channel and start shuffling from the list of videos in config.json.

24-7-music-bot's People

Contributors

cnnrde avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.