@mrbeastprolevel/popcat-api-wrapper-v2
v1.2.2
Published
An API wrapper for the pop cat API to make your life easier while using it!
Downloads
42
Maintainers
Readme
Installation
npm i @mrbeastprolevel/popcat-api-wrapper-v2
Examples
Jokes command, no input example:
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const Discord = require("discord.js");
const client = new Discord.Client({
intents: ["Guilds", "GuildMessages", "GuildMembers"],
});
client.on("messageCreate", async (message) => {
if (message.content.toLowerCase() === ">joke") {
const joke = await pop.joke();
joke.then(async (res) => {
<Channel>.send(res);
});
}
});
client.login("bot token");
Biden command, 1 text input example
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const Discord = require("discord.js");
const text = "String";
const img = await pop.biden(text);
img.then(() => {
const image = new Discord.AttachmentBuilder(img, { name: "biden.png" });
<Channel>.send({
files: [image],
});
});
Pooh meme command, more than one text input example
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const Discord = require("discord.js");
const text1 = "String";
const text2 = "String 2";
const img = await pop.pooh(text1, text2);
img.then(() => {
const image = new Discord.AttachmentBuilder(img, { name: "pooh.png" });
<Channel>.send({
files: [image],
});
});
Screenshot command, image output / output example \
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const Discord = require("discord.js");
const url = "https://youtube.com" // Any url
const ss = await pop.screenshot(url);
ss.then(() => {
const image = new Discord.AttachmentBuilder(ss, { name: "screenshot.png" });
<Channel>.send({
files: [image],
})
})
Drip command, image input example
const Discord = require("discord.js");
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
let user = message.mentions.users.first() || message.author;
const av = user.displayAvatarURL();
const image = await pop.drip(av);
image.then(() => {
const attachment = new Discord.AttachmentBuilder(res, { name: "drip.png" });
<Channel>.send({
files: [attachment],
});
});
Lyrics command, object output example :
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const song = "Zayn Vibez" // Song name
const lyrics = pop.lyrics(song)
lyrics.then(async (res) => {
console.log(res) // This will return an object with the song name, artist, and lyrics etc.
// console.log(data[0].lyrics) -> To get the lyrics only
// console.log(data[0].artist) -> To get the artist only
// console.log(data[0].title) -> To get the song name only
// console.log(data[0].album) -> To get the album name only
// console.log(data[0].image) -> To get the album image only
})
/**
{
lyrics: 'Lyrics',
artist: 'Artist',
title: 'Title',
album: 'Album',
image: 'Image'
}*/
Color command, object output example :
const pop = require("@mrbeastprolevel/popcat-api-wrapper-v2");
const color = "ffcc99";
const output = await pop.colorinfo(color);
output.then(async (res) => {
console.log(res);
});
/**
{
"hex": "#ffcc99",
"name": "Peach Orange",
"rgb": "rgb(255,204,153)",
"color_image": "https://api.popcat.xyz/color/image/ffcc99",
"brightened": "#ffe6cc"
}*/
So, if you want to collect for example the rgb, you need to:
console.log(output.rgb)
(gives out the rgb value of 'ffcc99' hex.)
This method applies for Playstore, iTunes, WouldYouRather, RandomMeme, instagramUser, npm and Colorinfo.
Welcome Card
const pop = require('@mrbeastprolevel/popcat-api-wrapper-v2')
const Discord = require("discord.js")
const image = await pop.welcomecard(background, avatar, text_1, text_2, text_3)
image.then(() => {
const attachment = new Discord.AttachmentBuilder(image, { name: "welcomecard.png" })
<Channel>.send({ files: [attachment] })
})
Endpoints
You can get a full list of the possible API endpoints Here
Copyright
- This API wrapper v1 was coded by popcat api developer. I've just updated and added quite a few new things init. Copyright goes to him respectively!. Click here To see the v1 wrapper.
Support
DM Zayn#9478
For Help & Support