Delete src directory

This commit is contained in:
Night Kaly 2021-09-13 19:09:30 +08:00 committed by GitHub
parent 08e984b00b
commit 6cd9b56293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 65 deletions

View file

@ -1,35 +0,0 @@
const axios = require("axios");
const config = require("../utils/config.json");
/**
* @class APIClient
**/
class APIClient {
/**
* @name APIClient
* @kind constructor
* @param {String} key Authorization Key for API (Only for CODM commands)
* @param {String} [options.key]
*/
constructor(key, options = {}) {
if (key && typeof key !== "string")
throw new TypeError("API key must be a string");
if (key) this.key = key;
}
/**
* Sends a CODM perk object
* @returns {Promise<Object>}
* @param {String} name
*/
async getperk(name) {
const data = await axios
.get(`${config.api}/api/v1/codm/perks?name=${name}`, {
headers: {
Authorization: this.key,
},
})
.then(res => res.data)
.catch(err => console.error(`Unauthorized to use`));
return data;
}
}
module.exports = APIClient;

View file

@ -1,13 +0,0 @@
const axios = require("axios");
const config = require("../utils/config.json");
/**
* Sends a 8ball response
* @returns {Promise<String>}
*/
async function random() {
const data = await axios
.get(`${config.api}/api/v1/fun/8ball`)
.then(res => res.data);
return data.answer;
}
module.exports = random;

View file

@ -1,14 +0,0 @@
declare module "cath" {
export class APIClient {
public constructor(key: string, options?: APIClientOptions);
private key: string;
public options?: APIClientOptions;
public random8ball(): Promise<String>;
public getperk(perk: string): Promise<Object>;
}
export type APIClientOptions = {
codm?: string;
};
}

View file

@ -1,3 +0,0 @@
{
"api": "https://www.cathapi.gq"
}