Muse (μ's) CLI
MuseCLI generates a discord.js bot with music features for you. You can use the generate
command to automatically generate boilerplate for commands and events so you don't have to keep re-writing the same code every time you create a new component.
NOTICE: If the bot crashes or music randomly gets skipped with errors similar to Error: Too many redirects
then
the error comes from YTDL and I am not responsible for any issues related to said library. If any issues of the like
persists, open an issue on their GitHub page.
Requirements
Commands
For more details, please check the Wiki
Start a new project:\
muse (n)ew <project-name> <template> [--git] [--skipInstall] [--packageManager=(NPM/yarn)]
Templates currently available: TypeScript
Generate a new component: \
muse (g)enerate <component> <component_name>
Components available:
command
andevent
\ Component name supports relative path, e.g:admin/ban
will create a bancommand
inside theadmin
folder
Features
Multiple Ways to Start Music:
Play with YouTube video links (also supports YouTube playlist links):\
Play with search query:\
Play using search command to make a selection from 10 results:\
You can loop the currently playing music or queue.
If music is looping, it will never jump to the next music in the queue unless you turn if off or skip it\ If queue is looping, the entire queue will never end.
Vote Skip if not Admin:
Each page contains up to 5 videos so you need at least 6 videos in the queue for pagination to start\ The reactor for pagination lasts for 60 seconds. If 60 seconds have passed, rerun the
queue
command for pagination to work again
- Updates every 5 seconds to avoid rate limit\
- Clear the whole queue or a specific music at a specified index:\
- Responsive Help Message:\
Supports multiple prefixes too
Project Setup
Installation Instructions
For Development
- Run
npm install -g muse-cli
oryarn global add muse-cli
- Run
muse new project-name typescript [--git] [--skipInstall] [--packageManager=(npm/yarn)]
For Contribution
- Fork this repo
- Clone your fork to your local machine
- CD into the muse-cli project root directory
- Run
npm install
oryarn
- Create a new branch and make your contribution
- Make a pull request on GitHub for me to review
Sensitive Information
You must at all cost keep your sensitive information like Discord Bot Token and YouTube API Key safe and the best way to do that is via environment variables. You can set them directly in your SYSTEM ENV, but setting them inside a .env
file in your project root folder is recommended:
TOKEN=bot_token
YOUTUBE_API_KEY=api_key
Command File Template
@Command({
name: '', // The name of the command
aliases: [], // Add aliases inside the array (Optional)
category: '', // Specify which category this command belongs to (Optional)
usage: '', // Specify the arguments taken by the command (Optional)
description: '', // A short description about your command (Optional)
permissions: [], // Add permissions required to run the command (Optional)
overrideDefaultPermCheck: false // Whether to ignore default permission check (Optional)
})
default class implements CommandExecutor {
execute = async (message: Message, args: string[]): Promise<boolean> => {
// Command code in here
return true;
}
}
OR
Use muse generate command <command_name>
to generate boilerplate for a command
Event File Template
@Event('') // The name of the event
default class implements EventListener {
listen = async (/* Pass in appropriate arguments for the event name passed in the decorator */) => {
// Event code in here
}
}
OR
Use muse generate event <event_name>
to generate boilerplate for an event
Author
I am Spimy, but my Discord is under a different name most of the time.
- Discord: Biribiri#6160
- GitHub
- YouTube Gaming
- YouTube Development