fix: regex with coma

This commit is contained in:
Neko Life 2021-05-27 22:48:12 +00:00
parent 36e63e566d
commit 6440b2ace2

View file

@ -2,7 +2,7 @@
const commando = require("@iceprod/discord.js-commando"); const commando = require("@iceprod/discord.js-commando");
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const { ranLog, errLog, trySend, findMemberRegEx, multipleMembersFound, cleanMentionID } = require("../../resources/functions"); const { ranLog, errLog, trySend, findMemberRegEx, multipleMembersFound, cleanMentionID, tryReact } = require("../../resources/functions");
const { database } = require("../../database/mongo"); const { database } = require("../../database/mongo");
const { randomColors } = require("../../config.json"); const { randomColors } = require("../../config.json");
@ -24,7 +24,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 args = arg.trim().split(/(?<!\\),+/); const args = arg.trim().split(/(?<!\\),+(?!\d*})/);
const option = arg.trim().split(/(?<!\\)(\-\-)+/); const option = arg.trim().split(/(?<!\\)(\-\-)+/);
let user, avatar, member, show, notFound = ""; let user, avatar, member, show, notFound = "";
let [allEmb, multipleMemMes, dupliCheck] = [[], [], []]; let [allEmb, multipleMemMes, dupliCheck] = [[], [], []];
@ -36,7 +36,7 @@ module.exports = class avatar extends commando.Command {
if (msg.guild ? !msg.guild.member(msg.author).hasPermission("MANAGE_MESSAGES") : false) { if (msg.guild ? !msg.guild.member(msg.author).hasPermission("MANAGE_MESSAGES") : false) {
onceOnly = true; onceOnly = true;
if (args.length > 1) { if (args.length > 1) {
trySend(this.client, msg, "Manage messages permission required to show two or more avatar at once!"); tryReact(msg, "cathmmLife:772716381874946068");
} }
} }
for (const ops of option) { for (const ops of option) {