Skip to content

Commit

Permalink
feat: add new id property
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed Jun 28, 2022
1 parent 1eb9637 commit 54cfa95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { request } from "./src/utils";
import c from "./src/const";
import get from "axios";

class Disgrowth {

Expand All @@ -22,10 +22,11 @@ class Disgrowth {
* ```
* https://disgrowth.mod.land/stats/get?id=724047481561809007
*/
async myStats(): Promise<object> {
async myStats() {
const endpoint = `${this.base}/stats/get?id=${this.bot}`;
const res = await request(endpoint, "GET");
return res.body as object;
const res = await get(endpoint,
{ headers: { "Content-Type": "application/json" } });
return res.data;
}

}
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface IGetData {
title: string;
id: string;
description: string;
avatar: string;
server_count: number;
Expand Down

0 comments on commit 54cfa95

Please sign in to comment.