From 0e827d1c85af0d0ee928b0681bc495637e734502 Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Tue, 25 May 2021 14:36:27 -0400 Subject: [PATCH] im breaking the bot --- cmd/perm.js | 2 +- lights/request.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cmd/perm.js b/cmd/perm.js index f646b6b..56ea235 100644 --- a/cmd/perm.js +++ b/cmd/perm.js @@ -82,7 +82,7 @@ class Purge extends Command { guild.leave(); purged++; } else { - this.log.info(`keeping guild ${guild.name} (${guild.id})`); + this.log.debug(`keeping guild ${guild.name} (${guild.id})`); } }); msg.channel.createMessage(`purged ${purged} guilds.`); diff --git a/lights/request.js b/lights/request.js index ca412c9..19fcc98 100644 --- a/lights/request.js +++ b/lights/request.js @@ -7,11 +7,6 @@ function getBinarySize(string) { return Buffer.byteLength(string, 'utf8'); } -function padLeft(size = 4, str = '') { - let remaining = size - str.length; - return '0'.repeat(remaining) + str; -} - export default function req(data, callback, errorCallback) { let string_data = JSON.stringify(data); let size = getBinarySize(string_data); @@ -22,11 +17,7 @@ export default function req(data, callback, errorCallback) { let client = new net.Socket(); client.connect(port, hostname, () => { - let res = client.write(padLeft(4, `${size}`)); - - if (res) { - client.write(string_data); - } + client.write(string_data); client.destroy(); callback('success.'); });