fix for tls
parent
87746008b4
commit
e0d7feb183
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-plusplus */
|
||||
import cheerio from 'cheerio';
|
||||
import https from 'https';
|
||||
import axios, { AxiosError, AxiosResponse } from 'axios';
|
||||
import { Message } from 'eris';
|
||||
import { Client, Command, RichEmbed } from '../class';
|
||||
|
@ -62,6 +63,7 @@ export default class TLS extends Command {
|
|||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||
https.globalAgent.options.rejectUnauthorized = false;
|
||||
|
||||
let r: AxiosResponse;
|
||||
let s: AxiosResponse;
|
||||
|
@ -159,8 +161,10 @@ export default class TLS extends Command {
|
|||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||
embed.setTimestamp();
|
||||
|
||||
https.globalAgent.options.rejectUnauthorized = true;
|
||||
return message.channel.createMessage({ embed });
|
||||
} catch (err) {
|
||||
https.globalAgent.options.rejectUnauthorized = true;
|
||||
return this.client.util.handleError(err, message, this, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue