mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 11:21:16 +02:00
Cool pad thing
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { pad } = require('../../structures/Util');
|
||||
|
||||
module.exports = class BinaryCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -28,7 +29,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
binary(text) {
|
||||
return text.split('').map(str => {
|
||||
const converted = str.charCodeAt(0).toString(2);
|
||||
return `${'00000000'.slice(converted.length)}${converted}`;
|
||||
return pad(converted, '00000000');
|
||||
}).join('');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user