From fe58a6a370d3ad0172907e9f06d110cd3a4b3b07 Mon Sep 17 00:00:00 2001 From: TheEssem Date: Mon, 30 Mar 2020 09:02:51 -0500 Subject: [PATCH] Updated eslint parser to use ES2019, allow using backspace before comma in meme/motivate --- .eslintrc.json | 2 +- commands/meme.js | 2 +- commands/motivate.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 91583b1..3646138 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,7 @@ "extends": ["eslint:recommended", "plugin:promise/recommended"], "parserOptions": { "sourceType": "module", - "ecmaVersion": 2017 + "ecmaVersion": 2019 }, "plugins": ["promise"], "rules": { diff --git a/commands/meme.js b/commands/meme.js index e2e00c0..1fa9207 100644 --- a/commands/meme.js +++ b/commands/meme.js @@ -7,7 +7,7 @@ exports.run = async (message, args) => { const image = await require("../utils/imagedetect.js")(message); if (image === undefined) return `${message.author.mention}, you need to provide an image to generate a meme!`; if (args.length === 0) return `${message.author.mention}, you need to provide some text to generate a meme!`; - const [topText, bottomText] = args.join(" ").split(",").map(elem => elem.trim()); + const [topText, bottomText] = args.join(" ").split(/(? elem.trim()); const file = `/tmp/${Math.random().toString(36).substring(2, 15)}.miff`; const file2 = `/tmp/${Math.random().toString(36).substring(2, 15)}.png`; const file3 = `/tmp/${Math.random().toString(36).substring(2, 15)}.png`; diff --git a/commands/motivate.js b/commands/motivate.js index 79bd2e0..bc2fa14 100644 --- a/commands/motivate.js +++ b/commands/motivate.js @@ -7,7 +7,7 @@ exports.run = async (message, args) => { if (image === undefined) return `${message.author.mention}, you need to provide an image/GIF to make a motivational poster!`; if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a motivational poster!`; const processMessage = await message.channel.createMessage(" Processing... This might take a while"); - const [topText, bottomText] = args.join(" ").split(",").map(elem => elem.trim()); + const [topText, bottomText] = args.join(" ").split(/(? elem.trim()); const file = `/tmp/${Math.random().toString(36).substring(2, 15)}.miff`; const text = `/tmp/${Math.random().toString(36).substring(2, 15)}.png`; const text2 = `/tmp/${Math.random().toString(36).substring(2, 15)}.png`;