updated api
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
/*eslint prefer-const: "error"*/
|
/*eslint prefer-const: "error"*/
|
||||||
import * as cheerio from 'cheerio';
|
import * as cheerio from 'cheerio';
|
||||||
import { CommandInteraction } from 'discord.js';
|
import { CommandInteraction } from 'discord.js';
|
||||||
import { IncomingMessage } from 'http';
|
import http, { IncomingMessage } from 'http';
|
||||||
import http from 'https';
|
|
||||||
import { emsg } from './util/main';
|
import { emsg } from './util/main';
|
||||||
import * as Lang from './lang';
|
import * as Lang from './lang';
|
||||||
|
|
||||||
@@ -27,8 +26,8 @@ function getHTML(name: string): Promise<string> {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
const init = {
|
const opts = {
|
||||||
host: 'uniteapi.dev',
|
host: '147.182.215.216',
|
||||||
path: `/p/${encodeURIComponent(name)}`,
|
path: `/p/${encodeURIComponent(name)}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
};
|
};
|
||||||
@@ -50,7 +49,7 @@ function getHTML(name: string): Promise<string> {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const req = http.request(init, callback);
|
const req = http.request(opts, callback);
|
||||||
req.end();
|
req.end();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user