1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +00:00

Updated command aliases

This commit is contained in:
MatteZ02 2020-05-15 19:05:39 +03:00
parent b76af649f2
commit 256585293e
33 changed files with 73 additions and 65 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "musix", "name": "musix",
"version": "3.4.0", "version": "3.4.1",
"description": "V3 for Musix the discord music bot", "description": "V3 for Musix the discord music bot",
"main": "./index.js", "main": "./index.js",
"scripts": { "scripts": {

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
name: "bass", name: "bass",
description: "Bassboost command.", description: "Boost the bass in your music!",
alias: "none", alias: ["none"],
usage: "<bass>", usage: "<bass>",
cooldown: 5, cooldown: 5,
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'cmduses', name: 'cmduses',
alias: 'none', alias: ["none"],
usage: '', usage: '',
description: 'list all commands and how many times they\'ve been used', description: 'list all commands and how many times they\'ve been used',
onlyDev: true, onlyDev: true,

View File

@ -1,8 +1,8 @@
module.exports = { module.exports = {
name: 'end', name: 'end',
alias: 'e', alias: ["none"],
usage: '', usage: '',
description: 'end the queue', description: 'just end it',
onlyDev: true, onlyDev: true,
permission: 'dev', permission: 'dev',
category: 'util', category: 'util',

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'eval', name: 'eval',
alias: 'e', alias: ["none"],
usage: '<code>', usage: '<code>',
description: 'Evaluation command. DEV ONLY!', description: 'Evaluation command. DEV ONLY!',
onlyDev: true, onlyDev: true,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'help', name: 'help',
alias: 'h', alias: ["h"],
usage: '<command(opt)>', usage: '<command(opt)>',
description: 'See the help for Musix.', description: 'See the help for Musix.',
onlyDev: false, onlyDev: false,
@ -13,7 +13,7 @@ module.exports = {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${client.global.db.guilds[msg.guild.id].prefix}${command.name} ${command.usage}`) .setTitle(`${client.global.db.guilds[msg.guild.id].prefix}${command.name} ${command.usage}`)
.setDescription(command.description) .setDescription(command.description)
.setFooter(`${client.messages.helpCmdFooter} \`${command.alias}\``) .setFooter(`${client.messages.helpCmdFooter} \`${command.alias.map(a => `${a}, `)}\``)
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
msg.channel.send(embed); msg.channel.send(embed);
} else { } else {

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'invite', name: 'invite',
alias: 'i', alias: ["i"],
usage: '', usage: '',
description: 'Invite Musix.', description: 'Invite Musix.',
onlyDev: false, onlyDev: false,

View File

@ -1,8 +1,8 @@
module.exports = { module.exports = {
name: 'join', name: 'join',
alias: 'j', alias: ["j"],
usage: '', usage: '',
description: 'Make Musix join the channel your channel', description: 'Make Musix join your voice channel.',
onlyDev: true, onlyDev: true,
permission: 'none', permission: 'none',
category: 'util', category: 'util',

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'loop', name: 'loop',
alias: 'none', alias: [],
usage: '', usage: '',
description: 'loop the queue.', description: 'loop the queue.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'loopsong', name: 'loopsong',
alias: 'loops', alias: ["none"],
usage: '', usage: '',
description: 'loop the currently playing song.', description: 'loop the currently playing song.',
onlyDev: false, onlyDev: false,

View File

@ -1,8 +1,10 @@
const { getLyrics } = require("genius-lyrics-api"); const {
getLyrics
} = require("genius-lyrics-api");
module.exports = { module.exports = {
name: "lyrics", name: "lyrics",
alias: "l", alias: ["l"],
usage: "<song>", usage: "<song>",
description: "see the lyrics for a song", description: "see the lyrics for a song",
onlyDev: false, onlyDev: false,

View File

@ -1,8 +1,8 @@
module.exports = { module.exports = {
name: "nigthcore", name: "nigthcore",
alias: "nc", alias: ["nc"],
usage: "<true/false>", usage: "<true/false>",
description: "Change nigthcore on/off", description: "Change nigthcore audio modifier on/off",
onlyDev: false, onlyDev: false,
permission: "MANAGE_MESSAGES", permission: "MANAGE_MESSAGES",
category: "music", category: "music",

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "nowplaying", name: "nowplaying",
alias: "np", alias: ["np", "playing"],
usage: "", usage: "",
description: "See the currently playing song position and length.", description: "See the currently playing song position and length.",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'pause', name: 'pause',
alias: 'none', alias: ["none"],
usage: '', usage: '',
description: 'Pause the currently playing music.', description: 'Pause the currently playing music.',
onlyDev: false, onlyDev: false,

View File

@ -5,7 +5,7 @@ const ytdl = require("ytdl-core")
module.exports = { module.exports = {
name: "play", name: "play",
alias: "p", alias: ["p", "music"],
usage: "<song name>", usage: "<song name>",
description: "Play some music.", description: "Play some music.",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'previous', name: 'previous',
alias: 'prev', alias: ["prev", "return", "back"],
usage: '', usage: '',
description: 'Play the previous song.', description: 'Play the previous song.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'queue', name: 'queue',
alias: 'q', alias: ["q", "list", "ls", "songs"],
usage: '', usage: '',
description: 'See the queue.', description: 'See the queue.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "remove", name: "remove",
alias: "rm", alias: ["rm", "delete", "del"],
usage: "<song pos>", usage: "<song pos>",
description: "Remove a song from the queue", description: "Remove a song from the queue",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'replay', name: 'replay',
alias: 'none', alias: ["rp"],
usage: '', usage: '',
description: 'Replay the currently playing song.', description: 'Replay the currently playing song.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'restart', name: 'restart',
alias: 'none', alias: ["none"],
usage: '', usage: '',
description: 'restart all shards', description: 'restart all shards',
onlyDev: true, onlyDev: true,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'resume', name: 'resume',
alias: 'none', alias: ["continue"],
usage: '', usage: '',
description: 'Resume the paused music.', description: 'Resume the paused music.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'savedb', name: 'savedb',
alias: 'save', alias: ["none"],
usage: '', usage: '',
description: 'save the database', description: 'save the database',
onlyDev: true, onlyDev: true,

View File

@ -3,7 +3,7 @@ const he = require('he');
module.exports = { module.exports = {
name: 'search', name: 'search',
alias: 'sr', alias: ["sr", "find"],
usage: '<search word(s)>', usage: '<search word(s)>',
description: 'Search the top 10 queryes and choose one.', description: 'Search the top 10 queryes and choose one.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "seek", name: "seek",
alias: "none", alias: ["none"],
usage: "<point in song (seconds)>", usage: "<point in song (seconds)>",
description: "Seek to a specific point in the currently playing song.", description: "Seek to a specific point in the currently playing song.",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "settings", name: "settings",
alias: "pref", alias: ["options", "ops", "preferences"],
usage: "<setting> <value(opt)>", usage: "<setting> <value(opt)>",
description: "Change the server settings for Musix.", description: "Change the server settings for Musix.",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'shuffle', name: 'shuffle',
alias: 'none', alias: ["none"],
usage: '', usage: '',
description: 'Shuffle the queue.', description: 'Shuffle the queue.',
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "skip", name: "skip",
alias: "s", alias: ["s", "next"],
usage: "", usage: "",
description: "Skip the currently playing song.", description: "Skip the currently playing song.",
onlyDev: false, onlyDev: false,
@ -33,12 +33,14 @@ module.exports = {
} }
}, },
}; };
function skipSong(queue, msg, client) { function skipSong(queue, msg, client) {
msg.channel.send(client.messages.skipped); msg.channel.send(client.messages.skipped);
queue.endReason = "skip"; queue.endReason = "skip";
queue.time = 0; queue.time = 0;
queue.connection.dispatcher.end(); queue.connection.dispatcher.end();
} }
function vote(queue, msg, client) { function vote(queue, msg, client) {
queue.votesNeeded = Math.floor(queue.voiceChannel.members.size / 2); queue.votesNeeded = Math.floor(queue.voiceChannel.members.size / 2);
queue.votesNeeded.toFixed(); queue.votesNeeded.toFixed();

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "skipto", name: "skipto",
alias: "st", alias: ["st"],
usage: "<point in queue>", usage: "<point in queue>",
description: "Skip to a point in the queue", description: "Skip to a point in the queue",
onlyDev: false, onlyDev: false,

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: "soundcloud", name: "soundcloud",
alias: "sc", alias: ["none"],
usage: "", usage: "",
description: "", description: "",
onlyDev: true, onlyDev: true,
@ -10,13 +10,18 @@ module.exports = {
if (!args[1]) return msg.channel.send(client.messages.noQuery); if (!args[1]) return msg.channel.send(client.messages.noQuery);
const SoundCloud = require("soundcloud-api-client"); const SoundCloud = require("soundcloud-api-client");
const key = client.config.soundCloud_api_key; const key = client.config.soundCloud_api_key;
const soundcloud = new SoundCloud({ key }); const soundcloud = new SoundCloud({
key
});
const q = "live mix"; const q = "live mix";
const genres = ["house", "tech-house", "techno"].join(","); const genres = ["house", "tech-house", "techno"].join(",");
soundcloud soundcloud
.get("/tracks", { q, genres }) .get("/tracks", {
q,
genres
})
.then((tracks) => console.log(tracks)) .then((tracks) => console.log(tracks))
.catch((e) => console.error(e)); .catch((e) => console.error(e));
}, },

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
name: 'status', name: 'status',
alias: 'stats', alias: ["stats", "info"],
usage: '', usage: '',
description: 'See the current status for Musix.', description: 'See the current status for Musix.',
onlyDev: false, onlyDev: false,

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
name: 'stop', name: 'stop',
description: 'Stop command.', description: 'Stop the music and clear the queue.',
alias: 'none', alias: ["none"],
usage: '', usage: '',
onlyDev: false, onlyDev: false,
permission: 'MANAGE_CHANNELS', permission: 'MANAGE_CHANNELS',

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
name: 'volume', name: 'volume',
description: 'Volume command.', description: 'Volume command.',
alias: 'none', alias: ["none"],
usage: '<volume>', usage: '<volume>',
cooldown: 5, cooldown: 5,
onlyDev: false, onlyDev: false,

View File

@ -32,9 +32,8 @@ function getCommand(client, args, msg, Discord) {
const command = const command =
client.commands.get(commandName) || client.commands.get(commandName) ||
client.commands.find( client.commands.find(
(cmd) => cmd.aliases && cmd.aliases.includes(commandName) (cmd) => cmd.alias && cmd.alias.includes(commandName)
) || );
client.commandAliases.get(commandName);
if (!command) return; if (!command) return;
if (command.onlyDev && msg.author.id !== client.config.devId) return; if (command.onlyDev && msg.author.id !== client.config.devId) return;
if (client.config.devMode && msg.member.id !== client.config.devId) if (client.config.devMode && msg.member.id !== client.config.devId)