popcat_wrapper

Community

Join our server if you want to have fun or need any help!

Installation

pip install popcat_wrapper

Examples

Randomfacts command, no input example:

import discord, aiohttp, asyncio
from discord.ext import commands
import popcat_wrapper as pop
bot = commands.Bot(command_prefix=">")

@bot.command()
async def randomfacts(ctx):
  res = pop.randomfacts(text)

  await ctx.send(res)

bot.run("discord bot token")

Pikachu command, one input example:

import discord, aiohttp, asyncio
from discord.ext import commands
import popcat_wrapper as pop
bot = commands.Bot(command_prefix=">")

@bot.command()
async def pikachu(ctx):
  text = "String"
  image = pop.pikachu(text)

  await ctx.send(image)

bot.run("discord bot token")

Drake meme command, more than one text input example:

import discord, aiohttp, asyncio
from discord.ext import commands
import popcat_wrapper as pop
bot = commands.Bot(command_prefix=">")

@bot.command()
async def drake(ctx):
  text = "String"
  text2 = "String 2"
  image = pop.drake(text, text2)

  await ctx.send(image)

bot.run("discord bot token")

Ad command, image input example:

import discord, aiohttp, asyncio
from discord.ext import commands
import popcat_wrapper as pop
bot = commands.Bot(command_prefix=">")

@bot.command()
async def drake(ctx, member: discord.Member=None):
  if member == None:
    member = ctx.author
  pfp = member.avatar_url_as(size=128)
  image = pop.ad(pfp)

  await ctx.send(image)

bot.run("discord bot token")

Country command, object input example

import popcat_wrapper as pop

color = "ffcc99"
res = pop.country(name="canada")

print(res)

Output example:

{
 "name": "Canada",
 "domain": ".ca",
 "calling_codes": "1",
 "capital": "Ottawa",
 "region": "Northern America",
 "population": "36,155,487",
 "area": "9,984,670 Square KM",
 "flag": "https://api.popcatdev.repl.co/countries/canada/flag",
 "currency": {
  "short": "CAD",
  "name": "Canadian dollar",
  "symbol": "$"
 }
}

If you want to get data from a specific property (for example domain), you need to replace pop.country(name="canada") with pop.country(name="canada", property="domain"). You may have noticed that there is a sub object within the main one, you may ask "How do i get data from a property inside the sub object?"; here's how:

You use pop.country(name="canada", property="currency.propertyname").

For example: pop.country(name="canada", property="currency.symbol").

This method applies to Playstore, iTunes, WouldYouRather, RandomMeme, instagramUser, car, npm, banner, country, weather, github and Colorinfo.

Welcome card

import discord, aiohttp, asyncio
from discord.ext import commands
import popcat_wrapper as pop
bot = commands.Bot(command_prefix=">")

@bot.command()
async def welcomecard(ctx):
  image = pop.welcomecard(background,text1,text2,text3,)

  await ctx.send(image)

bot.run("discord bot token")

Endpoints

You can get a full list of the possible API endpoints Here
But here is the list:

  • drake(text1, text2)
  • pooh(text1, text2)
  • ship(image1, image2)
  • colorify(image, color)
  • biden(text)
  • pikachu(text)
  • drip(image)
  • clown(image)
  • ad(image)
  • blur(image)
  • invert(image)
  • greyscale(image)
  • jokeoverhead(image)
  • mnm(image)
  • translate(text, language)
  • reverse(text)
  • alert(text)
  • caution(text)
  • mock(text)
  • facts(text)
  • encode(text)
  • decode(binary)
  • doublestruck(text)
  • texttomorse(text)
  • playstore(app, property)
  • itunes(song, property)
  • npm(name, property)
  • instagramUser(user, property)
  • car(property)
  • colorinfo()
  • welcomecard(background, text1, text2, text3, avatar)
  • joke()
  • randommeme()
  • fact()
  • _8ball()
GitHub - NotFaizen/popcat_wrapper: A Python wrapper for popcat API
A Python wrapper for popcat API. Contribute to NotFaizen/popcat_wrapper development by creating an account on GitHub.