mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-15 17:45:59 +00:00
Fixed after christer. Updated dev only commands.
This commit is contained in:
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Report a bug',
|
||||
alias: 'bug',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`Found a bug with ${client.user.username}?\nDM the core developer:`)
|
||||
|
@ -3,13 +3,13 @@ module.exports = {
|
||||
description: 'Evaluation command',
|
||||
alias: 'eval',
|
||||
cooldown: 5,
|
||||
onlyDev: true,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const ytdl = require('ytdl-core');
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
if (serverQueue) {
|
||||
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
|
||||
}
|
||||
if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!');
|
||||
const input = message.content.slice(prefix.length + 4);
|
||||
let output;
|
||||
try {
|
||||
|
@ -3,8 +3,8 @@ module.exports = {
|
||||
description: 'force stop command.',
|
||||
alias: 'fs',
|
||||
cooldown: 5,
|
||||
onlyDev: true,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!')
|
||||
client.queue.delete(message.guild.id);
|
||||
message.channel.send('queue deleted')
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Help command.',
|
||||
alias: 'help',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('Commands for Musix!')
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Invite command.',
|
||||
alias: 'invite',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('Invite Musix to your Discord server!')
|
||||
|
@ -3,12 +3,13 @@ module.exports = {
|
||||
description: 'loop command.',
|
||||
alias: 'loop',
|
||||
cooldown: 10,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
const { voiceChannel } = message.member;
|
||||
if (serverQueue) {
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Now playing command.',
|
||||
alias: 'np',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const ytdl = require('ytdl-core');
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
|
@ -3,13 +3,14 @@ module.exports = {
|
||||
description: 'Pause command.',
|
||||
alias: 'pause',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
const { voiceChannel } = message.member;
|
||||
if (serverQueue && serverQueue.playing === true) {
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to pause the music!');
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to pause the music!');
|
||||
|
@ -8,6 +8,7 @@ module.exports = {
|
||||
alias: 'p',
|
||||
args: true,
|
||||
cooldown: 3,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const youtube = new YouTube(client.config.apikey);
|
||||
const searchString = args.slice(1).join(" ");
|
||||
|
@ -7,6 +7,7 @@ module.exports = {
|
||||
description: 'Save and load queues',
|
||||
alias: 'pl',
|
||||
cooldown: 10,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('Options for playlist!')
|
||||
@ -19,7 +20,7 @@ module.exports = {
|
||||
.setAuthor(client.user.username, client.user.displayAvatarURL)
|
||||
.setColor('#b50002')
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to modify or play the playlist!');
|
||||
} else if (!permissions.has('MANAGE_GUILD')) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to modify the playlist!');
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Queue command.',
|
||||
alias: 'q',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Remove command.',
|
||||
alias: 'rm',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const { voiceChannel } = message.member;
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
@ -13,7 +14,7 @@ module.exports = {
|
||||
if (isNaN(pos)) return message.channel.send(':x: You need to enter a number!');
|
||||
if (pos === 0) return message.channel.send(':x: You can not remove the currently playing song!');
|
||||
if (pos > serverQueue.songs.size) return message.channel.send(`:x: There is only ${serverQueue.songs.size} amount of songs in the queue!`);
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to remove songs!');
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
if (serverQueue.songs[pos].author !== message.author) {
|
||||
|
@ -3,12 +3,13 @@ module.exports = {
|
||||
description: 'Resume command.',
|
||||
alias: 'resume',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
const { voiceChannel } = message.member;
|
||||
if (serverQueue && !serverQueue.playing) {
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'seek command.',
|
||||
alias: 'seek',
|
||||
cooldown: 10,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const ytdl = require('ytdl-core');
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
@ -10,7 +11,7 @@ module.exports = {
|
||||
const { voiceChannel } = message.member;
|
||||
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
|
||||
if (serverQueue) {
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
return message.channel.send(':x: This command is currently disabled!');
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to seek the song!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
|
@ -4,6 +4,7 @@ module.exports = {
|
||||
description: 'Change the settings',
|
||||
alias: 'settings',
|
||||
cooldown: 10,
|
||||
onlyDev: false,
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('Guild settings for Musix')
|
||||
@ -16,7 +17,7 @@ module.exports = {
|
||||
.setAuthor(client.user.username, client.user.displayAvatarURL)
|
||||
.setColor('#b50002')
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (!permissions.has('MANAGE_GUILD')) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!');
|
||||
}
|
||||
if (args[1]) {
|
||||
|
14
commands/settings/reset.js
Normal file
14
commands/settings/reset.js
Normal file
@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
name: 'reset',
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
client.global.db.guilds[message.guild.id] = {
|
||||
prefix: client.config.prefix,
|
||||
defaultVolume: 5,
|
||||
permissions: false,
|
||||
premium: false,
|
||||
dj: false,
|
||||
djrole: null
|
||||
};
|
||||
message.channel.send(':white_check_mark: Reset __all__ guild settings!');
|
||||
}
|
||||
};
|
@ -3,12 +3,13 @@ module.exports = {
|
||||
description: 'Skip command.',
|
||||
alias: 'skip',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const { voiceChannel } = message.member;
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could skip for you.');
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to skip the song!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
description: 'Status command.',
|
||||
alias: 'status',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
let rawUptime = client.uptime;
|
||||
let uptime = {};
|
||||
|
@ -3,11 +3,12 @@ module.exports = {
|
||||
description: 'Stop command.',
|
||||
alias: 'stop',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const { voiceChannel } = message.member;
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could stop for you.');
|
||||
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to stop the music!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
|
@ -3,15 +3,15 @@ module.exports = {
|
||||
description: 'Volume command.',
|
||||
alias: 'volume',
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
execute(message, args, client, Discord, prefix) {
|
||||
const { voiceChannel } = message.member;
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
const permissions = message.channel.permissionsFor(message.author);
|
||||
if (message.author.id === '384002606621655040') return message.channel.send('You are not doying that!');
|
||||
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
|
||||
if (!args[1]) return message.channel.send(`:loud_sound: The current volume is: **${serverQueue.volume}**`);
|
||||
const volume = parseFloat(args[1]);
|
||||
if (message.author.id !== client.config.devId) {
|
||||
if (message.author.id !== client.config.dev) {
|
||||
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to change the volume!');
|
||||
if (client.global.db.guilds[message.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[message.guild.id].dj) {
|
||||
|
Reference in New Issue
Block a user