Welcome to Local Music Bot’s documentation!¶
The Local Music Bot is a Discord Bot for Local Music with library and role management.
If you have any feedback or problems, feel free to add Natsulus#5647
on Discord or submit an issue on Github or join the Support Server.
If you wish to contribute and know how to code with Node.js, you can make a pull request on the Dev branch of the Github Repository.
Note
The bot and docs are still a work-in-progress.
Installing¶
Requirements¶
Windows¶
- NodeJS - Requires v5.0.0 or above due to ES6 code.
- Python 2.7 - Requires v2.7.x, not v3.x.x.
- Visual Studio - Select Custom Installation and make sure Visual C++ under Programming Languages is selected.
- Your Visual Studio installation ideally has to be recent.
- Can be Express, Community or Enterprise Edition, but NOT
VS Code
.
- FFmpeg - Add bin folder to PATH Environment Variable.
Mac¶
- NodeJS - Requires v5.0.0 or above due to ES6 code.
- Python 2.7 - Requires v2.7.x, not v3.x.x. Should be already installed by default.
- Xcode Command Line Tools
$ xcode-select --install
- FFmpeg
$ brew install ffmpeg
Linux (Debian-based)¶
- NodeJS Linux - Requires v5.0.0 or above due to ES6 code.
- Python 2.7 - Requires v2.7.x, not v3.x.x. Should be already installed by default.
- Build Essential
$ sudo apt-get install build-essential
- FFmpeg
$ sudo apt-get install ffmpeg
If on Ubuntu 14.04, use this instead:
$ sudo add-apt-repository ppa:mc3man/trusty-media && sudo apt-get update && sudo apt-get install ffmpeg
Installation¶
- Download the repository. (You can use git clone or the Download ZIP button Github provides.)
- Open the config.json file and edit it.
- Open a Command Prompt/Terminal at the directory of the downloaded repository.
- Run
npm install
to install the dependencies. - Run
npm start
to start up the bot. - Start using the bot!
Config¶
config.json¶
- prefix
- The prefix the bot uses.
- owner
- The owner’s Discord ID.
- token
- Your bot’s token. Defaults to email and password if not provided.
- Your bot’s email. Optional if token provided.
- password
- Your bot’s password. Optional if token provided.
- allowedChannels
- Array of text channel IDs which the bot will listen to. Used to avoid clogging up channel logs.
Example¶
{
"prefix": ">",
"owner": "345678909876543",
"token": "ABC123def987-zxyNOP546",
"email": "",
"password": "",
"allowedChannels": ["23456789098765432", "23456789098765432", "23456789098765432"]
}
Commands¶
Query¶
Voice¶
join ChannelName¶
Joins a voice channel if not already in one. ChannelName is case-insensitive and provides partial matching.
View¶
current¶
Provides detail about the song currently playing.
list¶
Lists all songs in queue as well as the song currently playing.
cover¶
Get the album art of the current song if available.
Queue¶
unqueue NumberOrRange¶
Removes the track/s from the queue at the provided Number/Range.
skip vote¶
Calls a vote to skip a song if no vote has started, else adds to vote to skip song.
Role¶
role add ID | Name | Description¶
Adds a new role. Description is optional.
role delete ID¶
Deletes the role with the specified role. All users with the deleted role will have their role set to the default role.
role edit ID | Key | Value¶
Edits the key for the specified role with the value. Cannot edit the keys Perm or Default.
role set ID User#Tag¶
Sets the role of User#Tag with the specified role. Can enter multiple User#Tag, separated by " | "
. e.g. >role set 5 Bob#1234 | Fred#0420 | Tim#000
role default ID¶
Sets the default role to the specified role. ID must be greater than 5.
role give ID Perm¶
Gives the specified role the specified Perm. Can enter multiple perm, separated by a space. e.g. >role give 5 role.default.view role.view playlist
role remove ID Perm¶
Removes the specified Perm from the specified role. Can enter multiple perm, separated by a space. e.g. >role remove 5 role.default.view role.view playlist
Library¶
library add Name | Path | Description¶
Add a new library. Description is optional.
library delete Name¶
Deletes the library with the specified Name.
library edit Name | Key | Value¶
Edits the key for the library with the specified Name with the value. Cannot edit the key Active.
library select Name¶
Selects the specified library as the active library.
update¶
Check active library for any changes and updates the library.
update LibraryName¶
Check specified library for any changes and updates the library.
Playlist¶
playlist save Name¶
Save the current song and queue as a playlist with the specified name.
playlist delete Name¶
Deletes the specified playlist if you created it and have playlist.delete.own perm.
Deletes the specified playlist if you didn’t create it and have playlist.delete.other perm.
Query¶
Options¶
Query | Details |
---|---|
title | Case-Insensitive & Partial Matching |
album | Case-Insensitive & Partial Matching |
artist | Case-Insensitive & Partial Matching |
allbumartist | Case-Insensitive & Partial Matching |
filename | Case-Insensitive & Partial Matching |
duration | Number for amount of seconds. Negative for shorter than, Positive for longer than. |
page | Number. Results are limited to 20 per page. |
track | Number or Range. This is the number seen in the results and not the track number of an album. |
sortby | none, title, album, artist, albumartist, filename, duration. Sorts in ascending order, add - in front for descending. |
random | Provide any value to get a random song based on other query values except page, track and sortby. |
Examples¶
Search for songs with artist SomeArtist, album SomeAlbum, getting results 21-40 (Page 2) when sorted by title then album in ascending order,then artist in descending order:
>search artist: SomeArtist album: SomeAlbum page: 2 sortby: title album -artist
Search for songs with album SomeAlbum with a duration shorter than 420 seconds:
>search album: SomeAlbum duration: -420
Search for songs with album SongAlbum and select track #5:
>search album: SomeAlbum track: 5
Search for songs with artist Space Artist and select track 3-8 when not sorted:
>search artist: Space Artist track: 3-8 sortby: none
Search for a random song from songs with album SongAlbum:
>search album: SomeAlbum random: Anything Can Be Put For Random's Value But There Must Be Something
Search for a random song from the library:
>search random: asdf
Notes¶
- If no sortby value is provided it defaults to the sortby value:
album artist albumartist title filename
Role¶
Keys¶
ID¶
Name¶
Description¶
Default¶
Provided Roles¶
The following roles come with the bot:
Owner¶
Partner¶
Admin¶
Moderator¶
Listener¶
Member¶
Perms¶
Perm List¶
- query
- search
- queue
- voice
- join
- leave
- view
- current
- list
- cover
- queue
- remove
- shuffle
- skip
- novote
- vote
- role
- view
- own
- other
- detail
- list
- mod
- add
- delete
- edit
- set
- default
- view
- set
- perm
- give
- remove
- view
- library
- view
- active
- detail
- list
- mod
- add
- delete
- edit
- select
- update
- active
- other
- view
- playlist
- view
- detail
- list
- save
- load
- delete
- own
- other
- view
Notes¶
voice = voice.join & voice.leave
Library¶
Keys¶
Name¶
Path¶
Description¶
Active¶
Notes¶
- New libraries will take a while to load depending on the size of the library and the disk’s read speed as they must open each file to get their metadata.
- Libraries cannot detect files that were modified while the library was not active.
TODO¶
v1¶
- Prettify the messages.
- Support @mention
- Support new members joining server.
v2 (Undecided)¶
- Change Bot Name to ‘Music Library Bot’.
- Implement Streaming Support (Youtube, SoundCloud, etc).
- Support modified files when bot is offline.
v3 (Undecided)¶
- Stream Site DL to File in Library?
Changelog¶
1.0.1¶
- Fixed Perm Checking
- Fixed Role Set Command
- Started Planning v1.1 Update
- Created a Support Server
1.0.0¶
- Version 1.0.0 of the bot is now released!
- All commands are usable.
- Role Management is available with perms.
- Library Management & File Monitoring while online.
- Updates Library for all offline changes except for modified/replaced files.