From 5d6f058d5a8332806fb270e560b9b29bad440090 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Thu, 3 Feb 2022 19:31:59 -0500 Subject: [PATCH] re-enable site command --- src/commands/site.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/site.ts b/src/commands/site.ts index 8347490..28924c9 100644 --- a/src/commands/site.ts +++ b/src/commands/site.ts @@ -62,7 +62,7 @@ export default class SiteInfo extends Command { this.aliases = ['ssl', 'cert', 'certinfo', 'ci', 'tls', 'si', 'siteinfo']; this.permissions = 0; this.guildOnly = true; - this.enabled = false; + this.enabled = true; } public async run(message: Message, args: string[]) { @@ -145,7 +145,7 @@ export default class SiteInfo extends Command { loading.delete().catch(() => {}); return this.error(message.channel, 'Unable to receive information.'); } - let screenshotData: string; + let screenshotData: string | Buffer; try { const browser = await puppeteer.launch({ ignoreHTTPSErrors: true, @@ -157,7 +157,7 @@ export default class SiteInfo extends Command { const page = await browser.newPage(); await page.goto(`https://${args[0]}`); screenshotData = await page.screenshot(); - browser.close(); + await browser.close(); } catch (e) { this.client.util.signale.error(e); } @@ -221,7 +221,7 @@ export default class SiteInfo extends Command { const embed = new RichEmbed(); embed.addField('Web Software', r.headers['server'] ?? 'N/A', true); embed.addField('Content Type', r.headers['content-type'] ? r.headers['content-type'].split(';')[0] : 'N/A', true); - embed.addField('Content Length', r.headers['content-length'] ? this.client.util.dataConversion(r.headers['content-length']) : 'N/A', true); + embed.addField('Content Length', r.headers['content-length'] ? this.client.util.dataConversion(Number(r.headers['content-length'])) : 'N/A', true); return embed.fields; }