Merge remote-tracking branch 'origin/master'

This commit is contained in:
rhearmas 2020-01-08 16:15:38 -05:00
commit ac5c96e39e

View file

@ -4,7 +4,7 @@ module.exports = async (client, message) => {
const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`); const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`);
if (message.content.match(prefixMention)) { if (message.content.match(prefixMention)) {
return message.reply(`my prefix for this guild is \`${settings.prefix}\``); return message.reply(`my prefix for this guild is \`${settings.prefix}\`.`);
} }
if (message.content.indexOf(settings.prefix) !== 0) return; if (message.content.indexOf(settings.prefix) !== 0) return;
@ -25,7 +25,21 @@ module.exports = async (client, message) => {
if (level < client.levelCache[cmd.conf.permLevel]) { if (level < client.levelCache[cmd.conf.permLevel]) {
if (settings.systemNotice === "true") { if (settings.systemNotice === "true") {
message.delete(); message.delete();
return message.channel.send(`${message.author}, you do not have the right permissions to use this command.\nYour current permission level is **${level}** (${client.config.permLevels.find(l => l.level === level).name}), and this command requires permission level **${client.levelCache[cmd.conf.permLevel]}** (${cmd.conf.permLevel})`); return message.channel.send({embed: client.embed("**Invalid permissions!**",`You don't have the proper user level to use command ${cmd.help.name}.`, [
{
name: "**__Required permissions level:__**",
value: `**${client.levelCache[cmd.conf.permLevel]}** (${cmd.conf.permLevel})`
},
{
name: "**__Your permissions level:__**",
value: `**${level}** (${client.config.permLevels.find(l => l.level === level).name})`
}
],
{
author: message.author.tag,
authorIcon: message.author.avatarURL
}
});
} else { } else {
return; return;
} }