An easy-to-use Python Wrapper for the AlexFlipnote API
For any questions and support, you can join the AlexFlipnote server
To begin with, you'll have to install the package by doing one of the following commands:
pip install -U alexflipnote.py
python -m pip -U install alexflipnote.py
After that, you will have to create the client:
import alexflipnote
alex_api = alexflipnote.Client("YOUR-API-TOKEN")
# a token is required for the following methods: colour, colour_image, colour_image_gradient,
# birb, dogs, sadcat, cats, coffee
For future reference in this documentation: when referring to 'alex_api' we refer to that above.
All available endpoints you can use.
Returns a Minecraft Achievement image with your text and icon.
- text (str) - Text for the achievement.
- icon (Optional[Union[str, int, MinecraftIcons]]) - Icon for the achievement.
Returns an "am I a joke" picture with your image.
- image (str) - Discord CDN URL for image.
Returns an "(image) bad" image.
- image (str) - Discord CDN URL for image.
Returns random birb picture or gif.
Returns calling meme picture with your text.
- text (str) - Text for the image.
Returns a fake captcha image with custom text.
- text (str) - Text for the image.
Returns random cat picture or gif.
Returns a Minecraft Challenge image with custom text and icon.
- text (str) - Text for the challenge.
- icon (Optional[Union[str, int, MinecraftIcons]]) - Icon for the challenge.
Returns random coffee image. This uses the coffee.alexflipnote.dev API.
Returns info on random or provided hex colour.
Aliases: color
- colour (Optional[str]) - HEX colour value
Returns an image of random or provided hex colour.
Aliases: color_image
- colour (Optional[str]) - HEX colour value
Return an image with gradients of random or provided hex colour.
Aliases: color_image_gradient
- colour (Optional[str]) - HEX colour value
Recolour an image to the colours you desire.
Aliases: colorify
- image (str) - Discord CDN URL as the image.
- colour (Optional[str]) - HEX colour value
- background (Optional[str]) - HEX colour value
Returns a Google "Did you mean" suggestion image with your texts.
Aliases: didyoumean
Returns random dog picture or gif.
Returns a custom drake meme image.
Returns a image of the facts book with your text.
- text (str) | The fact.
Returns your provided image with a filter on it.
- name (Union[str, int, Filters]) - The filter for the image.
- image (str) - Discord CDN URL as the image to put the filter on.
Returns a "Don't touch the floor" meme with your text and image.
Returns a random string of fu*k my life text.
When the jokes goes over the head. R/WOOOOOSH
Aliases: jokeoverhead
- image (str) - Discord CDN URL as the image.
Returns a custom Pornhub logo!
Returns random sadcat picture or gif.
When someone is being salty.
- image (str) - Discord CDN URL as the image.
Returns a "Dock Of Shame" picture with your own image in the middle.
- image (str) - Discord CDN URL as the image.
Make that scroll meme with your text.
- text (str) - The scroll text.
Ship someone or yourself with someone else.
Make a custom supreme logo.
- text (str) - Text for the logo.
- dark (bool) - Make the background dark.
- light (bool) - Make the background light.
Throw someone in the trash bin 🚮
Returns an image with "what" under the provided image.
- image (str) - Discord CDN URL as the image.
Returns an invitation to the AlexFlipnote server + the creator of this wrapper.
- creator (bool) - To also get an invitation to the server of creator of this wrapper.
See here some examples
Make a custom supreme logo:
import asyncio
import alexflipnote
alex_api = alexflipnote.Client("YOUR-API-TOKEN")
async def custom_supreme_logo(text, dark = False, light = False):
supreme = await alex_api.supreme(text, dark, light)
print(supreme)
await alex_api.close() # preventing the "Unclosed client _session" warning.
asyncio.get_event_loop().run_until_complete(custom_supreme_logo('#some text, yes', dark = True))
Minecraft achievement (same for alex_api.challenge()
) using discord.py:
import discord
import alexflipnote
from discord.ext import commands
bot = commands.Bot(command_prefix = "!")
alex_api = alexflipnote.Client("YOUR-API-TOKEN",
loop = bot.loop) # just a example, the client doesn't have to be under bot and loop kwarg is optional
@bot.command()
async def achievement(ctx, text: str, icon = None):
image = await alex_api.achievement(text = text, icon = icon)
image_bytes = await image.read()
file = discord.File(image_bytes, "achievement.png")
await ctx.send(f"Rendered by {ctx.author}", file = file)
# invoke: !achievement "nice job!" diamond_sword
bot.run("TOKEN")
Since the API now requires a token for all endpoints, you can't embed a link from the API anymore.. but here is how to embed it via a file using discord.py:
import discord
import alexflipnote
from discord.ext import commands
bot = commands.Bot(command_prefix = "!!")
alex_api = alexflipnote.Client("YOUR-API-TOKEN",
loop = bot.loop) # just a example, the client doesn't have to be under bot and loop kwarg is optional
@bot.command()
async def supreme(ctx, text: str):
# Embed
embed = discord.Embed(title = f"Rendered by {ctx.author}") # this is a example, everything is optional.
embed.set_image(url = "attachment://supreme.png") # attaching file image to embed.
# Wrapper
image = await alex_api.supreme(text = text) # get Image object
image_bytes = await image.read() # get io.BytesIO object
# Sending
file = discord.File(image_bytes, "supreme.png") # pass io.BytesIO object to discord.File with a filename.
await ctx.send(embed = embed, file = file) # send both the embed and file, the file will attach to the embed.
# Or ----
# Oneline, because oneline = best
embed = discord.Embed(title = f"Rendered by {ctx.author}").set_image(url = "attachment://supreme.png")
image = discord.File(await (await alex_api.supreme(text = text)).read(), "supreme.png")
await ctx.send(embed = embed, file = image)
# invoke: !supreme Supreme
bot.run("TOKEN")
Here is explained what attributes the returned objects have
The object returned from alex_api.achievement()
, alex_api.amiajoke()
, alex_api.bad()
, alex_api.calling()
,
alex_api.captcha()
, alex_api.challenge()
, alex_api.colour_image()
, alex_api.colour_image_gradient()
,
alex_api.colourify()
, alex_api.didyoumean()
, alex_api.drake()
, alex_api.facts()
, alex_api.filter()
,
alex_api.floor()
, alex_api.jokeoverhead()
, alex_api.pornhub()
, alex_api.shame()
, alex_api.salty()
,
alex_api.scroll()
, alex_api.ship()
, alex_api.supreme()
, alex_api.trash()
, alex_api.what()
The url of the image
This will return a io.BytesIO object, which can be passed to discord.File() with a filename for discord.py:
supreme_logo = await alex_api.supreme("ah yes")
supreme_bytes = await supreme_logo.read() # <_io.BytesIO object at 0x0438DFC8> - BytesIO object.
await ctx.send(file = discord.File(supreme_bytes, filename = "supreme.png"))
You can set bytesio
to False
if you want raw bytes instead of an io.BytesIO
object.
The object returned from alex_api.colour()
The colour's blackorwhite_text hex
The colour's brightness value
The colour's HEX value
An image of the colour
An image of the colour's gradient
The INT value of colour
The name of colour
The RGB values of colour
A ColourRGB object
The colour's shades
The colour's tints
The object returned from alex_api.colour().rgb_values
All RGB values of the colour in a dict
The R values of the colour
The G values of the colour
The B values of the colour
Enum for .achievement()
and .challenge()
.
Grass Block icon for the achievement or challenge.
Diamond icon for the achievement or challenge.
Diamond Sword icon for the achievement or challenge.
Creeper icon for the achievement or challenge.
Pig icon for the achievement or challenge.
Tnt icon for the achievement or challenge.
Cookie icon for the achievement or challenge.
Heart icon for the achievement or challenge.
Bed icon for the achievement or challenge.
Cake icon for the achievement or challenge.
Sign icon for the achievement or challenge.
Rail icon for the achievement or challenge.
Crafting Bench icon for the achievement or challenge.
Redstone icon for the achievement or challenge.
Fire icon for the achievement or challenge.
Cobweb icon for the achievement or challenge.
Chest icon for the achievement or challenge.
Furnace icon for the achievement or challenge.
Book icon for the achievement or challenge.
Stone Block icon for the achievement or challenge.
Wooden Plank Block icon for the achievement or challenge.
Iron Ingot icon for the achievement or challenge.
Gold Ingot icon for the achievement or challenge.
Wooden Door icon for the achievement or challenge.
Iron Door icon for the achievement or challenge.
Diamond Chestplate icon for the achievement or challenge.
Flint And Steel icon for the achievement or challenge.
Glass Bottle icon for the achievement or challenge.
Splash Potion icon for the achievement or challenge.
Creeper Spawnegg icon for the achievement or challenge.
Creeperspawnegg icon for the achievement or challenge.
Coal icon for the achievement or challenge.
Iron Sword icon for the achievement or challenge.
Bow icon for the achievement or challenge.
Arrow icon for the achievement or challenge.
Iron Chestplate icon for the achievement or challenge.
Bucket icon for the achievement or challenge.
Bucket With Water icon for the achievement or challenge.
Bucket With Milk icon for the achievement or challenge.
Diamond Boots icon for the achievement or challenge.
Wooden Hoe icon for the achievement or challenge.
Bread icon for the achievement or challenge.
Wooden Sword icon for the achievement or challenge.
Bone icon for the achievement or challenge.
Oak Log icon for the achievement or challenge.
Random icon from above for the achievement or challenge.
Enum for .filter()
.
Blur filter.
Invert filter.
Black and White filter.
Deepfry filter.
Sepia filter.
Pixelate filter.
Magik filter.
Jpegify filter.
Wide filter.
Flip filter.
Mirror filter.
Snow filter.
Gay filter.
Communist filter.
Random filter from above.