Fixed pango test escape issues

This commit is contained in:
TheEssem 2020-12-30 11:37:41 -06:00
parent 5e170c8fe7
commit c4c358dcd9
3 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@ exports.run = async (message, args) => {
const { buffer, type } = await magick.run({
cmd: "caption",
path: image.path,
caption: newArgs.join(" ")
caption: newArgs.join(" ").replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;")
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {

View file

@ -9,7 +9,7 @@ exports.run = async (message, args) => {
const { buffer, type } = await magick.run({
cmd: "captionTwo",
path: image.path,
caption: newArgs.length !== 0 ? newArgs.join(" ") : words.sort(() => 0.5 - Math.random()).slice(0, Math.floor(Math.random() * words.length + 1)).join(" ")
caption: newArgs.length !== 0 ? newArgs.join(" ").replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : words.sort(() => 0.5 - Math.random()).slice(0, Math.floor(Math.random() * words.length + 1)).join(" ")
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {

View file

@ -5,7 +5,7 @@ exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a Sonic meme!`;
message.channel.sendTyping();
const cleanedMessage = args.join(" ").replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;");
const { buffer, type } = await magick.run({
const { buffer } = await magick.run({
cmd: "sonic",
text: wrap(cleanedMessage, {width: 15, indent: ""})
});