From 3842db73a1ea00c23e692715b339c98d1a4ea111 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 18 Mar 2018 20:59:36 +0000 Subject: [PATCH] Fancy Command --- README.md | 3 ++- assets/json/fancy.json | 54 +++++++++++++++++++++++++++++++++++++ commands/text-edit/fancy.js | 30 +++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 assets/json/fancy.json create mode 100644 commands/text-edit/fancy.js diff --git a/README.md b/README.md index a5787f1b..2861686f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Xiao is a Discord bot coded in JavaScript with 300 commands, she is one of the most feature-filled bots out there, and formerly served over 10,000 servers with a uniquely devoted fanbase. -## Commands (288) +## Commands (289) ### Utility: * **prefix**: Shows or sets the command prefix. @@ -269,6 +269,7 @@ served over 10,000 servers with a uniquely devoted fanbase. * **dvorak**: Converts text to Dvorak encoding. * **embed**: Sends text in an embed. * **emojify**: Converts text to emoji form. +* **fancy**: Converts text to fancy letters. * **hex**: Converts text to hex. * **latlmes**: Creates a Latlmes fake link that redirects to a rickroll. * **lmgtfy**: Creates a LMGTFY link with the query you provide. diff --git a/assets/json/fancy.json b/assets/json/fancy.json new file mode 100644 index 00000000..44f73b4a --- /dev/null +++ b/assets/json/fancy.json @@ -0,0 +1,54 @@ +{ + "a": "𝔞", + "b": "𝔟", + "c": "𝔠", + "d": "𝔡", + "e": "𝔢", + "f": "𝔣", + "g": "𝔤", + "h": "𝔥", + "i": "𝔦", + "j": "𝔧", + "k": "𝔨", + "l": "𝔩", + "m": "𝔪", + "n": "𝔫", + "o": "𝔬", + "p": "𝔭", + "q": "𝔮", + "r": "𝔯", + "s": "𝔰", + "t": "𝔱", + "u": "𝔲", + "v": "𝔳", + "w": "𝔴", + "x": "𝔵", + "y": "𝔶", + "z": "𝔷", + "A": "𝔄", + "B": "𝔅", + "C": "ℭ", + "D": "𝔇", + "E": "𝔈", + "F": "𝔉", + "G": "𝔊", + "H": "ℌ", + "I": "ℑ", + "J": "𝔍", + "K": "𝔎", + "L": "𝔏", + "M": "𝔐", + "N": "𝔑", + "O": "𝔒", + "P": "𝔓", + "Q": "𝔔", + "R": "ℜ", + "S": "𝔖", + "T": "𝔗", + "U": "𝔘", + "V": "𝔙", + "W": "𝔚", + "X": "𝔛", + "Y": "𝔜", + "Z": "ℨ" +} diff --git a/commands/text-edit/fancy.js b/commands/text-edit/fancy.js new file mode 100644 index 00000000..9ffb4608 --- /dev/null +++ b/commands/text-edit/fancy.js @@ -0,0 +1,30 @@ +const { Command } = require('discord.js-commando'); +const { letterTrans } = require('custom-translate'); +const dictionary = require('../../assets/json/fancy'); + +module.exports = class FancyCommand extends Command { + constructor(client) { + super(client, { + name: 'fancy', + aliases: ['fancy-letters'], + group: 'text-edit', + memberName: 'fancy', + description: 'Converts text to fancy letters.', + args: [ + { + key: 'text', + prompt: 'What text would you like to convert to fancy letters?', + type: 'string', + validate: text => { + if (letterTrans(text, dictionary).length < 2000) return true; + return 'Invalid text, your text is too long.'; + } + } + ] + }); + } + + run(msg, { text }) { + return msg.say(letterTrans(text, dictionary)); + } +};