Upgraded retrotext and DBL posting packages, fixed mention prefixes and DM commands

This commit is contained in:
TheEssem 2021-03-18 09:29:03 -05:00
parent c0332673bf
commit 5d2e2b5274
8 changed files with 278 additions and 46 deletions

View file

@ -1,4 +1,5 @@
const RetroText = require("retrotext");
const { TextStyle, BackgroundStyle } = RetroText;
exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to generate some retro text!`;
@ -7,14 +8,15 @@ exports.run = async (message, args) => {
if (/^[\w ]+$/i.test(line1) === false || /^[\w ]+$/i.test(line2) === false || /^[\w ]+$/i.test(line3) === false) return `${message.author.mention}, only alphanumeric characters, spaces, and underscores are allowed!`;
let text;
if (line3) {
text = new RetroText().setLine(1, line1).setLine(2, line2).setLine(3, line3).setBackgroundStyle("outlineTri").setTextStyle("chrome");
text = new RetroText.default().setLine1(line1).setLine2(line2).setLine3(line3).setBackgroundStyle(BackgroundStyle.OUTLINE_TRIANGLE).setTextStyle(TextStyle.CHROME);
} else if (line2) {
text = new RetroText().setLine(1, line1).setLine(2, line2).setBackgroundStyle("outlineTri").setTextStyle("chrome");
text = new RetroText.default().setLine1(line1).setLine2(line2).setBackgroundStyle(BackgroundStyle.OUTLINE_TRIANGLE).setTextStyle(TextStyle.CHROME);
} else {
text = new RetroText().setLine(2, line1).setBackgroundStyle("outlineTri").setTextStyle("chrome");
text = new RetroText.default().setLine2(line1).setBackgroundStyle(BackgroundStyle.OUTLINE_TRIANGLE).setTextStyle(TextStyle.CHROME);
}
const buffer = await text.fetchBuffer();
return {
file: await text.fetchBuffer(),
file: Buffer.from(buffer),
name: "retro.png"
};
};