Drop stringToBinary Dependency

This commit is contained in:
Daniel Odendahl Jr
2017-04-12 01:37:42 +00:00
parent d560221f5d
commit 34541e042b
3 changed files with 9 additions and 4 deletions
+8 -1
View File
@@ -1,5 +1,12 @@
const { Command } = require('discord.js-commando');
const stringToBinary = require('string-to-binary');
const stringToBinary = (str) => {
const pad = "00000000";
return unescape(encodeURIComponent(str))
.split('').map(str => {
const binary = str.charCodeAt(0).toString(2);
return pad.slice(binary.length) + binary;
}).join('');
};
module.exports = class BinaryCommand extends Command {
constructor(client) {