re-enable site command

merge-requests/28/head
Matthew 2022-02-03 19:31:59 -05:00
parent fe7099232c
commit 5d6f058d5a
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ export default class SiteInfo extends Command {
this.aliases = ['ssl', 'cert', 'certinfo', 'ci', 'tls', 'si', 'siteinfo']; this.aliases = ['ssl', 'cert', 'certinfo', 'ci', 'tls', 'si', 'siteinfo'];
this.permissions = 0; this.permissions = 0;
this.guildOnly = true; this.guildOnly = true;
this.enabled = false; this.enabled = true;
} }
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {
@ -145,7 +145,7 @@ export default class SiteInfo extends Command {
loading.delete().catch(() => {}); loading.delete().catch(() => {});
return this.error(message.channel, 'Unable to receive information.'); return this.error(message.channel, 'Unable to receive information.');
} }
let screenshotData: string; let screenshotData: string | Buffer;
try { try {
const browser = await puppeteer.launch({ const browser = await puppeteer.launch({
ignoreHTTPSErrors: true, ignoreHTTPSErrors: true,
@ -157,7 +157,7 @@ export default class SiteInfo extends Command {
const page = await browser.newPage(); const page = await browser.newPage();
await page.goto(`https://${args[0]}`); await page.goto(`https://${args[0]}`);
screenshotData = await page.screenshot(); screenshotData = await page.screenshot();
browser.close(); await browser.close();
} catch (e) { } catch (e) {
this.client.util.signale.error(e); this.client.util.signale.error(e);
} }
@ -221,7 +221,7 @@ export default class SiteInfo extends Command {
const embed = new RichEmbed(); const embed = new RichEmbed();
embed.addField('Web Software', r.headers['server'] ?? 'N/A', true); 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 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; return embed.fields;
} }