Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcralph authored Dec 8, 2018
1 parent b02897b commit 0e1bdf1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fetch = require('node-superfetch');
const { get } = require('node-superfetch');

module.exports = class derpy {
constructor(options) {
Expand All @@ -8,7 +8,7 @@ module.exports = class derpy {

static image(type) {
return new Promise((reject, resolve) => {
fetch.get(`${this.url}/image/${type}`)
get(`${this.url}/image/${type}`)
.set("Authorization", this.key)
.then((res) => resolve(res.body))
.catch(err => reject(err))
Expand All @@ -17,19 +17,19 @@ module.exports = class derpy {

static text(type, text) {
return new Promise((reject, resolve) => {
fetch.get(`${this.url}/text/${type}?text=${text}`)
get(`${this.url}/text/${type}?text=${text}`)
.set("Authorization", this.key)
.then((res) => resolve(res.body))
.catch(err => reject(err))
});
}

static imagegen(type, url, text, query) {
let owo; //OwO what's this?
let owo; // OwO what's this?
if (!url) return owo = text;
if (!text) return owo = url;
return new Promise((reject, resolve) => {
fetch.get(`${this.url}/imagegen/${type}?${owo}=${query}`)
get(`${this.url}/imagegen/${type}?${owo}=${query}`)
.set("Authorization", this.key)
.then((res) => resolve(res.body))
.catch(err => reject(err))
Expand Down

0 comments on commit 0e1bdf1

Please sign in to comment.