From 363b7df86797e5fc1a7e3da312f9592773e65200 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 13 Apr 2017 13:36:02 +0000 Subject: [PATCH] Upside-Down Converter --- commands/textedit/udmappings.json | 56 +++++++++++++++++++++++++++++++ commands/textedit/upsidedown.js | 33 ++++++++++++++++++ commands/util/info.js | 2 +- html/carbondesc.html | 2 +- html/discordbots.html | 2 +- package.json | 2 +- 6 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 commands/textedit/udmappings.json create mode 100644 commands/textedit/upsidedown.js diff --git a/commands/textedit/udmappings.json b/commands/textedit/udmappings.json new file mode 100644 index 00000000..8f002823 --- /dev/null +++ b/commands/textedit/udmappings.json @@ -0,0 +1,56 @@ +{ + "dictionary": { + "a": "\u0250", + "b": "q", + "c": "\u0254", + "d": "p", + "e": "\u01DD", + "f": "\u025F", + "g": "\u0183", + "h": "\u0265", + "i": "\u1D09", + "j": "\u027E", + "k": "\u029E", + "m": "\u026F", + "n": "u", + "p": "d", + "q": "b", + "r": "\u0279", + "t": "\u0287", + "u": "n", + "v": "\u028C", + "w": "\u028D", + "y": "\u028E", + "A": "\u2200", + "C": "\u0186", + "E": "\u018E", + "F": "\u2132", + "G": "\u05E4", + "J": "\u017F", + "L": "\u02E5", + "M": "W", + "P": "\u0500", + "T": "\u2534", + "U": "\u2229", + "V": "\u039B", + "W": "M", + "Y": "\u2144", + "1": "\u0196", + "2": "\u1105", + "3": "\u0190", + "4": "\u3123", + "5": "\u03DB", + "6": "9", + "7": "\u3125", + "9": "6", + ",": "'", + ".": "\u02D9", + "'": ",", + "\"": ",,", + "_": "\u203E", + "&": "\u214B", + "!": "\u00A1", + "?": "\u00BF", + "`": ",", + } +} \ No newline at end of file diff --git a/commands/textedit/upsidedown.js b/commands/textedit/upsidedown.js new file mode 100644 index 00000000..65cf65a5 --- /dev/null +++ b/commands/textedit/upsidedown.js @@ -0,0 +1,33 @@ +const { Command } = require('discord.js-commando'); +const translator = require('custom-translate'); +const { dictionary } = require('./udmappings.json'); + +module.exports = class UpsideDownCommand extends Command { + constructor(client) { + super(client, { + name: 'upsidedown', + aliases: [ + 'upside-down', + 'udown' + ], + group: 'textedit', + memberName: 'upsidedown', + description: 'Flips text upside-down. (;upsidedown It\'s upside-down!)', + examples: [';upsidedown It\'s upside-down!'], + args: [{ + key: 'text', + prompt: 'What text would you like to flip upside-down?', + type: 'string' + }] + }); + } + + run(message, args) { + if (message.channel.type !== 'dm') { + if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; + } + const text = args.text; + const upsideDown = translator.letterTrans(text, dictionary); + return message.say(upsideDown); + } +}; diff --git a/commands/util/info.js b/commands/util/info.js index 5be3113f..9c5a3d1f 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command { .addField('Shards', `${this.client.options.shardCount} (${this.client.shard.id})`, true) .addField('Commands', - '109', true) + '110', true) .addField('Owner', 'dragonfire535#8081', true) .addField('Source Code', diff --git a/html/carbondesc.html b/html/carbondesc.html index a58eed24..23687bcb 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -47,7 +47,7 @@

Information

diff --git a/html/discordbots.html b/html/discordbots.html index 3fb16b4a..963547ab 100644 --- a/html/discordbots.html +++ b/html/discordbots.html @@ -95,7 +95,7 @@

Information

diff --git a/package.json b/package.json index af1d922c..91e9cf44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "24.1.0", + "version": "24.2.0", "description": "A Discord Bot", "main": "shardingmanager.js", "repository": {