nonimageapi
Advanced tools
Comparing version 1.0.3 to 1.0.5
{ | ||
"name": "nonimageapi", | ||
"version": "1.0.3", | ||
"version": "1.0.5", | ||
"description": "An image api for you to have fun", | ||
@@ -21,5 +21,2 @@ "main": "index.js", | ||
"license": "ISC", | ||
"dev-dependencies": { | ||
"node-fetch": "^2.6.1" | ||
}, | ||
"dependencies": { | ||
@@ -31,4 +28,5 @@ "@types/node-fetch": "^2.5.11", | ||
"devDependencies": { | ||
"@types/superagent": "^4.1.12", | ||
"typescript": "^4.3.5" | ||
} | ||
} |
@@ -36,2 +36,4 @@ # NonImageApi (Beta) | ||
- More functions for our API | ||
- Typescript | ||
- AND MORE!! | ||
@@ -38,0 +40,0 @@ # Thanks to contributors |
@@ -1,28 +0,26 @@ | ||
import fetch = from 'node-fetch'; | ||
import * as request from 'superagent'; | ||
let url = "https://nonimageapi.apenasigor.repl.co/api/v1/"; | ||
declare class Image { | ||
ImageApi: string; | ||
constructor(Image: string) { | ||
this.ImageApi = Image; | ||
class Image { | ||
constructor(Image: string = "") { | ||
} | ||
fakemsg(msg: string, username: string, avatar: string, bot: boolean) { | ||
if(!bot) bot = false; // Retorna falso caso usuário não coloque "bot" | ||
if(!username) username="User"; // Caso usuário não colocar nome | ||
if(!avatar) avatar="https://cdn.discordapp.com/embed/avatars/0.png?size=2048" // Caso usuário não colocar o url do avatar | ||
if(!msg) new TypeError("Invalid message text") // caso o texto for inválido | ||
if(!bot) bot = false; | ||
if(!username) username="User"; | ||
if(!avatar) avatar="https://cdn.discordapp.com/embed/avatars/0.png?size=2048" | ||
if(!msg) new TypeError("Invalid message text") | ||
return url + `fake-message?avatar=${avatar}&username=${username}&text=${msg}&bot=${bot}`; // Retorna link da mensagem | ||
return url + `fake-message?avatar=${avatar}&username=${username}&text=${msg}&bot=${bot}`; | ||
} | ||
async memes() { | ||
fetch(url + `memes`).then(res => res.json()).then(data => { | ||
return data; | ||
}); | ||
const res = await request.get(url + `memes`); | ||
return res.body; | ||
}; | ||
async cats() { | ||
fetch(url + `cats`).then(res => res.json()).then(data => { | ||
return data; | ||
}); | ||
const res = await request.get(url + `cats`); | ||
return res.body; | ||
}; | ||
} | ||
export = Image; |
@@ -1,7 +0,7 @@ | ||
import nonimageapi = from './index.ts'; | ||
import image = new nonimageapi(); | ||
let test = images.fakemsg("bomdia", "nome-legal", null, true); | ||
console.log(test); | ||
let json = images.memes(true); | ||
console.log(json); | ||
import nonimageapi from './index'; | ||
const images = new nonimageapi(); | ||
async function test() { | ||
let json = await images.memes(); | ||
console.log(json); | ||
} |
@@ -8,3 +8,5 @@ { | ||
"forceConsistentCasingInFileNames": true, | ||
"allowJs": true | ||
"esModuleInterop": true, | ||
"declaration": true, | ||
"outDir": "dist" | ||
}, | ||
@@ -15,4 +17,5 @@ "main": "index.ts", | ||
"files":[ | ||
"index.ts" | ||
"src/index.ts", | ||
"src/test.ts" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
12879
14
256
45
2
1