23 lines
1.2 KiB
JavaScript
23 lines
1.2 KiB
JavaScript
|
const ImageCommand = require("../../classes/imageCommand.js");
|
||
|
|
||
|
class MotivateCommand extends ImageCommand {
|
||
|
params(args, url) {
|
||
|
const newArgs = args.filter(item => !item.includes(url));
|
||
|
const [topText, bottomText] = newArgs.join(" ").split(/(?<!\\),/).map(elem => elem.trim());
|
||
|
return {
|
||
|
top: topText.replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%"),
|
||
|
bottom: bottomText ? bottomText.replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%") : ""
|
||
|
};
|
||
|
}
|
||
|
|
||
|
static description = "Generates a motivational poster";
|
||
|
static aliases = ["motivational", "motiv", "demotiv", "demotivational", "poster", "motivation", "demotivate"];
|
||
|
static arguments = ["[top text]", "{bottom text}"];
|
||
|
|
||
|
static requiresText = true;
|
||
|
static noText = "you need to provide some text to generate a motivational poster!";
|
||
|
static noImage = "you need to provide an image to generate a motivational poster!";
|
||
|
static command = "motivate";
|
||
|
}
|
||
|
|
||
|
module.exports = MotivateCommand;
|