Fixed pango test escape issues
This commit is contained in:
parent
5e170c8fe7
commit
c4c358dcd9
3 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ exports.run = async (message, args) => {
|
||||||
const { buffer, type } = await magick.run({
|
const { buffer, type } = await magick.run({
|
||||||
cmd: "caption",
|
cmd: "caption",
|
||||||
path: image.path,
|
path: image.path,
|
||||||
caption: newArgs.join(" ")
|
caption: newArgs.join(" ").replace(/&/g, "\\&").replace(/>/g, "\\>").replace(/</g, "\\<").replace(/"/g, "\\"").replace(/'/g, "\\'")
|
||||||
});
|
});
|
||||||
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
|
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -9,7 +9,7 @@ exports.run = async (message, args) => {
|
||||||
const { buffer, type } = await magick.run({
|
const { buffer, type } = await magick.run({
|
||||||
cmd: "captionTwo",
|
cmd: "captionTwo",
|
||||||
path: image.path,
|
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, "\\&").replace(/>/g, "\\>").replace(/</g, "\\<").replace(/"/g, "\\"").replace(/'/g, "\\'") : 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();
|
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -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!`;
|
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a Sonic meme!`;
|
||||||
message.channel.sendTyping();
|
message.channel.sendTyping();
|
||||||
const cleanedMessage = args.join(" ").replace(/&/g, "\\&").replace(/>/g, "\\>").replace(/</g, "\\<").replace(/"/g, "\\"").replace(/'/g, "\\'");
|
const cleanedMessage = args.join(" ").replace(/&/g, "\\&").replace(/>/g, "\\>").replace(/</g, "\\<").replace(/"/g, "\\"").replace(/'/g, "\\'");
|
||||||
const { buffer, type } = await magick.run({
|
const { buffer } = await magick.run({
|
||||||
cmd: "sonic",
|
cmd: "sonic",
|
||||||
text: wrap(cleanedMessage, {width: 15, indent: ""})
|
text: wrap(cleanedMessage, {width: 15, indent: ""})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue