Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

kaaaxcreators/Discord-MusicBot

Repository files navigation

Not maintained anymore. Likely to not work anymore

🤖 Typescript Discord Music Bot

wakatime Gitmoji semantic-release Typescript GitHub Release CI

💻 First Start

Rename .env.example to .env
Insert Token and a Prefix of your choice Change Presence to your desire. This will be the "Activity" your bot is doing

🔗 Invite

https://discord.com/oauth2/authorize?client_id=<your_client_id>&permissions=2205280320&scope=applications.commands%20bot

Replace your_client_id with your client id from your Discord Application

Spotify

Spotify Tracks and Playlists are supported

But it really just tries to find the Spotify Song on Youtube

A Track has to be in this format: https://open.spotify.com/track/<anything>

A Playlist has to be in this format: https://open.spotify.com/playlist/<anything>

🌱 Environment Variables

Required

  • TOKEN: Discord Bot Token
  • PREFIX: Bot Prefix
  • PRESENCE: Discord Presence/Activity Text
  • SECRET: Discord Client Secret
  • WEB: Hosting Website including Protocol

Optional

  • LOCALE: Language (ISO-639-1). Available Languages are de, en. Defaults to en
  • LOG: Log Filename. Defaults to logs.log
  • PERMS: Discord Permission Integer. Defaults to 2205281600
  • SCOPES: Discord OAuth2 Scopes separated with a space. Defaults to identify guilds applications.commands
  • CALLBACK: Discord OAuth2 Callback URL. Defaults to /api/callback
  • LIVERELOAD: Enable Livereload. Set to true to enable it. (needs browser extension),
  • PRESENCETYPE: Discord Presence/Activity Type. Can be STREAMING, WATCHING, PLAYING, LISTENING. Defaults to 'LISTENING'
  • DISABLE_WEB: Check here
  • DIDYOUMEAN: Check here
  • GUILDPREFIX: Check here
  • GUILDACTIONS: Check here
  • UPDATEDIFF: How often Data should be updated in minutes. Defaults to 5

📑 Commands

A List of all available commands is available here

💨 Run Project

🐳 Docker

Docker Images are available on the Docker Hub

When starting the container provide the Environment Variables

Setup a Docker Volume at /usr/src/app/db

CapRover

Create New App with Persistent Data

Container HTTP Port: 8080

In App Configs set Environment Variables and a Persistent Directory with the Path in App being /usr/src/app/db and the Label anything you want

Deployment: Deploy via ImageName: kaaaxcreators/discord-musicbot

Heroku

Deploy

App name: Any name you want

Region: Region closest to you

Config Vars: Enter your Variables

Click: Deploy app

💤24/7: Keep Heroku app awake with Kaffeine

Replit

Run on Repl.it

On the Sidebar click on the Lock ("Secrets (Environment Variables)")

Enter Environment Variables

Click on "Run ▶️"

Wait until "[API] Logged in as <your_bot_name>"

💤24/7: Keep Repl awake with UptimeRobot, HetrixTools, Cronnomy or cron-job.org

Glitch

Remix on Glitch

Delete .env

Rename .env.example to .env

Enter Environment Variables

💤24/7: Glitch doesn't support 24/7 in Free Plans

Directly

Install NodeJS v14.0.0 or higher

Run npm i to install required packages

Run npm run deploy to compile and start the Bot

System Requirements

You'll need 1 Core and 200MB of RAM to run this Bot on multiple servers

Connected to 2 VC playing music draws 100MB of RAM and 25% CPU (3,3 GHz) With Dashboard enabled it uses 150MB of RAM and 30% CPU (3,3 GHz)

🌐 Localization

You can add and contribute to Languages here

📁 Log

Example

[2021-05-28 16:05:28] info "dist\index.js:95:26" "Laden des Musikbefehls: earrape",
Meaning Value in Example Description
When [2021-05-28 16:05:28] Time in Format YYYY-MM-DD HH:MM:SS
Type info Log Level / Reason
Where "dist\index.js:95:26" Where the Log is comming from
What "Laden des Musikbefehls: earrape" What was logged

❌ Disabling Dashboard

Disable the Express Server and with it the Dashboard

Add Environment Variable DISABLE_WEB with content true

You still have to set all Required Environment Variables but they can be empty

⬆️ Migration

See MIGRATE for more infos

🤔 didyoumean

responds to u if you mistype a command with the nearest possible solution.

Enable it by setting a Env Var DIDYOUMEAN with content/value true

Uses didyoumean2

Guild Prefix

Be able to change Prefixes on per Guild basis

Enable it by setting a Env Var GUILDPREFIX with content/value true

Guild Actions

Allow Users to change Settings in the Dashboard (Prefix, Queue, ...)

Enable it by setting a Env Var GUILDACTIONS with content/value true

🔒 Security Warning: This feature is not fully secure! If somebody gets demoted/removed/etc they can still use dashboard actions for up to 5 minutes

©️ Credits

This Bot / Repo is not a fork but heavily inspired from SudhanPlayz/Discord-MusicBot. I didn't like the move to Lavalink which adds an unnecessary dependency, because you need a server which hosts Lavalink and not everyone wants to. Through my approach that the client handles all music, it sometimes hangs or lags shortly but not really noticeable

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.