Releases: Spimy/muse-cli
v1.2.11
"Breaking" Change
- Regex is now part of the config file renamed to
settings
. The config is now accessed throughclient.$settings.config
and regexes throughclient.$settings.regex
. It is encouraged to add regexes there, especially if it will be reused many times (issue #12).
New Feature
- Category property for a command will now be generated if subfoldered using relative path. E.g.
mod/ban
, the command decorator will look like:
@Command({
name: 'ban',
category: 'Mod'
})
This was added in hopes to speed up development time by even just a little bit so the developer does not need to re-specify the category (issue #10)
Small Changes
v1.1.8
v1.1.5
New Feature
- Multiple prefixes (issue #4)
Bug Fixes
- Vote from user who left the voice channel is revoked if skip count is set to voice channel size (issue #2)
- Set default config and remove ownerID from config (issue #3)
- Validate name inputs during component creation to only allow relative paths (issue #5)
- Simplify to a single object to contain both needed imports and arguments for event component (issue #6)
v1.0.0
Muse (μ's) CLI
MuseCLI generates a discord.js bot with music features for you! You can use the generate
subcommand to automatically generate boilerplate codes for commands and events so you don't have to keep rewriting repeated codes!
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
-
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
Installation Instructions
- Fork this repo
- Clone your fork to your local machine
- CD into the bot's root directory
- Run
npm install
oryarn
OR
- Run
npm install -g muse-cli
oryarn global add muse-cli
- Run
muse new project-name typescript [--git] [--skipInstall] [--packageManager=(npm/yarn)]
THEN FOR EITHER
- Copy your discord token and YouTube API Key into a
.env
file in project root folder
TOKEN=bot_token
YOUTUBE_API_KEY=api_key
- Set a command prefix in into muse.json
- Run
npm build
oryarn build
ortsc -b
- Run
npm dev
oryarn dev
and if you do, skip the next step - Run
npm start
oryarn start
ornode dist/index.js
Getting a Discord Bot Token
- Head on over to Discord's Developer Page
- Sign in with your Discord account, if you are not already signed in
- Click the "New Application" button
- Give the application a name
- On the "General Information" Tab, give your application an avatar image
- Click the bot tab on the left hand side menu
- Then click "Add Bot" & confirm by clicking "Yes, Do it"
- Finally, copy the bot token
Note: Do NOT share your bot token with anyone!
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
- Discord: Biribiri#6160
- YouTube: https://www.youtube.com/channel/UCNfE0E97k3fouJg-2nulLKg
- Twitter: https://twitter.com/OfficialSpimy
- Instagram: http://instagram.com/OfficialSpimy