nonimageapi
Advanced tools
Comparing version 1.0.1-beta.2 to 1.0.1
@@ -1,6 +0,6 @@ | ||
const images = require("../index.js"); | ||
const nonimageapi = require("../index.js"); | ||
const images = new nonimageapi(); | ||
let test = images.fakemsg("bomdia", "nome-legal", null, true); | ||
console.log(test); | ||
let json = images.memes(true) | ||
console.log(json) | ||
let json = images.memes(true); | ||
console.log(json); |
21
index.js
const fetch = require('node-fetch'); | ||
let url = "https://nonimageapi.apenasigor.repl.co/api/v1/"; | ||
module.exports.fakemsg = (msg, username, avatar, bot) => { | ||
class Image { | ||
constructor(Image) { | ||
this.ImageApi = Image; | ||
} | ||
fakemsg(msg, username, avatar, bot) { | ||
if(!bot) bot = false; // Retorna falso caso usuário não coloque "bot" | ||
@@ -11,4 +15,4 @@ if(!username) username="User"; // Caso usuário não colocar nome | ||
return url + `fake-message?avatar=${avatar}&username=${username}&text=${msg}&bot=${bot}`; // Retorna link da mensagem | ||
}; | ||
module.exports.memes = (json) => { | ||
} | ||
async memes(json) { | ||
if(json) { | ||
@@ -19,2 +23,11 @@ fetch(url + `memes?json=true`).then(res => res.json()).then(data => { | ||
} else return url + `memes`; | ||
}; | ||
}; | ||
async cats(json) { | ||
if(json) { | ||
fetch(url + `cats?json=true`).then(res => res.json()).then(data => { | ||
return data; | ||
}); | ||
} else return url + `cats`; | ||
}; | ||
} | ||
module.exports = Image; |
{ | ||
"name": "nonimageapi", | ||
"version": "1.0.1-beta.2", | ||
"version": "1.0.1", | ||
"description": "An image api for you to have fun", | ||
@@ -13,9 +13,11 @@ "main": "index.js", | ||
"keywords": [ | ||
"api" | ||
"api", | ||
"discord", | ||
"images" | ||
], | ||
"author": "Igor, ImmaUgc, M.Experimental", | ||
"license": "ISC", | ||
"dependencies": { | ||
"dev-dependencies": { | ||
"node-fetch": "^2.6.1" | ||
} | ||
} |
@@ -1,4 +0,29 @@ | ||
# NonImageApi | ||
# NonImageApi (Beta) | ||
- An api for your Discord bot, for FREE! | ||
# How to use? | ||
``` | ||
const NonImageApi = require('nonimageapi'); | ||
const images = new NonImageApi(); | ||
images.memes() // Set json to true or false (Optional) | ||
images.cats() // Set json to true or false (Optional) | ||
``` | ||
----- | ||
# All functions | ||
`memes(<Json>)` - Take meme from a reddit and turn it into an image (Json optional). | ||
`cats(<Json>)` - Take pictures of cats from reddit [Cats](https://www.reddit.com/r/cats) (Json optional). | ||
`fakemsg(<message>, <username>, <avatar>, <bot>)` - Creates a fake Discord message / Direct from our api website (Bot optional) | ||
# Coming Soon | ||
- More functions for our API | ||
# Thanks to contributors | ||
<center> | ||
[M. Experimental](https://twitter.com/m_experimental?s=09) | ||
[ImmaUGC](https://github.com/ImmaUgc) | ||
[ApenasIgorDev](https://github.com/apenasigordev) | ||
</center> |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2556
0
33
1
30
2
- Removednode-fetch@^2.6.1
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)