MRVN is a Discord music player bot.

Overview

MRVN smiley face MRVN

MRVN is a Discord music player bot. It has a few neat features:

  • Supports a wide array of sites, including Youtube, Soundcloud, Twitch and many more. Sites can be blocked, and the default search site can be configured.
  • Exclusively uses Discord application commands.
  • Multi-channel support: allows simultaneous playback in multiple channels by using multiple bot applications.
  • Per-user queues: your queued songs follow you between channels. Each bot alternates between songs queued by people in the channel, so nobody misses out.

Commands

  • /play [query or url] adds a song to your queue and starts playback in the channel if required.
  • /pause pauses the current song playing your voice channel.
  • /play unpauses the current song, or makes the bot start playing if you have previously queued songs.
  • /skip skips the current song, or votes to skip if it you weren't the original queue-er. The number of votes needed is configurable.
  • /stop skips the current song and doesn't play any more queued songs. Use /play to continue playback.
  • /replace replaces your most recently queued song.
  • Queue management is not implemented yet.

Set up

MRVN is self-hosted. This means you must register your own Discord applications and run the bot on your own system. It's written in Rust and runs on Windows, Linux and macOS. You can build MRVN yourself or use our prebuilt Docker images, but either way you must set up the Discord application first:

Creating the Discord Applications

  1. Open the Discord Developer Portal and create an application for each channel you want to be able to play simultaneously. E.g. if your guild has three voice channels, you might want three applications to be able to listen to music in all channels at the same time.
  2. Ensure you create a Bot user for each application. You can do this from the "Bot" panel in the application settings.
  3. Download a copy of the config.example.json file and save it somewhere, maybe as config.json. This file contains your configuration for the bot, including Discord application tokens.
  4. Open the new config.json file and add the bot token and application ID for each Discord application. The "command bot" is the one that has application commands registered against it. It can be one of the voice bots, but you must also include it in the voice bot list.
  5. Add each bot user to your Discord guild:
    • Visit the following URL to add the command bot, replacing APPLICATION_ID_HERE with the bots application ID: https://discord.com/oauth2/authorize?client_id=APPLICATION_ID_HERE&scope=bot%20applications.commands&permissions=3145728
    • Visit the following URL to add each non-command bot, again replacing APPLICATION_ID_HERE with the bots application ID: https://discord.com/oauth2/authorize?client_id=APPLICATION_ID_HERE&scope=bot&permissions=3145728
    • The different between these is because the command bot needs to request extra permissions to create application commands.

Run the Docker image (recommended)

Before running, ensure you have the Docker Engine installed.

Once that's done, you can run the following command any time you want to start MRVN. Make sure to replace /path/to/config.json with the path to your configuration file saved previously.

docker run --name mrvn-bot --rm --mount type=bind,source=/path/to/config.json,target=/config.json ghcr.io/cpdt/mrvn-bot:latest

You can stop MRVN by running docker stop mrvn-bot.

Build and run locally

This is an alternative to running the Docker image as described above. I would recommend you follow those instructions as they involve less setting up, but you're welcome to build and run MRVN yourself.

First off you need to setup your environment:

  1. Ensure you have the required dependencies installed:
  2. Clone the repository by running git clone https://github.com/cpdt/mrvn-bot

Once that's done, you can run the following command from inside the repository any time you want to start MRVN. Make sure to replace /path/to/config.json with the path to your configuration file saved previously.

cargo run --release /path/to/config.json

The first time this runs it will build MRVN, which can take a while. After it's been built once it should start immediately.

If you want to see logging output, set the RUST_LOG environment variable to mrvn before running the above command. This uses the syntax from the env-logger library.

You can stop MRVN by pressing Ctrl+C in the terminal window.

Why?

In mid-2021 Groovy and Rythm, Discord’s two largest music bots, were taken offline by YouTube. In the wake of this, I created MRVN mainly to serve a couple of servers I’m in, but also as an open tool for anyone looking for a new music bot.

Unlike Groovy, Rythm and many like them, MRVN was designed from the ground up to be self-hosted and simple to setup, making it impossible to be taken down as a whole. As open source software MRVN also does not charge its users, following the most notable clause in YouTube’s terms of service that commercial music bots break.

Finally, as a personal project MRVN has been an opportunity for me to re-think how my friends and I use music bots. This has led to what I consider improvements over the old formula: playing songs in a round-robin pattern so everybody gets a go, handling servers with multiple voice channels with a breeze, and codifying the unspoken “you shall not skip a song that is not yours” rule.

Please reach out and let me know if you’re using MRVN on your server! I would love to hear what works and what doesn’t, and see how it’s being used “in the wild”.

License

MRVN is available under the MIT license. See the LICENSE file for details.

The MRVN smiley face used in this document is sourced from the Titanfall Wiki and is copyright Respawn Entertainment 2014.

Comments
  • Add ability to restrict song sources

    Add ability to restrict song sources

    A handful of server admins have raised concerns regarding the recent cease & desists issued by YouTube to well-known music bots.

    To mitigate these concern we should provide the option to disable certain services. This would require:

    • A domain blacklist. Any song URLs from that domain would be rejected.
    • A configurable search prefix. Searches would use this instead of the default YouTube prefix.
    opened by cpdt 1
  • Remove ffmpeg, do decoding in-process

    Remove ffmpeg, do decoding in-process

    This is a pretty big change to MRVN's audio backend:

    • Opus streams in the correct format are passed straight through to Discord. This covers almost all Youtube videos, and uses considerably less system resources.
    • Decoding other formats is done in-process with Symphonia. This uses less system resources as an external process isn't required, and gives us more control over buffers and latency.
    opened by cpdt 0
  • Bot breaks if a song errors and there are more songs queued

    Bot breaks if a song errors and there are more songs queued

    Seems like the model state is being cleared but not the speaker state, so skipping or playing more songs always fails until the bot is disconnected and reconnected.

    opened by cpdt 0
  • Songs sometimes immediately end as soon as they're played

    Songs sometimes immediately end as soon as they're played

    Occasional network hiccups can cause the remote connection to immediately close, which causes the song to immediately end. We should be able to retry connecting a certain number of times in case this happens.

    opened by cpdt 0
  • Request: queue command

    Request: queue command

    It would be nice to have a command that displays the current songs in the queue and in what order. Another "nice to have" might be to be able to remove songs from a specific place in the queue as well.

    Awesome work on the bot as it is though.

    opened by rypervenche 1
Releases(v1.2.0)
  • v1.2.0(Nov 27, 2022)

    • Major overhaul of player: MRVN no longer uses ffmpeg to stream and remux audio, instead it uses the Symphonia library to process audio, and custom streaming implementations for regular files and HLS streams. The result is that MRVN uses way less memory and CPU to play audio - especially for youtube audio which can be passed through without demuxing. In general it also seems to handle HLS streams more smoothly.
    • New Discord interaction responses: "queued" messages are now replaced when the song plays to make it clear what's still queued. "playing" messages now show thumbnail art and an updating progress bar. Example: image
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jun 17, 2022)

  • v1.0.0(Oct 23, 2021)

Owner
Tom Barham
Software engineer, hobbyist digital artist or something :sparkles:. He/him.
Tom Barham
musify is a simple discord bot to play music within a voice channel, written in the rust programming language.

musify-rs musify is a simple discord bot to play music within a voice channel, written in the rust programming language. Features A simple song queue

NV6 5 Aug 14, 2022
A next-generation music player and manager

ouverture A next-generation music player and manager Very much at Work-In-Planning stage now Planned features GUI (localizable) Backend (something lik

Michael B 9 Nov 17, 2022
Terminal Music Player written in Rust

Terminal Music Player written in Rust Listen to music freely as both in freedom and free of charge! Freedom: As time goes by, online service providers

null 376 Jan 3, 2023
A terminal music player written in the Rust language.

A terminal music player written in the Rust language. (Windows) Requirements Configuration file path: C:\Users\xxx\.config\music_player\config.yml # P

xiao hui 162 Nov 12, 2022
The definitive e-book reader music player (Kobo, Kindle)

Introduction E-ink devices have traditionally been only for reading... well no more! Buck is a fully-fledged music player for e-ink devices (tested fu

BillK 11 Oct 28, 2022
Small, compact music player written with Rust.

trill Small, compact music player based on rodio. Usage Run the program with --help to see the available options. To just play a sound file: trill -p

Will 3 Nov 25, 2022
Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.

Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device. Polaris works by streami

Antoine Gersant 1k Jan 9, 2023
Rust-crate with functions and helpers for working with music / audio, inspired by computer music languages.

music-math This crate contains common functions and helpers for working with music / audio in Rust. Most of these are inspired by similar functions fo

Mads Kjeldgaard 3 Apr 10, 2024
A music bot build in Serenity/Rust.

Sunny Flowers is a Discord bot to play media in voice channels. It uses Serenity and Songbird to accomplish this.

Sophie 11 Nov 5, 2022
A discord voice recorder bot

distream distreamは長時間の音声録音Botで、2時間以上の録音が可能です。 音声はwebmで保存され、ユーザーごとにトラックが分離されているので書き出す際にユーザーを選択できます。 how to use !join to join voice channel and start re

virtualCrypto 6 Sep 5, 2022
A simple CLI audio player with strange features.

legacylisten legacylisten is a simple CLI audio player I wrote because no existing one fulfilled my needs. The main feature is that you can change how

Matthias Kaak 3 Jun 8, 2022
A simple GUI audio player written in Rust with egui. Inspired by foobar2000.

Music Player A simple GUI music player inspired by foobar2000 written in Rust using egui. The goal of this project is to learn about making gui/ nativ

Ryan Blecher 5 Sep 16, 2022
A video player for your terminal that generates a standalone executable that plays your video.

Szmelc Player Szmelc Player is a program that converts any video you give it to a standalone executable that plays the video in the terminal. It uses

null 1 Jan 9, 2022
Rust Audio Player Daemon

Rust Audio Player Daemon Cause mpd was annoying What rapd trys to do Rapd is not a spotify client, or an advanced music player. Its an audio/music dae

ash 3 Nov 1, 2022
VR media player for linux

VR media player for linux Very early development access version. I'll drop more notes here once it's ready for more publicity. Some details: Uses wgpu

null 4 Oct 7, 2022
Arexibo is an Rust Linux Xibo player

Arexibo is an alternate Digital Signage Player for Xibo, implemented in Rust with the GTK GUI components, for Linux platforms.

Georg Brandl 2 Dec 6, 2022
Template project for the The Bombercrab Challenge game, a stub Rust WASM player

The Bombercrab Challenge (Player Template) Welcome to the 2022 Tokyo Game Hack bombercrab challenge! If you're based in Tokyo and planning to attend i

Tonari, Inc 10 Sep 4, 2022
Very simple, efficient, task oriented, low cognitive, Midi player and jukebox for midi instruments

Midi and Virtual Book jukebox Player A cross-platform MIDI and virtual book jukebox player. It only includes the necessary functionalities to play MID

Barrel Organ Discovery 4 Jun 29, 2023
A music theory guide written in Rust.

Rust Music Theory A library and executable that provides programmatic implementation of the basis of the music theory. Table of Contents Overview Usag

Ozan Kaşıkçı 551 Dec 21, 2022