This commit is contained in:
Neko Life 2021-05-10 13:21:11 +00:00
parent 996d0775a1
commit 07882ee2c8

View file

@ -25,7 +25,7 @@ module.exports = class avatar extends commando.Command {
errLog(docErr, msg, this.client);
}
const footerQuote = r?.["settings"]?.defaultEmbed?.footerQuote;
const withPerm = arg.trim().split(/,+/);
const args = arg.trim().split(/,+/);
const option = arg.trim().split(/(\-\-)+/);
let user, avatar, member, show;
let [allEmb, multipleMemMes, dupliCheck] = [[], [], []];
@ -33,14 +33,10 @@ module.exports = class avatar extends commando.Command {
user = msg.guild ? msg.guild.member(msg.author) : msg.author;
avatar = msg.author.displayAvatarURL({size:4096,dynamic:true});
}
let args;
if (!msg.guild || msg.guild.member(msg.author).hasPermission("MANAGE_MESSAGES")) {
args = withPerm;
} else {
if (withPerm.length < 2) {
args = withPerm;
} else {
args = withPerm[0];
let onceOnly = false;
if (msg.guild && !msg.guild.member(msg.author).hasPermission("MANAGE_MESSAGES")) {
onceOnly = true;
if (args.length > 1) {
trySend(this.client, msg, "Manage messages permission required to show two or more avatar at once!");
}
}
@ -54,15 +50,10 @@ module.exports = class avatar extends commando.Command {
}
}
if (arg) {
let onceOnly = false;
for(const theAvThis of args) {
let avThis = theAvThis.replace(/\-\-show *\d*/i, "");
if (avThis.length === 1) {
avThis = args.replace(/\-\-show *\d*/i, "");
onceOnly = true;
if (avThis.length === 1) {
return trySend(this.client, msg, "One character for searching member isn't allowed <:catstareLife:794930503076675584>");
}
return trySend(this.client, msg, "One character for searching member isn't allowed <:catstareLife:794930503076675584>");
}
let uID = cleanMentionID(avThis.trim());
if (uID.length > 1) {