Finger Binary

This commit is contained in:
Daniel Odendahl Jr
2017-05-24 20:21:23 +00:00
parent 045fec4448
commit 2e044b00b2
4 changed files with 72 additions and 2 deletions
+32
View File
@@ -0,0 +1,32 @@
{
"00001": ":thumbsup:",
"00010": "<:00010:317020047405088768>",
"00011": "<:00011:317020047208087553>",
"00100": "<:00100:317020047417802762>",
"00101": "<:00101:317020047157755905>",
"00110": ":v:",
"00111": "<:00111:317020222336794624>",
"01000": "<:01000:317020047358951454>",
"01001": "<:01001:317020047056961537>",
"01010": "<:01010:317020046964555778>",
"01011": "<:01011:317020047249768449>",
"01101": "<:01101:317020046947778561>",
"01110": "<:01110:317020047367208961>",
"01111": "<:01111:317020047367340033>",
"10000": "<:10000:317020047853879296>",
"10001": "<:10001:317020047383986186>",
"10010": "<:10010:317020046939389963>",
"10011": "<:10011:317022879004884992>",
"10100": "<:10100:317020047383986176>",
"10101": "<:10101:317020046134345728>",
"10110": "<:10110:317020046121631754>",
"10111": "<:10111:317020046365032451>",
"11000": "<:11000:317020046473822208>",
"11001": "<:11001:317020046318764032>",
"11010": "<:11010:317020046750777347>",
"11011": "<:11011:317020046285078530>",
"11100": "<:11100:317020046989983744>",
"11101": "<:11101:317020047367208970>",
"11110": "<:11110:317020045744275458>",
"11111": ":hand_splayed:"
}
+38
View File
@@ -0,0 +1,38 @@
const { Command } = require('discord.js-commando');
const binary = (str) => {
return unescape(encodeURIComponent(str))
.split('').map(str => {
const binary = str.charCodeAt(0).toString(2);
return `${'00000000'.slice(binary.length)}${binary}`;
}).join('');
};
const { wordTrans } = require('custom-translate');
const dictionary = require('../../assets/json/finger-binary');
module.exports = class FingerBinaryCommand extends Command {
constructor(client) {
super(client, {
name: 'finger-binary',
group: 'textedit',
memberName: 'finger-binary',
description: 'Converts text to finger binary.',
args: [
{
key: 'text',
prompt: 'What text would you like to convert to finger binary?',
type: 'string',
validate: text => {
if (wordTrans(binary(text).match(/.{1,5}/g).join(' '), dictionary, '').length < 2000) return true;
return 'Your text is too long.';
},
parse: text => wordTrans(binary(text).match(/.{1,5}/g).join(' '), dictionary, '')
}
]
});
}
run(msg, args) {
const { text } = args;
return msg.say(text);
}
};
+1 -1
View File
@@ -54,7 +54,7 @@
</ol>
<li>LMGTFY Link Generation!</li>
<li>Translate Text to almost 100 languages!</li>
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Binary, Finger Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
<li>Customizable Prefix!</li>
<li>Member Join/Leave Logging to a Customizable Channel, with a Customizable Message!</li>
+1 -1
View File
@@ -51,7 +51,7 @@
</ul>
<li>LMGTFY Link Generation!</li>
<li>Translate Text to almost 100 languages!</li>
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Binary, Finger Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
<li>Customizable Prefix!</li>
<li>Member Join/Leave Logging to a Customizable Channel, with a Customizable Message!</li>