This commit is contained in:
Neko Life 2021-05-10 13:59:19 +00:00
parent 6048084486
commit 7213c50113

View file

@ -24,7 +24,7 @@ module.exports = class avatar extends commando.Command {
errLog(docErr, msg, this.client);
}
const footerQuote = r?.["settings"]?.defaultEmbed?.footerQuote;
const args = arg.trim().split(/,+/);
const args = arg.trim().split(/(?<!\\),+/);
const option = arg.trim().split(/(\-\-)+/);
let user, avatar, member, show;
let [allEmb, multipleMemMes, dupliCheck] = [[], [], []];
@ -33,7 +33,7 @@ module.exports = class avatar extends commando.Command {
avatar = msg.author.displayAvatarURL({size:4096,dynamic:true});
}
let onceOnly = false;
if (!msg.guild?.member(msg.author).hasPermission("MANAGE_MESSAGES")) {
if (msg.guild ? !msg.guild.member(msg.author).hasPermission("MANAGE_MESSAGES") : false) {
onceOnly = true;
if (args.length > 1) {
trySend(this.client, msg, "Manage messages permission required to show two or more avatar at once!");
@ -61,6 +61,7 @@ module.exports = class avatar extends commando.Command {
ree.push(reeRes);
}
} else {
user = undefined;
trySend(client, msg, `Can't find user: **${avThis.trim()}**`);
}
}