1.0.5 • Published 4 years ago
randomyuiz v1.0.5
randomyuiz
RandomYuiz API wrapper for Node.js
Installing
# npm
npm i randomyuiz
yarn add randomyuiz
Example Usage
.animeImage(type)
- type = "anime", "chika", "hayasaka", "kaguyashinomiya", "megumin", "oyasumi", "rem", "zerotwo"
async function start() {
const { randomyuiz } = require("randomyuiz");
let data = new randomyuiz;
let img = await data.animeImage("anime"); //You can change "anime" with following options above
console.log(img) //return an image
}
start()
.filterImage(type, imageURL)
- type = "sepia", "grayscale", "invert"
- imageURL(url) = (REQUIRED)
async function startRendering() {
const { randomyuiz } = require("randomyuiz");
let data = new randomyuiz;
let img = await data.filterImage('sepia', 'https://cdn.ram.moe/Bk6IgCMel.jpg'); //if imageURL empty, it will return default image as example
console.log(img) //return an image
}
startRendering()
Discord.js Example
async function startRendering() {
const { randomyuiz } = require("randomyuiz");
let data = new randomyuiz;
let images = await data.filterImage('sepia', msg.author.avatarURL({size: 2048, format: 'png'}));
msg.channel.send({ files: [{ attachment: images, name: 'sepia.png' }] }); //result
}
startRendering()