|
|
@ -197,7 +197,13 @@ class _Client extends Client
|
|
|
|
args = args.filter(x => x !== '')
|
|
|
|
args = args.filter(x => x !== '')
|
|
|
|
if(this.commands.get(commandName))
|
|
|
|
if(this.commands.get(commandName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
let needsAdmin = this.commands.get(commandName).needsAdmin;
|
|
|
|
let needsAdmin = this.commands.get(commandName).needsAdmin;
|
|
|
|
|
|
|
|
let isMusicRelated = this.commands.get(commandName).group == 'music';
|
|
|
|
|
|
|
|
if(isMusicRelated)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!this.getMusicActive(message.guildId)) return new ErrorMessage(this).send(ErrorType.FeatureInnactive, message);
|
|
|
|
|
|
|
|
}
|
|
|
|
let isAdmin =false;
|
|
|
|
let isAdmin =false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -214,6 +220,11 @@ class _Client extends Client
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async getMusicActive(guildId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const guild = await guildsM.find({gID:guildId}).then(g=>{return g[0]});
|
|
|
|
|
|
|
|
return guild.music;
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param {String} name - Command Name
|
|
|
|
* @param {String} name - Command Name
|
|
|
@ -502,11 +513,12 @@ class ErrorMessage
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ErrorType.FeatureInnactive:
|
|
|
|
case ErrorType.FeatureInnactive:
|
|
|
|
embed.data.fields[0].value =ErrorType.FeatureInnactive;
|
|
|
|
embed.data.fields[0].value =ErrorType.FeatureInnactive;
|
|
|
|
embed.data.fields[1].value = 'If you are an admin you can activate the function on the dashboard. (rem.wordfights.com)'
|
|
|
|
embed.data.fields[1].value = 'If you are an admin you can activate the function on the [dashboard](https://rem.wordfights.com \'Dashboard\').'
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ErrorType.FullCustom:
|
|
|
|
case ErrorType.FullCustom:
|
|
|
|
if(!extraMessages) throw console.error('ErrorType set to FullCustom but no custom message added.')
|
|
|
|
if(!extraMessages) throw console.error('ErrorType set to FullCustom but no custom message added.')
|
|
|
|
embed.data.fields[0].value = extraMessages[0];
|
|
|
|
embed.data.fields[0].value = extraMessages[0];
|
|
|
|
|
|
|
|
console.log(embed.data.fields)
|
|
|
|
embed.data.fields[1].value = 'Try again once you have been bad.';
|
|
|
|
embed.data.fields[1].value = 'Try again once you have been bad.';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|