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