Updated eslint parser to use ES2019, allow using backspace before comma in meme/motivate

This commit is contained in:
TheEssem 2020-03-30 09:02:51 -05:00
parent b853345960
commit fe58a6a370
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
"extends": ["eslint:recommended", "plugin:promise/recommended"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017
"ecmaVersion": 2019
},
"plugins": ["promise"],
"rules": {

View File

@ -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(/(?<!\\),/).map(elem => 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`;

View File

@ -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("<a:processing:479351417102925854> Processing... This might take a while");
const [topText, bottomText] = args.join(" ").split(",").map(elem => elem.trim());
const [topText, bottomText] = args.join(" ").split(/(?<!\\),/).map(elem => 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`;