padStart instead of Util.pad

This commit is contained in:
Daniel Odendahl Jr
2018-01-28 02:04:04 +00:00
parent d63cfef8a0
commit d58364a3d1
6 changed files with 10 additions and 11 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const { Command } = require('discord.js-commando');
const { list, pad } = require('../../util/Util');
const { list } = require('../../util/Util');
const modes = ['encode', 'decode'];
module.exports = class BinaryCommand extends Command {
@@ -41,7 +41,7 @@ module.exports = class BinaryCommand extends Command {
binary(text) {
return text.split('').map(str => {
const converted = str.charCodeAt(0).toString(2);
return pad(converted, '00000000');
return converted.padStart(8, '0');
}).join(' ');
}