Skip to content

Overpowered Discord bot music, powered by Oceanic.js.

License

Notifications You must be signed in to change notification settings

ray-1337/discord-music-bot

Repository files navigation

Discord Bot Music

This is my latest own project around creating Discord bot music from scratch.

Disclaimer

This repository is a bit unstable, including the loop command, etc. However, the rest of it is fine. I will gradually fix any issues and add more features to it.

Motivation

I have a few friends who were hanging out, but they couldn't find a single functional Discord music bot for YouTube. We've tried Uzox, Hydra, MEE6, Jockie Bot, and others alike, but none of them are working.
I was disappointed and said, you know what, F- it.
I've attempted to create my own Discord music bot from scratch, aiming for simplicity and ease of use.

Library

I use:

Installation

  • Fork the repo.
  • npm install first.
    • pnpm and yarn works too, I mainly use pnpm.
    • This repo uses ffmpeg, so please install them first.
      • Search Google on how to install ffmpeg on Ubuntu, Windows, or any.
  • Rename .env.example to .env, edit the configuration first, such as Discord bot token, etc.
    • You can edit the Config.ts file as well.
  • Run npm run dev for testing, and npm run prod for production.

What's so good about it?

I extended this project with more features, such as:

  • Supports YouTube, that's obvious.
  • Supports search mode using Discord dropdown component, by using /play search-mode: true
  • Supports playing contents from the playlist.
  • Supports SoundCloud.
  • Supports TikTok.
  • Supports Spotify URL -> YouTube
    • This means, you are able to use Spotify URL to get the track information and find that track from YouTube.
  • Supports playing with .mp3 file.
  • Supports playing with .mp4 file.
  • Supports age-restriction bypass (YouTube platform only)
  • Supports application/octet-stream.
  • Auto-disconnect when no one's in voice channel.
  • Auto-retry if error occurred, especially 403 error from ytdl-core.
  • Clutter-free.

Known unresolved bugs

Yes, there are bugs in this repository, but they weren't caused by me, I swear.
And, these bugs can be temporarily fixed by restarting the instance.

  • Sometimes, pause command doesn't pause the music.
  • TikTok remains unplayable after few plays.
  • Sometimes, ytdl doesn't play anything at all.

Can I use this too?

Yeah, sure. I don't mind. You can recreate your own command handler, do your things here.

I'm just hoping that you put me on credit when you're using this commercially or vice-versa. ;<

Useful Links