Remove Finger Binary

This commit is contained in:
Daniel Odendahl Jr
2017-05-24 20:57:21 +00:00
parent 2c9f2c52b7
commit 29ec617399
4 changed files with 2 additions and 74 deletions
-38
View File
@@ -1,38 +0,0 @@
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);
}
};