From 7bd19937788aee8cb0e4976ffeb188b34be69da5 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 8 Mar 2021 17:43:43 -0500 Subject: [PATCH] Cool Text Command --- README.md | 5 +- assets/json/cool-text.json | 272 ++++++++++++++++++++++++++ commands/edit-image-text/cool-text.js | 51 +++++ package.json | 2 +- 4 files changed, 328 insertions(+), 2 deletions(-) create mode 100644 assets/json/cool-text.json create mode 100644 commands/edit-image-text/cool-text.js diff --git a/README.md b/README.md index 449d955c..82a20e49 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 617 +Total: 618 ### Utility: @@ -737,6 +737,7 @@ Total: 617 * **caution:** Creates a caution sign with the text of your choice. * **certificate:** Sends a certificate of excellence with the name and reason of your choice. * **chinese-restaurant:** Sends a Chinese restaurant sign with the text of your choice. +* **cool-text:** Writes text in some cool fonts. * **danger:** Creates a danger sign with the text of your choice. * **font:** Types text in a specific font. * **gandhi-quote:** Makes Mahatma Gandhi say the quote you want. @@ -1127,6 +1128,8 @@ here. * zalgo ([Zalgo Character Data](https://github.com/clux/zalgolize/blob/master/zalgo.js#L3-L21)) - [CoolClips.com](http://search.coolclips.com/) * sip ([Image](http://search.coolclips.com/m/vector/hand0007/Hands-holding-mug/)) +- [Cool Text Graphics Generator](https://cooltext.com/) + * cool-text (API) - [cowsay Online](http://cowsay.morecode.org/) * cow-say (API) - [Creative Certificates](https://www.creativecertificates.com/) diff --git a/assets/json/cool-text.json b/assets/json/cool-text.json new file mode 100644 index 00000000..83fadd54 --- /dev/null +++ b/assets/json/cool-text.json @@ -0,0 +1,272 @@ +{ + "fun": { + "LogoID": "1009848424", + "FontSize": "70", + "Color1_color": "#F2D324", + "Color2_color": "#F02B2B", + "Color3_color": "#000000", + "Integer1": "3", + "Integer5": "2", + "Integer7": "8", + "Integer8": "8", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "burning": { + "LogoID": "4", + "FontSize": "70", + "Color1_color": "#FF0000", + "Integer1": "15", + "Boolean1": "on", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "BackgroundColor_color": "#FFFFFF" + }, + "white": { + "LogoID": "732438332", + "FontSize": "70", + "Color1_color": "#000000", + "Color2_color": "#FFFFFF", + "Color3_color": "#FFFFFF", + "Integer5": "0", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "fantasy": { + "LogoID": "45", + "FontSize": "70", + "Color1_color": "#D5CE5F", + "Color2_color": "#D5CE5F", + "Integer1": "135", + "Integer2": "45", + "Integer3": "3", + "Integer5": "2", + "Integer7": "3", + "Integer8": "3", + "Integer14_color": "#000000", + "Integer6": "50", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "dragon": { + "LogoID": "1408867449", + "FontSize": "120", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "ice": { + "LogoID": "1779834160", + "FontSize": "120", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "gunmetal": { + "LogoID": "852819205", + "FontSize": "70", + "Color1_color": "#FAFAFA", + "Boolean2": "on", + "Integer5": "4", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "70", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "wizards": { + "LogoID": "38", + "FontSize": "70", + "Boolean2": "on", + "Integer5": "0", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "5", + "BackgroundColor_color": "#FFFFFF" + }, + "sword": { + "LogoID": "2172004512", + "FontSize": "120", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "vampire": { + "LogoID": "732414977", + "FontSize": "70", + "Boolean1": "on", + "Color1_color": "#FC14F4", + "Color2_color": "#60D4CE", + "Integer1": "135", + "Integer2": "45", + "Integer3": "3", + "Integer5": "2", + "Integer7": "3", + "Integer8": "3", + "Integer14_color": "#000000", + "Integer6": "50", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "dark": { + "LogoID": "830474754", + "FontSize": "70", + "Boolean1": "on", + "Boolean2": "on", + "Integer1": "5", + "Boolean3": "on", + "Integer5": "4", + "Integer7": "2", + "Integer8": "2", + "Integer14_color": "#FFF2FF", + "Integer6": "30", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "comic": { + "LogoID": "9", + "FontSize": "70", + "Integer1": "5", + "Integer5": "2", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#000000" + }, + "spring": { + "LogoID": "759902224", + "FontSize": "70", + "Color1_color": "#66FFCC", + "Color2_color": "#B94FFF", + "Integer1": "6", + "Integer2": "1", + "Integer5": "0", + "Integer7": "3", + "Integer8": "3", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "slab": { + "LogoID": "17", + "FontSize": "70", + "Color1_color": "#EFE66E", + "Integer1": "100", + "Boolean1": "on", + "Integer5": "2", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "flaming": { + "LogoID": "1169711118", + "FontSize": "90", + "Color1_color": "#4D0000", + "Integer1": "90", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "BackgroundColor_color": "#FFFFFF" + }, + "lava": { + "LogoID": "852774362", + "FontSize": "70", + "Boolean1": "on", + "Integer1": "3", + "Boolean3": "on", + "Integer5": "2", + "Integer7": "2", + "Integer8": "2", + "Integer14_color": "#000000", + "Integer6": "60", + "Integer9": "6", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#000000" + }, + "tough": { + "LogoID": "758282876", + "FontSize": "70", + "Color1_color": "#0A213D", + "Integer1": "5", + "Integer5": "0", + "Integer7": "0", + "Integer8": "0", + "Integer14_color": "#000000", + "Integer6": "75", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "gold": { + "LogoID": "46", + "FontSize": "70", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + }, + "sushi": { + "LogoID": "830446526", + "FontSize": "70", + "Color1_color": "#CC0808", + "Color2_color": "#E3D110", + "Integer1": "135", + "Integer2": "45", + "Integer3": "2", + "Integer5": "2", + "Integer7": "2", + "Integer8": "2", + "Integer14_color": "#000000", + "Integer6": "40", + "Integer9": "0", + "Integer13": "on", + "Integer12": "on", + "FileFormat": "6", + "BackgroundColor_color": "#FFFFFF" + } +} diff --git a/commands/edit-image-text/cool-text.js b/commands/edit-image-text/cool-text.js new file mode 100644 index 00000000..95f11dc5 --- /dev/null +++ b/commands/edit-image-text/cool-text.js @@ -0,0 +1,51 @@ +const Command = require('../../structures/Command'); +const request = require('node-superfetch'); +const { list } = require('../../util/Util'); +const fonts = require('../../assets/json/cool-text'); + +module.exports = class CoolTextCommand extends Command { + constructor(client) { + super(client, { + name: 'cool-text', + group: 'edit-image-text', + memberName: 'cool-text', + description: 'Writes text in some cool fonts.', + details: `**Fonts:** ${Object.keys(fonts).join(', ')}`, + credit: [ + { + name: 'Cool Text Graphics Generator', + url: 'https://cooltext.com/', + reason: 'API' + } + ], + args: [ + { + key: 'font', + prompt: `What font do you want to use? Either ${list(Object.keys(fonts), 'or')}.`, + type: 'string', + oneOf: Object.keys(fonts), + parse: font => font.toLowerCase() + }, + { + key: 'text', + prompt: 'What text do you want to write?', + type: 'string' + } + ] + }); + } + + async run(msg, { font, text }) { + try { + const { body } = await request + .post('https://cooltext.com/PostChange') + .attach({ + ...fonts[font].options, + Text: text + }); + return msg.say({ files: [body.renderLocation] }); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/package.json b/package.json index fd0e8252..6219f590 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "131.11.2", + "version": "131.12.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {