From 54709a898b6171fb4bf1361c12997bf4af6794b8 Mon Sep 17 00:00:00 2001 From: ashley zomo Date: Sun, 6 Mar 2022 11:20:36 -0600 Subject: [PATCH] updated api --- src/api.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/api.ts b/src/api.ts index f7b3881..7d8ee46 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,8 +1,7 @@ /*eslint prefer-const: "error"*/ import * as cheerio from 'cheerio'; import { CommandInteraction } from 'discord.js'; -import { IncomingMessage } from 'http'; -import http from 'https'; +import http, { IncomingMessage } from 'http'; import { emsg } from './util/main'; import * as Lang from './lang'; @@ -27,8 +26,8 @@ function getHTML(name: string): Promise { return new Promise((resolve, reject) => { - const init = { - host: 'uniteapi.dev', + const opts = { + host: '147.182.215.216', path: `/p/${encodeURIComponent(name)}`, method: 'GET', }; @@ -50,7 +49,7 @@ function getHTML(name: string): Promise { }); }; - const req = http.request(init, callback); + const req = http.request(opts, callback); req.end(); });