Skip to content

zS1L3NT/ts-discord-soundroid

Repository files navigation

SounDroid Cover Image

SounDroid

License Languages Top Language Commit Activity Last commit

SounDroid (Discord) is a Discord Music bot that plays music from Spotify or YouTube. SounDroid was built as a Discord Bot version of SounDroid v1.

From 25 October 2022, SounDroid has been discontinued (only hosted privately) due me being unable to find a free hosting service that provides both enough RAM and a strong enough internet connection that can run the music bot. SounDroid used to work flawlessly with Heroku until they removed their free tier. Thank you to everyone who has used and supported SounDroid.

Motivation

I always liked Rythm Bot (Discord's most popular music bot) and its capibilities of playing music in a voice channel based on what song was requested, be it Spotify or YouTube. I also used to have a music bot (IUFanBot) that works like Rythm. However, many events happened which lead to the creation of SounDroid bot

  1. I lost the source code to IUFanBot because I built it long before I started using Git
  2. On 6 August 2021, discord.js v13 was released where they changed a lot of things relating to how music bots should be built
  3. On 15 September 2021, Rythm Bot was forced to shut down, leading to a need for an alternative

Because I just finished building SounDroid v1 for a school project, I decided to name this new Discord bot after the app.

Features

  • Discord Commands (Interactions)
    • Song playing
      • /play - Add song to queue. Songs can come from either
        • A YouTube Video Link
        • A YouTube Playlist Link
        • A Spotify Song Link
        • A Spotify Playlist Link
        • A Spotify Album Link
        • A YouTube Music Query
        • A YouTube Video Query
      • /play-range - Add playlist defining range of songs to add. Playlists links can be either
        • A YouTube Playlist Link
        • A Spotify Playlist Link
      • /play-again - Repeat the current song a specified number of times
      • /now-playing - Shows information about the song currently being played
    • Basic Music Controls
      • /pause
      • /resume
      • /skip
      • /loop - Loop the current song
      • /queue-loop - Loop the entire queue
      • /restart - Restart the current song
    • Queue Management
      • /clear-queue
      • /leave-cleanup - Removes songs added by users who aren't in the VC
      • /remove - Remove a song or a range of songs
      • /move - Move a song in the queue to anywhere in the playlist
      • /shuffle
    • Other Commands
      • /help - Opens an interactive help menu describing all commands and how to use them
      • /lyrics - Fetches the lyrics of a song or a query
      • /queue - Shows information about the entire queue
  • Message Commands
    • Other than Using slash commands, all commands above can also be triggered by messages, where / is replaced by the defined prefix in the server.
    • This defined prefix can only be changed with the /set prefix command
    • e.g. If the prefix is defined as ., .play IU Lilac will do the same thing as /play IU Lilac
    • Aliases can be set for all message commands to make using message commands easier. .play can have the alias .p
  • Music Channel
    • Instead of always having to request to see the queue, SounDroid can take over a text channel and always display the most up-to-date queue there. Text channel must be empty and any new messages will be cleared
  • SounDroid will disconnect from a Voice Channel if
    • No song was played for 1 minute
    • No user was in the VC with SounDroid for 1 minute
  • SounDroid's name will change based on
    • The name of the song currently playing
    • The status of the music
      • Playing
      • Paused
      • Loading
  • SounDroid is built on top of nova-bot, a Discord Bot framework meant for building bots more easily
  • Song Selection Menu
    • When you try to play a song through a search query, SounDroid gives you a song selection menu to choose which song matched your query. With this unique search menu, you can make sure the song you are searching for is the correct song, and not just the "first result from youtube" as most bots do it
    • You can also toggle between searching YouTube Music and YouTube for search results image

Usage

Copy the .env.example file to .env then fill in the correct project credentials

$ npm i
$ npm run dev

Credits

DiscordJS provided a template for a music playing bot here. My music player was built on top of this example bot.

Built with

  • NodeJS
    • TypeScript
      • @types/node
      • @types/spotify-web-api-node
      • typescript
    • Discord APIs
      • @discordjs/opus
      • @discordjs/voice
      • discord.js
    • Data APIs
      • google-it
      • spotify-web-api-node
      • ytdl-core
      • ytmusic-api
      • ytpl
    • Prisma
      • @prisma/client
      • prisma
    • Music Related
      • ffmpeg-static
      • libsodium-wrappers
      • youtube-dl-exec
    • Miscellaneous
      • axios
      • colors
      • colorthief
      • dotenv
      • no-try
      • nova-bot
      • tracer

About

Discord Music bot for users to play videos, songs or playlists from either YouTube or Spotify right from their voice channels

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published