Skip to content

Latest commit

 

History

History
104 lines (71 loc) · 3.47 KB

start-docs.md

File metadata and controls

104 lines (71 loc) · 3.47 KB

AlexFlipnote.py | Docs

An easy-to-use Python Wrapper for the AlexFlipnote API
For any questions and support, you can join the AlexFlipnote server

Getting Started:

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()

For future reference in this documentation: when referring to 'alex_api' we refer to that above.

Using the wrapper:

All available methods and classes that are available in the wrapper are listed below.

Methods:

Classes:

Enums:

Examples

See here some examples

Get a random cat picture of gif:
import asyncio
import alexflipnote

alex_api: alexflipnote.Client = alexflipnote.Client()


async def get_cat() -> None:
    url = await alex_api.cat()
    print(url)
    await alex_api.close()  # preventing the "Unclosed client session" warning.


asyncio.run(get_cat())
Get a phub logo using discord.py:
from discord.ext import commands

import alexflipnote

bot = commands.Bot("!")
# just a example, the client doesn't have to be under bot
alex_api = alexflipnote.Client()


@bot.command(aliases=["ph"])
async def phublogo(ctx, *, texts: str):
    white, yellow = texts.split(" | ")
    url = await alex_api.phub(white, yellow)
    await ctx.send(f"Requested by {ctx.author}\n{url}")


# invoke: !ph Epic Gamer | Moment

bot.run("TOKEN")